I'm porting a program over to gcc, and I get the following error quite a bit:
with this code:foo.cpp:7:2: error: ‘type’ does not name a type
foo.cpp:7:2: note: (perhaps ‘typename A<xii>::type’ was intended)
foo.cpp:8:15: error: ‘type’ has not been declared
I have found that I can workaround the issue by adding this typedef to class B, but it is cumbersome for classes inheriting large amounts of typedefs.Code:template <typename foo> class A { public: typedef int type; }; template <typename xii> class B: public A<xii> { type ham; void cheese (type *) { } }; int main (void) { return 0; }
Anyhow my questions...Code:template <typename xii> class B: public A<xii> { typedef typename A<xii>::type type; type ham; void cheese (type *) { } };
1) Is there a less cumbersome way for me to pull in all of the typenames from the parent template A into B?
2) Where can I find the actual C++ specifications for this behavior?
Specifically, this is occuring on gcc version 4.5.1



LinkBack URL
About LinkBacks



