Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MY_MACRO((x, y))
- MY_MACRO(x)
- #define CONCAT_( x, y ) x ## y
- #define CONCAT( x, y ) CONCAT_( x, y )
- #define IS_SINGLE_1(...) 0
- #define IGNORE(...)
- #define IS_SINGLE_2_0 0 IGNORE(
- #define IS_SINGLE_2_IS_SINGLE_1 1 IGNORE(
- #define IS_SINGLE( x ) CONCAT( IS_SINGLE_2_, IS_SINGLE_1 x ) )
- IS_SINGLE((x, y)) // 0
- IS_SINGLE(x) // 1
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/seq/for_each.hpp>
- #define SEQ (w)(x)(y)(z)
- #define MACRO(r, data, elem) BOOST_PP_CAT(elem, data)
- BOOST_PP_SEQ_FOR_EACH(MACRO, _, SEQ) // expands to w_ x_ y_ z_
- MACRO(1, a)
- MACRO(2, (a,b) )
- MACRO(3, (a,b,c) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement