using BOOST_PP_ENUM_PARAMS to generate base seq accordingly

hardcoding a base seq from 0 to 9 was the culprit behind Ticket #7769
This commit is contained in:
Bruno Dutra
2015-02-08 17:07:22 -02:00
parent 6a0f617a6c
commit ff4944f0ec

View File

@@ -15,9 +15,23 @@
// $Revision$
#include <boost/preprocessor/seq/subseq.hpp>
#include <boost/preprocessor/tuple/to_seq.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/punctuation.hpp>
#include <boost/preprocessor/enum_params.hpp>
#include <boost/preprocessor/empty.hpp>
#undef BOOST_MPL_PP_RANGE
#define BOOST_MPL_PP_RANGE(first, length) \
BOOST_PP_SEQ_SUBSEQ((0)(1)(2)(3)(4)(5)(6)(7)(8)(9), first, length) \
BOOST_PP_SEQ_SUBSEQ( \
BOOST_PP_TUPLE_TO_SEQ( \
BOOST_PP_ADD(first, length), \
BOOST_PP_LPAREN() \
BOOST_PP_ENUM_PARAMS(BOOST_PP_ADD(first, length), BOOST_PP_EMPTY()) \
BOOST_PP_RPAREN() \
), \
first, length \
) \
/**/
#endif // BOOST_MPL_AUX_PREPROCESSOR_RANGE_HPP_INCLUDED