P
Peter Oliphant
As I try to create a list of pointers to a garbage collected class I've
created, I'm learning it's not without problems to create an instance of
such list. In fact, so far it won't let me. Apparently STL containers like
'list' are not garbage collected, hence all the managed/unmanaged
incompatibilities come to play (the two, managed and unmanaged code, can't
really be 'mixed freely' as advertised...hehe).
Any place I can look to help with this? I'm trying to do something like
this:
__gc class elementClass {} ;
typedef std::list<__gc class elementClass*> elementClass_Ptr_List ;
__gc class myClass
{
public:
void myMethod()
{
m_List = new elementClass_Ptr_List() ; // ** error here **
}
private:
elementClass_Ptr_List* m_List ;
}
The above compiles UNLESS I try to create an instance of the elementClass
list (the error line). I'd love to just have a 'full' instance of such a
list in myClass's definition (in contrast to a pointer I have to create a
'new' one for), but that fails to compile too.
So, any tutorials on-line on how to use STL with Managed C++.NET (2003)?
[==P==]
created, I'm learning it's not without problems to create an instance of
such list. In fact, so far it won't let me. Apparently STL containers like
'list' are not garbage collected, hence all the managed/unmanaged
incompatibilities come to play (the two, managed and unmanaged code, can't
really be 'mixed freely' as advertised...hehe).
Any place I can look to help with this? I'm trying to do something like
this:
__gc class elementClass {} ;
typedef std::list<__gc class elementClass*> elementClass_Ptr_List ;
__gc class myClass
{
public:
void myMethod()
{
m_List = new elementClass_Ptr_List() ; // ** error here **
}
private:
elementClass_Ptr_List* m_List ;
}
The above compiles UNLESS I try to create an instance of the elementClass
list (the error line). I'd love to just have a 'full' instance of such a
list in myClass's definition (in contrast to a pointer I have to create a
'new' one for), but that fails to compile too.
So, any tutorials on-line on how to use STL with Managed C++.NET (2003)?
[==P==]