A
alex
Code:
=========================================
template <class T, int Len>
class COciVariable
{
public:
T m_Var[Len];
};
template <class T>
class COciVariableEx : public COciVariable<T, 1>
{
public:
void operator = ( const T & Var )
{
m_Var = Var;
}
};
===========================================
Platform:
===========================================
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=i386-redhat-linux
Thread model: posix
gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
============================================
Error:
============================================
In file included from main.cpp:1:
test.h: In member function `void COciVariable2Ex<T>:perator=(const
char&)':
test.h:35: error: `m_Var' undeclared (first use this function)
test.h:35: error: (Each undeclared identifier is reported only once for
each function it appears in.)
Why? PLS help me! Thx!!!
=========================================
template <class T, int Len>
class COciVariable
{
public:
T m_Var[Len];
};
template <class T>
class COciVariableEx : public COciVariable<T, 1>
{
public:
void operator = ( const T & Var )
{
m_Var = Var;
}
};
===========================================
Platform:
===========================================
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=i386-redhat-linux
Thread model: posix
gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
============================================
Error:
============================================
In file included from main.cpp:1:
test.h: In member function `void COciVariable2Ex<T>:perator=(const
char&)':
test.h:35: error: `m_Var' undeclared (first use this function)
test.h:35: error: (Each undeclared identifier is reported only once for
each function it appears in.)
Why? PLS help me! Thx!!!