The BOOST_PP_SET_REPLACE macro replaces an element in a set.

Usage

BOOST_PP_SET_RPLACE(set, i, elem)

Arguments

set
The set in which an element is to be replaced.
i
The zero-based position in set of the element to be replaced.  Valid values range from 0 to BOOST_PP_SET_SIZE(set) - 1.
elem
The element to replace the element at index i within set.

Remarks

This macro returns set after replacing the element at index i with elem.

Requirements

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

Sample Code

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

#define SET (a)(b)(x)(d)

BOOST_PP_SET_REPLACE(SET, 2, c) // expands to (a)(b)(c)(d)