N
N4M
Dear,
I have codes as follows:
template<class T>
class A {
public: // embedded class
class E;
public: // types
typedef E TE;
public:// member functions
TE somefunc();
private: // member data
//----------------------------
// embedded class
public:
class E {
//.....//
};
};
//
template<class T>
A<T>::TE A<T>::somefunc() {....}
When I compile these codes with VC++.NET, there are error messages:
c:\DATA\C++\Common\list.h(389): error C2143: syntax error : missing
';' before 'list_base<TNValue>::insert'
c:\DATA\C++\Common\list.h(389): error C2501:
'list_base<TNValue>::iterator' : missing storage-class or type
specifiers
// TNValue = T, list_base = A, iterator = TE
The same codes are compilled without problem by VC++ 6.
How come?
Is there something not-so-good with my embedded class use? Do you
recommend embedded classes or have other better solutions?
Thansk for your time.
Nguyen Mai
P/S: The same post can be found at .moderated/
I have codes as follows:
template<class T>
class A {
public: // embedded class
class E;
public: // types
typedef E TE;
public:// member functions
TE somefunc();
private: // member data
//----------------------------
// embedded class
public:
class E {
//.....//
};
};
//
template<class T>
A<T>::TE A<T>::somefunc() {....}
When I compile these codes with VC++.NET, there are error messages:
c:\DATA\C++\Common\list.h(389): error C2143: syntax error : missing
';' before 'list_base<TNValue>::insert'
c:\DATA\C++\Common\list.h(389): error C2501:
'list_base<TNValue>::iterator' : missing storage-class or type
specifiers
// TNValue = T, list_base = A, iterator = TE
The same codes are compilled without problem by VC++ 6.
How come?
Is there something not-so-good with my embedded class use? Do you
recommend embedded classes or have other better solutions?
Thansk for your time.
Nguyen Mai
P/S: The same post can be found at .moderated/