I have the following simple code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
template<class T> class myClass{
void print(string s){
//something
}
void print(T t){
//something else
}
}
...
int main(){
myClass x;
x.print("this doesn't work");
return 0;
}
|
I basically want to do something if the function parameter is a string, and something else if it is anything else. How can I do this? Thanks!
Last edited on
@keskiverto I can't figure out how to make it work :(