This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: template type problem


I found a solution to my problem.

Instead of writing:

> return static_cast<BaseStruct*>(pNewObj);

one should write

return static_cast<typename T::BaseStruct*>(pNewObj);

Typename declaration that I had:

> typename T::BaseStruct;

is unnecessary.

- Yuri



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]