Given a templated function declared like this:
template
int Function(T object);
A user can invoke this function by specifying th
In C++17, you can have auto
non-type template parameters. This will let you solve your problem.
Something like:
template>
int Function();
(assuming you want the type T
within the body of Function
)
In C++14, the C++17 feature is missing. It was added exactly because it was missing. Workarounds involve macros like #define UGLY_HACK(...) decltype(__VA_ARGS__), __VA_ARGS__
.