Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Problem with std::vector

This topic is 5588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!