]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/list/rest_n.hpp
update boost to version 1.29.0
[lyx.git] / boost / boost / preprocessor / list / rest_n.hpp
1 # /* Copyright (C) 2001
2 #  * Housemarque Oy
3 #  * http://www.housemarque.com
4 #  *
5 #  * Permission to copy, use, modify, sell and distribute this software is
6 #  * granted provided this copyright notice appears in all copies. This
7 #  * software is provided "as is" without express or implied warranty, and
8 #  * with no claim as to its suitability for any purpose.
9 #  */
10 #
11 # /* Revised by Paul Mensonides (2002) */
12 #
13 # /* See http://www.boost.org for most recent version. */
14 #
15 # ifndef BOOST_PREPROCESSOR_LIST_REST_N_HPP
16 # define BOOST_PREPROCESSOR_LIST_REST_N_HPP
17 #
18 # include <boost/preprocessor/arithmetic/dec.hpp>
19 # include <boost/preprocessor/config/config.hpp>
20 # include <boost/preprocessor/control/while.hpp>
21 # include <boost/preprocessor/list/adt.hpp>
22 # include <boost/preprocessor/tuple/elem.hpp>
23 #
24 # /* BOOST_PP_LIST_REST_N */
25 #
26 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
27 #    define BOOST_PP_LIST_REST_N(count, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_REST_N_P, BOOST_PP_LIST_REST_N_O, (list, count)))
28 # else
29 #    define BOOST_PP_LIST_REST_N(count, list) BOOST_PP_LIST_REST_N_I(count, list)
30 #    define BOOST_PP_LIST_REST_N_I(count, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_REST_N_P, BOOST_PP_LIST_REST_N_O, (list, count)))
31 # endif
32 #
33 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
34 #    define BOOST_PP_LIST_REST_N_P(d, lc) BOOST_PP_TUPLE_ELEM(2, 1, lc)
35 # else
36 #    define BOOST_PP_LIST_REST_N_P(d, lc) BOOST_PP_LIST_REST_N_P_I lc
37 #    define BOOST_PP_LIST_REST_N_P_I(list, count) count
38 # endif
39 #
40 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
41 #    define BOOST_PP_LIST_REST_N_O(d, lc) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(2, 0, lc)), BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2, 1, lc)))
42 # else
43 #    define BOOST_PP_LIST_REST_N_O(d, lc) BOOST_PP_LIST_REST_N_O_I lc
44 #    define BOOST_PP_LIST_REST_N_O_I(list, count) (BOOST_PP_LIST_REST(list), BOOST_PP_DEC(count))
45 # endif
46 #
47 # /* BOOST_PP_LIST_REST_N_D */
48 #
49 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
50 #    define BOOST_PP_LIST_REST_N_D(d, count, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_REST_N_P, BOOST_PP_LIST_REST_N_O, (list, count)))
51 # else
52 #    define BOOST_PP_LIST_REST_N_D(d, count, list) BOOST_PP_LIST_REST_N_D_I(d, count, list)
53 #    define BOOST_PP_LIST_REST_N_D_I(d, count, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_REST_N_P, BOOST_PP_LIST_REST_N_O, (list, count)))
54 # endif
55 #
56 # endif