|
Boost.PreprocessorReference |
This header defines the fundamental list operations.
List constructor.
Lists are build using list constructors BOOST_PP_LIST_NIL and BOOST_PP_LIST_CONS(). For example,
BOOST_PP_LIST_CONS(1, BOOST_PP_LIST_CONS(2, BOOST_PP_LIST_CONS(3, BOOST_PP_LIST_CONS(4, BOOST_PP_LIST_CONS(5, BOOST_PP_LIST_NIL)))))
Short lists can also be build from tuples:
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.
Longer lists can be built with the help of BOOST_PP_LIST_APPEND().
List nil constructor.
Expands to 1 if the list is not nil and 0 otherwise.
Expands to 1 if the list is nil and 0 otherwise.
Expands to the first element of the list. The list must not be nil.
For example,
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
expands to 1.
Expands to a list of all but the first element of the list.
The list must not be nil.
For example,
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
expands to the same as:
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
Revised
© Copyright Housemarque Oy 2002
Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.