Thanks for the suggestion but I still can't get it to work :(
#define SEQ_FORMATS BOOST_PP_VARIADIC_TO_SEQ(FORMATS)
#define ARG_PAIR(x) {#x, create
On 6 July 2016 at 22:27, Cherotek Music
wrote: Hi, I'm trying to make a macro chain that expands something like this
*A, B, C*
into something like this
*{"A", create<AFile>}, {"B", create<BFile>}, {"C", create<CFile>}*
This is what I have come up with
*#define FORMATS A, B, C // Add new formats here* *#define SEQ_FORMATS BOOST_PP_VARIADIC_TO_SEQ(FORMATS)* *#define ARG_PAIR(s, data, x) {#x, create
}* *#define SEQ_ARG_PAIRS BOOST_PP_SEQ_TRANSFORM(ARG_PAIR, ~, SEQ_FORMATS)* *#define ARG_PAIRS BOOST_PP_SEQ_ENUM(SEQ_ARG_PAIRS)* Use BOOST_PP_ENUM with BOOST_PP_SEQ_SIZE and BOOST_PP_SEQ_ELEM instead of BOOST_PP_SEQ_TRANSFORM+BOOST_PP_SEQ_ENUM.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users