1 # /* Copyright (C) 2001
\r
3 # * http://www.housemarque.com
\r
5 # * Distributed under the Boost Software License, Version 1.0. (See
\r
6 # * accompanying file LICENSE_1_0.txt or copy at
\r
7 # * http://www.boost.org/LICENSE_1_0.txt)
\r
9 # * See http://www.boost.org for most recent version.
\r
12 # /* Revised by Paul Mensonides (2002) */
\r
14 # ifndef BOOST_PREPROCESSOR_LIST_ADT_HPP
\r
15 # define BOOST_PREPROCESSOR_LIST_ADT_HPP
\r
17 # include <boost/preprocessor/config/config.hpp>
\r
18 # include <boost/preprocessor/detail/is_binary.hpp>
\r
19 # include <boost/preprocessor/logical/compl.hpp>
\r
20 # include <boost/preprocessor/tuple/eat.hpp>
\r
22 # /* BOOST_PP_LIST_CONS */
\r
24 # define BOOST_PP_LIST_CONS(head, tail) (head, tail)
\r
26 # /* BOOST_PP_LIST_NIL */
\r
28 # define BOOST_PP_LIST_NIL BOOST_PP_NIL
\r
30 # /* BOOST_PP_LIST_FIRST */
\r
32 # define BOOST_PP_LIST_FIRST(list) BOOST_PP_LIST_FIRST_D(list)
\r
34 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
\r
35 # define BOOST_PP_LIST_FIRST_D(list) BOOST_PP_LIST_FIRST_I list
\r
37 # define BOOST_PP_LIST_FIRST_D(list) BOOST_PP_LIST_FIRST_I ## list
\r
40 # define BOOST_PP_LIST_FIRST_I(head, tail) head
\r
42 # /* BOOST_PP_LIST_REST */
\r
44 # define BOOST_PP_LIST_REST(list) BOOST_PP_LIST_REST_D(list)
\r
46 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
\r
47 # define BOOST_PP_LIST_REST_D(list) BOOST_PP_LIST_REST_I list
\r
49 # define BOOST_PP_LIST_REST_D(list) BOOST_PP_LIST_REST_I ## list
\r
52 # define BOOST_PP_LIST_REST_I(head, tail) tail
\r
54 # /* BOOST_PP_LIST_IS_CONS */
\r
56 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()
\r
57 # define BOOST_PP_LIST_IS_CONS(list) BOOST_PP_LIST_IS_CONS_D(list)
\r
58 # define BOOST_PP_LIST_IS_CONS_D(list) BOOST_PP_LIST_IS_CONS_ ## list
\r
59 # define BOOST_PP_LIST_IS_CONS_(head, tail) 1
\r
60 # define BOOST_PP_LIST_IS_CONS_BOOST_PP_NIL 0
\r
62 # define BOOST_PP_LIST_IS_CONS(list) BOOST_PP_IS_BINARY(list)
\r
65 # /* BOOST_PP_LIST_IS_NIL */
\r
67 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()
\r
68 # define BOOST_PP_LIST_IS_NIL(list) BOOST_PP_COMPL(BOOST_PP_IS_BINARY(list))
\r
70 # define BOOST_PP_LIST_IS_NIL(list) BOOST_PP_COMPL(BOOST_PP_LIST_IS_CONS(list))
\r