3 <title>BOOST_PP_LIST_FOLD_RIGHT_2ND_D
</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_D
</b> macro folds (or accumulates) the elements of a
<i>list
</i> right-to-left.
9 It reenters
<b>BOOST_PP_WHILE
</b> with maximum efficiency.
13 <b>BOOST_PP_LIST_FOLD_RIGHT_2ND_D
</b>(
<i>d
</i>,
<i>op
</i>,
<i>state
</i>,
<i>list
</i>)
19 The next available
<b>BOOST_PP_WHILE
</b> iteration.
23 A ternary operation of the form
<i>op
</i>(
<i>d
</i>,
<i>state
</i>,
<i>elem
</i>).
24 This macro is called for each element in
<i>list
</i>--each time returning a new
<i>state
</i>.
25 This operation is expanded by
<b>BOOST_PP_LIST_FOLD_RIGHT
</b> with the next available
<b>BOOST_PP_WHILE
</b> iteration,
26 the current
<i>state
</i>, and the current element.
30 The initial state of the fold.
34 The
<i>list
</i> to be folded.
39 For the
<i>list
</i>, (
<i>0</i>, (
<i>1</i>, (
<i>2</i>,
<b>BOOST_PP_NIL
</b>))), this macro expands to:
41 <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>)
45 This macro has been superceded by
<b>BOOST_PP_LIST_FOLD_RIGHT_
<i>d
</i></b> and is deprecated.
46 It only allows a single reentry into
<b>BOOST_PP_LIST_FOLD_RIGHT
</b>.
50 <li><a href=
"list_fold_right.html">BOOST_PP_LIST_FOLD_RIGHT
</a></li>
51 <li><a href=
"list_fold_right_d.html">BOOST_PP_LIST_FOLD_RIGHT_
<i>d
</i></a></li>
55 <b>Header:
</b> <a href=
"../headers/list/fold_right.html"><boost/preprocessor/list/fold_right.hpp
></a>
59 #include
<<a href=
"../headers/cat.html">boost/preprocessor/cat.hpp
</a>>
60 #include
<<a href=
"../headers/list/fold_right.html">boost/preprocessor/list/fold_right.hpp
</a>>
62 #define L1 (a, (b, (c,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
63 #define L2 (L1, (L1, (L1,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
65 #define OP(d, state, x) (
<a href=
"list_fold_right_2nd_d.html">BOOST_PP_LIST_FOLD_RIGHT_2ND_D
</a>(d, OP_2, _, x), state)
66 #define OP_2(d, state, x)
<a href=
"cat.html">BOOST_PP_CAT
</a>(state, x)
68 <a href=
"list_fold_right.html">BOOST_PP_LIST_FOLD_RIGHT
</a>(OP,
<a href=
"nil.html">BOOST_PP_NIL
</a>, L2)
71 (_cba , (_cba , (_cba ,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
75 <div style=
"margin-left: 0px;">
76 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
77 </br><i>© Copyright Paul Mensonides
2002</i>
79 <div style=
"margin-left: 0px;">
80 <p><small>Distributed under the Boost Software License, Version
1.0. (See
81 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
83 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>