c++ concatenate macro1 text with comma and with macro2

366 views Asked by At

From these macros:

#define X abc
#define Y def

how can I define macro Z the content of which is:

abc,def

?

I couldn't manage with

#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
#define ZZ BOOST_PP_CAT(X,BOOST_PP_COMMA)

this produces just:

abcBOOST_PP_COMMA
1

There are 1 answers

0
Acorn On BEST ANSWER

You can simply write:

X,Y

That will do the trick.