#define TRANSFORM_DECLTYPE(MInput) decltype(MInput)
#define DECLTYPE_LIST(...) MAP_LIST(TRANSFORM_DECLTYPE, __VA_ARGS__)
DECLTYPE_LIST(a,b,c)
DECLTYPE_LIST()
Results in:
decltype(a), decltype(b), decltype(c)
decltype()
I expected the case where no arguments are passed to expand to nothing, note that MAP has the same behaviour.
I fixed for my case by changing definition of TRANSFORM_DECLTYPE to #define TRANSFORM_DECLTYPE(...) __VA_OPT__(decltype(__VA_ARGS__)) but that would only work for C++2a compilers.
Results in:
I expected the case where no arguments are passed to expand to nothing, note that
MAPhas the same behaviour.I fixed for my case by changing definition of
TRANSFORM_DECLTYPEto#define TRANSFORM_DECLTYPE(...) __VA_OPT__(decltype(__VA_ARGS__))but that would only work for C++2a compilers.