3 <title>BOOST_PP_DEDUCE_D
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_DEDUCE_D
</b> macro manually deduces the state of the
<b>BOOST_PP_WHILE
</b> construct.
12 <b>BOOST_PP_DEDUCE_D
</b>()
16 This macro is intended to avoid the use of
<i>automatic-recursion
</i> at deep expansion depths.
17 <i>Automatic-recursion
</i> at such depths can be inefficient on some preprocessors.
18 It is not intended to be used directly with the invocation of macros with a
<b>_D
</b> suffix such as:
20 <b>BOOST_PP_ADD_D
</b>(
<b>BOOST_PP_DEDUCE_D
</b>(),
<i>x
</i>,
<i>y
</i>)
22 If it is used in this context, the
<b>_D
</b> macro will fail.
23 The
<b>_D
</b> macros directly concatenate to the
<i>d
</i> parameter that is passed to them,
24 which would prevent
<b>BOOST_PP_DEDUCE_D
</b>() from expanding.
25 Furthermore, it is pointless to use this macro in a situation such as this
26 because it would already be too late to gain any efficiency.
30 <li><a href=
"while.html">BOOST_PP_WHILE
</a></li>
34 <b>Header:
</b> <a href=
"../headers/control/deduce_d.html"><boost/preprocessor/control/deduce_d.hpp
></a>
38 #include
<<a href=
"../headers/arithmetic/add.html">boost/preprocessor/arithmetic/add.hpp
</a>>
39 #include
<<a href=
"../headers/arithmetic/inc.html">boost/preprocessor/arithmetic/inc.hpp
</a>>
40 #include
<<a href=
"../headers/arithmetic/sub.html">boost/preprocessor/arithmetic/sub.hpp
</a>>
41 #include
<<a href=
"../headers/control/deduce_d.html">boost/preprocessor/control/deduce_d.hpp
</a>>
42 #include
<<a href=
"../headers/punctuation/comma_if.html">boost/preprocessor/punctuation/comma_if.hpp
</a>>
43 #include
<<a href=
"../headers/repetition/repeat.html">boost/preprocessor/repetition/repeat.hpp
</a>>
44 #include
<<a href=
"../headers/tuple/elem.html">boost/preprocessor/tuple/elem.hpp
</a>>
46 #define RANGE(first, last) \
47 <a href=
"repeat.html">BOOST_PP_REPEAT
</a>( \
48 <a href=
"inc.html">BOOST_PP_INC
</a>( \
49 <a href=
"sub.html">BOOST_PP_SUB
</a>(last, first) \
52 (first,
<a href=
"deduce_d.html">BOOST_PP_DEDUCE_D
</a>()) \
56 #define RANGE_M(z, n, data) \
59 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, data), \
60 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
1, data) \
64 #define RANGE_M_2(n, first, d) \
65 <a href=
"comma_if.html">BOOST_PP_COMMA_IF
</a>(n)
<a href=
"add_d.html">BOOST_PP_ADD_D
</a>(d, n, first) \
68 RANGE(
5,
10) // expands to
5,
6,
7,
8,
9,
10
71 <div style=
"margin-left: 0px;">
72 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
73 </br><i>© Copyright Paul Mensonides
2002</i>
75 <div style=
"margin-left: 0px;">
76 <p><small>Distributed under the Boost Software License, Version
1.0. (See
77 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
79 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>