P
Pierre-Marc Fournier
The following code:
class ABC
{
std::list<ABC> mylist;
};
compiles in g++ without a problem. However, VC++ version 6 (latest service
pack), complains about the class ABC not being defined on the line where the
list is declared.
I tried adding a
class ABC;
statement before the class definition, but it had no effect. I understand
this problem is due to the fact that the template parameter of mylist is in
fact the class of which mylist is a member.
Is this a problem in microsoft's implementation, or is this normal behaviour
and the fact g++ accepts it is an extension? Are there any simple
workarounds? I need to get this code to work with both compilers.
Thanks
Pierre
class ABC
{
std::list<ABC> mylist;
};
compiles in g++ without a problem. However, VC++ version 6 (latest service
pack), complains about the class ABC not being defined on the line where the
list is declared.
I tried adding a
class ABC;
statement before the class definition, but it had no effect. I understand
this problem is due to the fact that the template parameter of mylist is in
fact the class of which mylist is a member.
Is this a problem in microsoft's implementation, or is this normal behaviour
and the fact g++ accepts it is an extension? Are there any simple
workarounds? I need to get this code to work with both compilers.
Thanks
Pierre