How to single out the first parameter sent to a macro taking only a variadic parameter
问题 I try to get at the first actual parameter sent to a variadic macro. This is what I tried, and which does not work in VS2010: #define FIRST_ARG(N, ...) N #define MY_MACRO(...) decltype(FIRST_ARG(__VA_ARGS__)) When I look at the preprocessor output I see that FIRST_ARG returns the entire argument list sent to MY_MACRO ... On the other hand when I try with: FIRST_ARG(1,2,3) it expands to 1 as intended. This seems to be somehow the inverse of the problem solved by the infamous two level concat