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]
Other format: [Raw text]

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



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