I'm trying to write a print function to just print all its parameters. My current code (I know #include is the one stated in the standard, but my compiler supports #import and I like it)
Basically, how the print function is meant to work is it prints its first argument and then takes print(allotherargs). It eventually gets to print(one_arg) and prints that. I'm trying to figure out why it isn't working. My first suspicion was that a typename... needs to have at least one typename, but adding
1 2 3 4 5
template<typename T>
void print(T a)
{
std::cout << a;
}
didn't work. Now my suspicion is that it doesn't know how to deal with print();, but I have no idea how to add a template specialization to cope with this. Ideas?