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