forked from boostorg/preprocessor
Repetition tests when exceeding the 256 minimum number of repetitions
This commit is contained in:
@ -91,7 +91,6 @@ alias preprocessor_number_512
|
||||
[ compile stringize.cpp : <define>BOOST_PP_LIMIT_MAG=512 : stringize_num ]
|
||||
[ compile tuple.cpp : <define>BOOST_PP_LIMIT_MAG=512 : tuple_num ]
|
||||
[ compile variadic.cpp : <define>BOOST_PP_LIMIT_MAG=512 : variadic_num ]
|
||||
|
||||
;
|
||||
|
||||
alias preprocessor_v_128
|
||||
@ -395,6 +394,27 @@ alias preprocessor_c_nvm_num
|
||||
]
|
||||
;
|
||||
|
||||
alias preprocessor_number_rep_512
|
||||
:
|
||||
[ compile repetition.cpp :
|
||||
<define>BOOST_PP_LIMIT_MAG=512
|
||||
<define>BOOST_PP_LIMIT_REPEAT=512
|
||||
<define>BOOST_PP_LIMIT_FOR=512
|
||||
: repetition_rep_num
|
||||
]
|
||||
;
|
||||
|
||||
alias preprocessor_number_nvm_rep_512
|
||||
:
|
||||
[ compile repetition.cpp :
|
||||
<define>BOOST_PP_LIMIT_MAG=512
|
||||
<define>BOOST_PP_LIMIT_REPEAT=512
|
||||
<define>BOOST_PP_LIMIT_FOR=512
|
||||
<define>BOOST_PP_VARIADICS=0
|
||||
: repetition_nvm_rep_num
|
||||
]
|
||||
;
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>3.4
|
||||
|
@ -13,7 +13,9 @@
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/comparison/equal.hpp>
|
||||
# include <boost/preprocessor/comparison/not_equal.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/intercept.hpp>
|
||||
# include <boost/preprocessor/logical/bitor.hpp>
|
||||
# include <boost/preprocessor/repetition.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
@ -43,8 +45,56 @@ template<BOOST_PP_ENUM_PARAMS(MAX, class T)> struct no_rescan;
|
||||
# define F1(z, n, p) p n
|
||||
BEGIN 1 + (4+5+6) BOOST_PP_REPEAT_FROM_TO(4, 7, F1, -) END
|
||||
|
||||
# if BOOST_PP_LIMIT_REPEAT == 512
|
||||
|
||||
# define RP512M(z,n,data) \
|
||||
struct BOOST_PP_CAT(data,BOOST_PP_INC(n)); \
|
||||
/* */
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(508,512,RP512M,r512_t)
|
||||
|
||||
#endif
|
||||
|
||||
# define PRED(r, state) BOOST_PP_NOT_EQUAL(state, BOOST_PP_INC(MAX))
|
||||
# define OP(r, state) BOOST_PP_INC(state)
|
||||
# define MACRO(r, state) BOOST_PP_COMMA_IF(BOOST_PP_NOT_EQUAL(state, 1)) BOOST_PP_CAT(class T, state)
|
||||
|
||||
template<BOOST_PP_FOR(1, PRED, OP, MACRO)> struct for_test;
|
||||
|
||||
# if BOOST_PP_LIMIT_FOR == 512
|
||||
|
||||
# define PRED512(r, state) BOOST_PP_NOT_EQUAL(state, 512)
|
||||
|
||||
# define MACRO512_NUL(state)
|
||||
|
||||
# define MACRO512_OUT(state) struct BOOST_PP_CAT(f_512t,state);
|
||||
|
||||
# define MACRO512(r, state) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_BITOR \
|
||||
( \
|
||||
BOOST_PP_BITOR \
|
||||
( \
|
||||
BOOST_PP_EQUAL(state,100), \
|
||||
BOOST_PP_EQUAL(state,200) \
|
||||
), \
|
||||
BOOST_PP_BITOR \
|
||||
( \
|
||||
BOOST_PP_BITOR \
|
||||
( \
|
||||
BOOST_PP_EQUAL(state,300), \
|
||||
BOOST_PP_EQUAL(state,400) \
|
||||
), \
|
||||
BOOST_PP_EQUAL(state,500) \
|
||||
) \
|
||||
), \
|
||||
MACRO512_OUT, \
|
||||
MACRO512_NUL \
|
||||
) \
|
||||
(state) \
|
||||
/* */
|
||||
|
||||
BOOST_PP_FOR(0, PRED512, OP, MACRO512)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user