Answer the question
In order to leave comments, you need to log in
How to pass a class object to a template function?
How to write the MyClass class so that it can be passed to a function as in the example below?
template<typename T>
double suma(T obj);
int main(){
MyClass myClass;
suma(myClass);
}
template<typename T>
double suma(T obj){
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question