blob: 072541cb97a4a3f1d27a16680426292e7ec1db26 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001# /* Copyright (C) 2001
2# * Housemarque Oy
3# * http://www.housemarque.com
4# *
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)
8# *
9# * See http://www.boost.org for most recent version.
10# */
11#
12# /* Revised by Paul Mensonides (2002) */
13#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070014# ifndef NDNBOOST_PREPROCESSOR_LIST_ADT_HPP
15# define NDNBOOST_PREPROCESSOR_LIST_ADT_HPP
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016#
Jeff Thompson2277ce52013-08-01 17:34:11 -070017# include <ndnboost/preprocessor/config/config.hpp>
18# include <ndnboost/preprocessor/detail/is_binary.hpp>
19# include <ndnboost/preprocessor/logical/compl.hpp>
20# include <ndnboost/preprocessor/tuple/eat.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# /* NDNBOOST_PP_LIST_CONS */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070023#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024# define NDNBOOST_PP_LIST_CONS(head, tail) (head, tail)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026# /* NDNBOOST_PP_LIST_NIL */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070027#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070028# define NDNBOOST_PP_LIST_NIL NDNBOOST_PP_NIL
Jeff Thompsonf7d49942013-08-01 16:47:40 -070029#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030# /* NDNBOOST_PP_LIST_FIRST */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070031#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070032# define NDNBOOST_PP_LIST_FIRST(list) NDNBOOST_PP_LIST_FIRST_D(list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070033#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070034# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_MWCC()
35# define NDNBOOST_PP_LIST_FIRST_D(list) NDNBOOST_PP_LIST_FIRST_I list
Jeff Thompsonf7d49942013-08-01 16:47:40 -070036# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037# define NDNBOOST_PP_LIST_FIRST_D(list) NDNBOOST_PP_LIST_FIRST_I ## list
Jeff Thompsonf7d49942013-08-01 16:47:40 -070038# endif
39#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070040# define NDNBOOST_PP_LIST_FIRST_I(head, tail) head
Jeff Thompsonf7d49942013-08-01 16:47:40 -070041#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042# /* NDNBOOST_PP_LIST_REST */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070043#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044# define NDNBOOST_PP_LIST_REST(list) NDNBOOST_PP_LIST_REST_D(list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070045#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_MWCC()
47# define NDNBOOST_PP_LIST_REST_D(list) NDNBOOST_PP_LIST_REST_I list
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049# define NDNBOOST_PP_LIST_REST_D(list) NDNBOOST_PP_LIST_REST_I ## list
Jeff Thompsonf7d49942013-08-01 16:47:40 -070050# endif
51#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052# define NDNBOOST_PP_LIST_REST_I(head, tail) tail
Jeff Thompsonf7d49942013-08-01 16:47:40 -070053#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070054# /* NDNBOOST_PP_LIST_IS_CONS */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070055#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070056# if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_BCC()
57# define NDNBOOST_PP_LIST_IS_CONS(list) NDNBOOST_PP_LIST_IS_CONS_D(list)
58# define NDNBOOST_PP_LIST_IS_CONS_D(list) NDNBOOST_PP_LIST_IS_CONS_ ## list
59# define NDNBOOST_PP_LIST_IS_CONS_(head, tail) 1
60# define NDNBOOST_PP_LIST_IS_CONS_NDNBOOST_PP_NIL 0
Jeff Thompsonf7d49942013-08-01 16:47:40 -070061# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070062# define NDNBOOST_PP_LIST_IS_CONS(list) NDNBOOST_PP_IS_BINARY(list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070063# endif
64#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070065# /* NDNBOOST_PP_LIST_IS_NIL */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070066#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_BCC()
68# define NDNBOOST_PP_LIST_IS_NIL(list) NDNBOOST_PP_COMPL(NDNBOOST_PP_IS_BINARY(list))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070069# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070070# define NDNBOOST_PP_LIST_IS_NIL(list) NDNBOOST_PP_COMPL(NDNBOOST_PP_LIST_IS_CONS(list))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070071# endif
72#
73# endif