rotoglup
rotoglup

Reputation: 5283

What's this ellipsis in c++ : #define MBGL_DEFINE_ENUM(T, values...)?

While trying to build mapboxgl-native with msvc 2017, I had errors with the following construct in their enum.hpp

#define MBGL_DEFINE_ENUM(T, values...)

This macro is used like this

I could not find the documentation for this c++ syntax.

Which version of c++ defines this ellipsis construct ? How is it called ?

Upvotes: 0

Views: 585

Answers (1)

This isn't standard C++. The standard way would not name the ellipsis. It's a GCC extension.

Variadic macros in standard C++ look somewhat like this:

#define foo(arg, ...) arg __VA_ARGS__

Where __VA_ARGS__ stands for all the arguments in the ellipsis.

Upvotes: 2

Related Questions