3 <title>BOOST_PP_LIST_FOLD_RIGHT_2ND
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_LIST_FOLD_RIGHT_2ND
</b> macro folds (or accumulates) the elements of a
<i>list
</i> right-to-left.
12 <b>BOOST_PP_LIST_FOLD_RIGHT_2ND
</b>(
<i>op
</i>,
<i>state
</i>,
<i>list
</i>)
18 A ternary operation of the form
<i>op
</i>(
<i>d
</i>,
<i>state
</i>,
<i>elem
</i>).
19 This macro is called for each element in
<i>list
</i>--each time returning a new
<i>state
</i>.
20 This operation is expanded by
<b>BOOST_PP_LIST_FOLD_RIGHT
</b> with the next available
<b>BOOST_PP_WHILE
</b> iteration,
21 the current
<i>state
</i>, and the current element.
25 The initial state of the fold.
29 The
<i>list
</i> to be folded.
34 This macro does not have the same signature as it previously did.
35 The arguments have been swapped to provide a uniform interface with
<b>BOOST_PP_LIST_FOLD_LEFT
</b>.
38 For the
<i>list
</i>, (
<i>0</i>, (
<i>1</i>, (
<i>2</i>,
<b>BOOST_PP_NIL
</b>))), this macro expands to:
40 <i>op
</i>(
<i>d
</i>,
<i>op
</i>(
<i>d
</i>,
<i>op
</i>(
<i>d
</i>,
<i>state
</i>,
<i>0</i>),
<i>1</i>),
<i>2</i>)
44 This macro is deprecated.
45 Use
<b>BOOST_PP_LIST_FOLD_RIGHT_
<i>d
</i></b> instead.
49 <li><a href=
"list_fold_right.html">BOOST_PP_LIST_FOLD_RIGHT
</a></li>
50 <li><a href=
"list_fold_right_d.html">BOOST_PP_LIST_FOLD_RIGHT_
<i>d
</i></a></li>
54 <b>Header:
</b> <a href=
"../headers/list/fold_right.html"><boost/preprocessor/list/fold_right.hpp
></a>
58 #include
<<a href=
"../headers/cat.html">boost/preprocessor/cat.hpp
</a>>
59 #include
<<a href=
"../headers/list/fold_right.html">boost/preprocessor/list/fold_right.hpp
</a>>
61 #define LIST (a, (b, (c,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
63 #define OP(d, state, x)
<a href=
"cat.html">BOOST_PP_CAT
</a>(state, x)
65 <a href=
"list_fold_right_2nd.html">BOOST_PP_LIST_FOLD_RIGHT_2ND
</a>(OP, _, LIST) // expands to _cba
68 <div style=
"margin-left: 0px;">
69 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
70 </br><i>© Copyright Paul Mensonides
2002</i>
72 <div style=
"margin-left: 0px;">
73 <p><small>Distributed under the Boost Software License, Version
1.0. (See
74 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
76 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>