The BOOST_PP_TUPLE_REPLACE macro replaces an element in a tuple.

Usage

BOOST_PP_TUPLE_REPLACE(tuple, i, elem) (v)

Arguments

tuple
A tuple to replace an element in.
i
The zero-based position in tuple of the element to be replaced.  Valid values range from 0 to BOOST_PP_TUPLE_SIZE(tuple) - 1.
elem
The replacement element.

Remarks

This macro uses BOOST_PP_WHILE interally.  Therefore, to use the d parameter passed from other macros that use BOOST_PP_WHILE, see BOOST_PP_TUPLE_REPLACE_D.

See Also

Requirements

Header:  <boost/preprocessor/tuple/replace.hpp>

Sample Code

#include <boost/preprocessor/tuple/replace.hpp>

#define TUPLE (a, x, c)

BOOST_PP_TUPLE_REPLACE(TUPLE, 1, b) // expands to (a, b, c))

© Copyright Edward Diener 2013

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)