I have the following code,
#include <iostream> #include <tuple> static inline void print (void) { ; } template <typename Head, typename... Tail> static inline void print (Head h, Tail... t) { std::cout << h << std::endl; print(t...); } int main(int argc, char *argv[]) { print("string", 42, 3.43, true, 'c'); return 0; } Is there a way to specialize for the first type, Head, with, for example, a bool? What I am looking is the proper syntax I would need to do this. I have tried adding this extra template,
template <bool, typename... Tail> static inline void print (bool h, Tail... t) { std::cout << "I'm a bool!" << std::endl; print(t...); } to no avail.