The BOOST_PP_LIST_TO_ARRAY macro converts a list to an array.

Usage

BOOST_PP_LIST_TO_ARRAY(list)

Arguments

list
The list to be converted.

Remarks

This macro uses BOOST_PP_WHILE. Within BOOST_PP_WHILE, it is more efficient to use BOOST_PP_LIST_TO_ARRAY_D.

If the list to be converted is empty, as represented by 'BOOST_PP_NIL', the resulting array is empty, as represented by '( 0, () )'.

See Also

Requirements

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

Sample Code

#include <boost/preprocessor/list/to_array.hpp>

#define LIST (a, (b, (c, BOOST_PP_NIL)))

BOOST_PP_LIST_TO_ARRAY(LIST) // expands to (3, (a, b, c))

© Copyright Edward Diener 2011

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)