Abstract.h:D3.h:Code:#ifndef ABSTRUCTGROUP_H_ #define ABSTRUCTGROUP_H_ template<class Type> class AbstructGroup { public: virtual Type element(int) const = 0; virtual int order() const = 0; virtual Type inverse(const Type& x) const = 0; virtual Type operation(const Type& left, const Type& right) const = 0; }; #endif /*ABSTRUCTGROUP_H_*/Main.cpp:Code:#ifndef D3_H_ #define D3_H_ #include <map> #include <string> #include <algorithm> #include "AbstractGroup.h" using namespace std; class D3 : public AbstructGroup<string> { //... }; #endif /*D3_H_*/I'm getting error in the declaration of *g in main.cpp:Code:#include "D3.h" int main() { D3 d3; AbstractGroup<class Type> *g = &d3; return 0; }
`AbstractGroup' was not declared in this scope Main.cpp
expected `;' before "class" Main.cpp
expected primary-expression before "class" Main.cpp
Compiled with mingw 5.1.3. Note that there is no other cpp file except main.cpp. What is the solution to these errors? Thanks in advance.




Reply With Quote