The BOOST_PP_LIST_FIRST macro expands to the head of a list.

Usage

BOOST_PP_LIST_FIRST(list)

Arguments

list
A non-nil list.

Requirements

Header:  <boost/preprocessor/list/adt.hpp>

Sample Code

#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))

© Copyright Housemarque Oy 2002
© Copyright Paul Mensonides 2002

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)