I'm writing a heavily templated piece of code in C ++. This VS worked perfectly in 2005 but When I try to compile it in G ++, I get some strange errors.
The necessary part of the code (simple to minimize, is not compiled either) is as follows:
template < Class real & gt; Class generic {public: real actual type typed; }; Template & lt; Classic Real & gt; Classroom Intermediate: Generic Generic & lt; Actual & gt; {}; Template & lt; Class Q & gt; Category Derivatives: Public Intermediate & Lt; Written & lt; Q & gt; & Gt; {Public: Zero FooBar () {ThisType q; }}; The error is: "Thus" was not declared "in this way" thus "in the line where 'q' is being declared.
Interestingly, everything works well, is not a derivative template, but a plain square, the compiler should appear in the implementation of the template function before it even starts? I know that the template is compiled VC ++ check is very low while doing it (Unused TEM Can be a syntactically incorrect code in the plate) - But is not it too much? I tried to add a type name keyword with little hope and it also fails to type it to work as expected Is there any way to do this? I think of adding it to each single derived class manually - it is cumbersome, redundant, irregular and causing error.
Incorrect names are not seen in dependent base classes (your base class template parameter < Code> Q ). Get the name that qualifies, and it will work
named typedname: type it typed;
Comments
Post a Comment