There is a general workaround in which the function-template just delegates the job to class template member functions:
#include
#include
template struct helper {
static void print(T value) { std::cout << value; }
};
template struct helper> {
static void print(std::vector const &value) { }
};
template
void print (T const &value) {
// Just delegate.
helper::print (value);
}
int main () {
print (5);
std::vector v;
print (v);
}
However, if you can come by with simple function overloading (as suggested by ecatmur and Vaughn Cato), do so.