The BOOST_PP_SET_TRANSFORM macro transforms each element in a set according to a supplied transformation.

Usage

BOOST_PP_SET_TRANSFORM(op, data, set)

Arguments

op
A ternary predicate of the form op(s, data, elem).  This transformation is expanded by BOOST_PP_SET_TRANSFORM for each element in set with the next available BOOST_PP_SET_FOLD_LEFT fold step, the auxiliary data, and the current element in set
data
Auxiliary data passed to pred.
set
The set to be transformed.

Remarks

This macro expands op for each element in set.  It builds a new set out of the results of each call.  If, for example, set is (a)(b)(c), this macro expands to...
(op(d, data, a))(op(d, data, b))(op(d, data, c))
For maximum efficiency, use BOOST_PP_SET_TRANSFORM_S.

See Also

Requirements

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

Sample Code

#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/set/transform.hpp>

#define SET (1)(3)(2)(5)

#define OP(s, data, elem) BOOST_PP_DEC(elem)

BOOST_PP_SET_TRANSFORM(OP, 3, SET)
   // expands to (0)(2)(1)(4)