[Preprocessor] ternary identity macro
Hello, I often write something like #define TEXT(z, n, data) data BOOST_PP_ENUM(5, TEXT, xxx) in my code to create a comma separated list of words. Is there already a macro like TEXT in boost? Or is there a even better way to do what I want? Thanks in advance
2012/4/24 Sebastian Pfützner
Hello,
I often write something like
#define TEXT(z, n, data) data BOOST_PP_ENUM(5, TEXT, xxx)
in my code to create a comma separated list of words. Is there already a macro like TEXT in boost? Or is there a even better way to do what I want?
There is BOOST_PP_ENUM_PARAMS. BOOST_PP_ENUM_PARAMS(5, xxx) Roman Perepelitsa.
Sebastian,
I think to get the desired effect will need to use BOOST_PP_INTERCEPT to
suppress the number:
BOOST_PP_ENUM_PARAMS
http://www.boost.org/doc/libs/1_49_0/libs/preprocessor/doc/ref/enum_binary_p...(5,
SomeText BOOST_PP_INTERCEPT
http://www.boost.org/doc/libs/1_49_0/libs/preprocessor/doc/ref/intercept.htm...)
Regards
Daniel Bradburn
2012/4/24 Roman Perepelitsa
2012/4/24 Sebastian Pfützner
Hello,
I often write something like
#define TEXT(z, n, data) data BOOST_PP_ENUM(5, TEXT, xxx)
in my code to create a comma separated list of words. Is there already a macro like TEXT in boost? Or is there a even better way to do what I want?
There is BOOST_PP_ENUM_PARAMS.
BOOST_PP_ENUM_PARAMS(5, xxx)
Roman Perepelitsa.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Daniel Bradburn
-
Roman Perepelitsa
-
Sebastian Pfützner