[Solved] Is there a way to define Variadic template macro?
__VA_ARGS__ can be used multiple times, so you could write: #define PARSE_FUNCTION(functionName, …) \ std::function<int(__VA_ARGS__)> m_##functionName() { \ return std::function<int(__VA_ARGS__)>(functionName); \ } What is happening is just simple text substitution, whether the arguments is for a template or not won’t be checked by the preprocessor. Actually any function objects can be implicitly converted to a … Read more