
14 Sep
2012
14 Sep
'12
5:40 p.m.
AMDG On 09/14/2012 09:24 AM, Lorenzo Caminiti wrote:
Hello all,
I have a curiosity about an implementation detail of Boost.Preprocessor: How does the lib implement Automatic Recursion?
<snip>
It looks something like this: #define TEST_BOOST_PP_REPEAT_1(n, macro, data) 0 #define TEST_OKAY(z, n, data) 1 // expands to 1 if we BOOST_PP_REPEAT_1 is available BOOST_PP_CAT(TEST_, BOOST_PP_REPEAT_1(1, OKAY, ~)) There's some extra magic around this using BOOST_PP_AUTO_REC to find the smallest available dimension. In Christ, Steven Watanabe