The BOOST_PP_LIST_CONS macro is a list constructor.
Usage
BOOST_PP_LIST_CONS(head, tail)
Arguments
- head
-
An element in a list.
- tail
-
Either a list, BOOST_PP_LIST_NIL, or BOOST_PP_NIL.
Remarks
This macro appends a new head to an existing list or creates a list from BOOST_PP_LIST_NIL.
This macro is no longer necessary.
For example...
BOOST_PP_LIST_CONS(a, BOOST_PP_LIST_CONS(b, BOOST_PP_LIST_NIL)))
...is just an explicit way of writing the following:
(a, (b, BOOST_PP_NIL))
Because of this, this macro is deprecated.
See Also
Requirements
#include <boost/preprocessor/list/adt.hpp>
#define OLD /* ........... */ \
BOOST_PP_LIST_CONS( \
a, \
BOOST_PP_LIST_CONS( \
b, \
BOOST_PP_LIST_CONS( \
c, \
BOOST_PP_LIST_NIL \
) \
) \
) \
/**/
#define NEW (a, (b, (c, BOOST_PP_NIL)))
BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
// expands to a == a
BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
// expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))