Variadic macros with zero arguments

前端 未结 7 1240
失恋的感觉
失恋的感觉 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:53

    If you are using GCC, it has an extension to swallow up the comma preceding the __VA_ARGS__. See: http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html.

提交回复
热议问题