Question about a template method

Jeff Baker jbaker@qnx.com
Thu Oct 30 19:22:00 GMT 2003


I'm posting this question on behalf of someone else so I apologize if there
isn't enough information.

Pasted question starts here.

Although this problem is a bit difficult to describe in an e-mail, it
appears that the following templated method no longer compiles: (previously
compiled with 2.7.2-960126)

template <class T> void OsrpStats<T>::IncrCountRx(uint8 type) 
{
if (T::MAX_TYPES == (T::MsgType)type)
{
return;
}
mpCountRx[type]++;
}

The compiler complains about the type cast (T::MsgType). The surprising part
about this problem is that it is not sufficient to simply remove the type
cast, but it is also necessary to supply the following
compiler option:

-Wc, -fno-implicit-templates

Does this change make sense, or am I missing something?



More information about the Gcc mailing list