STL initialization of an abstract class


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Shereef on April 15, 2001 at 06:24:11:

I'm having problems figuring out how to initialize my STL container for my abstract class. This is esentially what I have done:

class Foo
{
private:
std::list< abstractPtr* > myList;
public:
Foo() : myList(10) {}
};

I keep getting the error C2758: 'myList' : must be initialized in constructor base/member initializer list

I thought that was what I had done above, but apparently it didn't solve the problem. Since the STL's store a copy of the objects, I have included a copy constructor for my abstract class so that should be inherited by my derived classes so I shouldn't have any problems, right? But I seem to missing something.
Thanks.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]