Objects of different classes in a single vector?

前端 未结 7 2270
情书的邮戳
情书的邮戳 2020-12-09 22:58

In my code, I have a set of objects:

class Sphere { ...
class Plane { ...
...

And I need to use a collection of them (they will all have di

7条回答
  •  暖寄归人
    2020-12-09 23:52

    The other posts have told you most of what you need to know. I would like to add that boost has pointer containers that might be handy as they cleanup there contents when they are destroyed. Boost manual

提交回复
热议问题