I\'m trying to tackle the following problem: I would like to do an if statement that does something depending on whether the argument of a template is a specific ob
if
void is_string(const std::string& arg) { std::cout << arg.length() << std::endl; } template void is_string(const T& arg) { std::cout << "The argument is not a string" << std::endl; }
Or, see if your compiler supports the C++17 if constexpr.