Problem with std::vector
I''m having a problem using the std::vector class in C++
I have an Abstract Base Class called "Quad".
From this class, 2 different classes "Crate" and "Wall" are derived i.e. they inherit from "Quad".
Now what I want to do is store all the Instances of Crate and Wall into a Vector quadVector. However, when pushing an instance of either Crate or Wall to the end of the Vector, I get an error that I can''t instantiate an abstract class (which is of course right) However, I can''t figure out how I could circumvent this without having my base class to be "non-abstract".
Does anyone have an idea how to do this?
P.S.: I hope you understand what I mean.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement