R
rohinichandrap
Hi,
I am getting the error C2027:Use of undefined type 'T' when I tried to
compile some code in visual c++7.1 that went fine in Visual c++6.0.
Below is the relevant code where the error has come.
------------------------------------------------------------------------------------------------------------------------------------
template <class T>
class MCS_PersistentList
{
public:
/* typedef std::list<T> List;*/
typedef std::list<class T> List;/*above line modified to the current
line to resolve C2146*/
typedef List::iterator iterator;
typedef List::const_iterator const_iterator;
..
..
..
}
class MCS_ADH_Device_Cfg
{
public:
int deviceNum;
..
..
..
}
typedef MCS_PersistentList<MCS_ADH_Device_Cfg> ADH_ConfigFile;
ADH_ConfigFile::iterator it;
int x = it->deviceNum;<------Error points to this line
--------------------------------------------------------------------------------------------------------------------------------------
Any kind of help is appreciated.
Thanks in advance.
Best Regards,
Rohini Chandra
I am getting the error C2027:Use of undefined type 'T' when I tried to
compile some code in visual c++7.1 that went fine in Visual c++6.0.
Below is the relevant code where the error has come.
------------------------------------------------------------------------------------------------------------------------------------
template <class T>
class MCS_PersistentList
{
public:
/* typedef std::list<T> List;*/
typedef std::list<class T> List;/*above line modified to the current
line to resolve C2146*/
typedef List::iterator iterator;
typedef List::const_iterator const_iterator;
..
..
..
}
class MCS_ADH_Device_Cfg
{
public:
int deviceNum;
..
..
..
}
typedef MCS_PersistentList<MCS_ADH_Device_Cfg> ADH_ConfigFile;
ADH_ConfigFile::iterator it;
int x = it->deviceNum;<------Error points to this line
--------------------------------------------------------------------------------------------------------------------------------------
Any kind of help is appreciated.
Thanks in advance.
Best Regards,
Rohini Chandra