Variadic macros with zero arguments

前端 未结 7 1244
失恋的感觉
失恋的感觉 2020-12-14 16:06

I am working on a call macro,

#define CALL(f,...) FN(f)->call((ref(new LinkedList()), __VA_ARGS__))

which when called,

C         


        
7条回答
  •  星月不相逢
    2020-12-14 16:35

    As for the updated question, by the use of auxiliary macro VA_ARGS like the following, the arguments will be expanded as expected.

    #define VA_ARGS(...) , ##__VA_ARGS__
    #define CALL(f,...) FN(f)->call((ref(new LinkedList()) VA_ARGS(__VA_ARGS__)))
    

提交回复
热议问题