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<x##File>}
#define NTH_ARG(z, n, data) ARG_PAIR(BOOST_PP_SEQ_ELEM(n, data))
#define ARG_PAIRS BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(SEQ_FORMATS), NTH_ARG, SEQ_FORMATS)
gives the following error:
test.h:14:63: error: pasting ")" and "File" does not give a valid preprocessing token
#define NTH_ARG(z, n, data) ARG_PAIR(BOOST_PP_SEQ_ELEM(n, data))
^
test.h:13:33: note: in definition of macro ‘ARG_PAIR’
#define ARG_PAIR(x) {#x, create<x##File>}
We're getting closer though