正如主题所说,我正在尝试实现这样的语法(“宏魔术”):
产生宏的MAKE(123)(456)
,如'RESULT(123,456)'
// MAKE(123)(456)
#define COMMA ,
#define RESULT(A,B) ((A)+(B)) // Just for example. In fact, I want to concat arguments of two or more macros
#define LP (
#define RP )
#define MAKE(A) __MK1(A) __MK2
#define __MK1(A) RESULT LP A COMMA // I'm tried many combinationations.
#define __MK2(A) A RP
// RESULT(123, 456);
有可能做这样的事吗?
谢谢!