This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Question about a template method
- From: Jeff Baker <jbaker at qnx dot com>
- To: "'libstdc++ at gcc dot gnu dot org'" <libstdc++ at gcc dot gnu dot org>, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Thu, 30 Oct 2003 11:38:48 -0500
- Subject: Question about a template method
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?