The BOOST_PP_SET_FOLD_RIGHT macro folds (or accumulates) the elements of a set right-to-left.
Usage
BOOST_PP_SET_FOLD_RIGHT(op, state, set)
Arguments
- op
-
A ternary operation of the form op(s, state, elem).
This macro is called for each element in set--each time returning a new state.
This operation is expanded by BOOST_PP_SET_FOLD_RIGHT with the next available fold step,
the current state, and the current element.
- state
-
The initial state of the fold.
- set
-
The set to be folded.
Remarks
For the
set, (
0)(
1)(
2), this macro expands to:
op(s, op(s, op(s, state, 2), 1), 0)
For maximum efficiency, BOOST_PP_SET_FOLD_RIGHT can be reentered with BOOST_PP_SET_FOLD_RIGHT_s.
See Also
Requirements
Sample Code