I\'m trying to make a simple template function that given some parameters, it outputs them with a space in between. Some of those can be elements of an enum, and in that case I
Default template arguments are not part of the function definition. Use a dummy parameter instead, so that the second argument has a different type:
template<typename T, typename std::enable_if_t<std::is_enum<T>::value, int> = 0>
constexpr std::ostream& debug(const T& a) {
std::cerr << (int)(a);
return std::cerr;
}
template<typename T, typename std::enable_if_t<!std::is_enum<T>::value, int> = 0>
constexpr std::ostream& debug(const T& a) {
std::cerr << a;
return std::cerr;
}