This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
template problem
- From: andy <andy at softbook dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 09 Oct 2002 09:33:44 -0700
- Subject: template problem
I'm having trouble compiling the following in gcc3.2:
template <class FilterClass, class DataClass = CDataCOLORREF>
class C2PassScale
{
public:
typedef DataClass::_DataType _DataType; //ERROR -see below
typedef DataClass::_RowType _RowType;
....
//class CDataCOLORREF is declared below in the same file
class CDataCOLORREF {
public:
typedef unsigned long_DataType;
....
ERROR above reads:
"ISO C++ forbids declaration of _DataType with no type"
Now, if I understand the code correctly, the _DataType variable of the
C2PassScale class is typedef'ed to be the same as _DataType variable of the
the CDataCOLORREF class, i.e, long.
It looks like gcc cannot figure out what type the _DataType variable of
C2PassScale class needs to be.
I wonder if anyone can help finding a workaround or maybe a compile option I
need to turn on
Thanks in advance
Andy