I want to create a function that is
while t is template<typename T>
string myFunction(T t) {
string str1;
//some computation with t
return str1();
}
So in my .h
file, I do something like
class myClass {
private:
//some variable
public:
string myFunction(T);
}
and of course it gives an error saying "what is T?"
What should I do to make myFunction
able to take a T
?