Hi all,
I am having trouble with class definition with template. The following is a simple example:
It produces an error because of s<d>.Code:template <class DataType> struct TestStruct { DataType key; }; template <class s, class d> class DummyClass { public: d getKey(s<d> *var) { return var->key = 10; } }; int main() { DummyClass<TestStruct, double> myClas; return 0; }
If I write:
It works just fine. But that is not I want because I need to use "double" twice. Can anyone help?Code:template <class DataType> struct TestStruct { DataType key; }; template <class s, class d> class DummyClass { public: d getKey(s *var) { return var->key = 10; } }; int main() { DummyClass<TestStruct<double>, double> myClas; return 0; }



LinkBack URL
About LinkBacks


