7 Aug
2013
7 Aug
'13
8:14 p.m.
Yes, but [2] indicates that SEQ_FOR_EACH is implemented in terms of FOR and has a _R version for reentry. Why is it provided if it doesn't work?
The `R` is the recursion state for the `BOOST_PP_FOR` macro. Because it is reentrant, you don't pass the state in as a parameter, but instead append it to the the end of the macro(ie `BOOST_PP_FOR_1`, `BOOST_PP_FOR_2`, `BOOST_PP_FOR_3`, etc). `BOOST_PP_SEQ_FOR_EACH_R` uses `BOOST_PP_FOR` internally and provides a parameter for this state so it can reenter `BOOST_PP_FOR` effeciently(otherwise it would need to deduce the state of `BOOST_PP_FOR`). If `BOOST_PP_SEQ_FOR_EACH` was reentrant as well, there would be an additional recursion state that would needed to be appended to the end. Paul Fultz II