Friday, 16 August 2013

C++ Template, Functions define in a class?

C++ Template, Functions define in a class?

Class.h
template<class T>
struct AStruct{
//stuff
};
class aClass{
template<class T>
void setStruct(const AStruct<T>& s){
theStruct = s;
}
private:
template<class T>
AStruct<T> theStruct; //this is not liked. "multiple template parameter
lists are not allowed" are one of the errors I get...
};
Quite the mess but still, I'd like to know what can be done about it...
I've tried playing around a bit but with no luck... Also, only standard
library please!

No comments:

Post a Comment