Are Variadic macros nonstandard?

前端 未结 4 974
生来不讨喜
生来不讨喜 2020-12-01 23:14

For debugbuilds, I usually use Clang, as it formats warnings and errors better, and makes it a little easier to track them down, and fix them.

But recently after add

4条回答
  •  心在旅途
    2020-12-02 00:01

    As of C++11, variadic macros are now included in standard C++. Section 16.3 of the C++11 standard specifies variadic macros such that they are compatible with variadic macros from C99 (the second form in the question).

    Here is an example of a standard-conforming variadic macro definition in C++:

    #define foo(x, y, ...)    bar(x, y, __VA_ARGS__)
    

提交回复
热议问题