I'm having trouble with recursive template pack unpacking. What I currently have is:
template<T>
constexpr void register_types() {
do_something<T>();
return;
}
template <class T, T2, class... Args>
constexpr void register_types() {
do_something<T>();
register_types<T2, Args...>();
}
int main(int argc, char** argv) {
register_types<unsigned char, unsigned short, unsigned int, unsigned long long int>();
However I'd like to have a more empty base-case, something like
template<>
constexpr void register_types() {
return;
}
template <class T, class... Args>
constexpr void register_types() {
do_something<T>();
register_types<Args...>();
}
However this gives me the error:
src/benchmarks/benchmark_main.cc:68:31: error: ‘register_types’ is not a template function
Is it possible to have an empty parameter pack as the base case? I've seen this post but would like to avoid using SFINAE if possible.