[preprocessor] Reverse file iteration

Hi, Is it possible to do a reverse iteration? For example: # define BOOST_PP_ITERATION_LIMITS (5, 0) Looking at the preprocessor output from MSVC9, I'm seeing that it works properly. By properly, I mean I'm getting my "primary" template first, and then several specialized versions under that one. I'm using reverse iteration here so that I can create class specializations, while at the same time keeping my primary template at the "top", since it will be the first to be created. However, any code that tries to use a specialized version of my class does not compile. It says insufficient number of template parameters, which leads me to believe iteration limits does not expect start to be greater than finish. Any advice here? I'll post code if needed.

AMDG Robert Dailey wrote:
Hi,
Is it possible to do a reverse iteration? For example:
# define BOOST_PP_ITERATION_LIMITS (5, 0)
Looking at the preprocessor output from MSVC9, I'm seeing that it works properly. By properly, I mean I'm getting my "primary" template first, and then several specialized versions under that one. I'm using reverse iteration here so that I can create class specializations, while at the same time keeping my primary template at the "top", since it will be the first to be created. However, any code that tries to use a specialized version of my class does not compile. It says insufficient number of template parameters, which leads me to believe iteration limits does not expect start to be greater than finish.
Reverse iteration works properly. The problem is most likely that you need a forward declaration with default arguments: template<class R BOOST_PP_ENUM_TRAILING_PARAMS_WITH_A_DEFAULT(i, class T, detail::no_param)> class InputSource; In Christ, Steven Watanabe
participants (2)
-
Robert Dailey
-
Steven Watanabe