Container that stores a mixture of base and derived objects?

前端 未结 4 1747
说谎
说谎 2021-01-07 03:51

What is the right thing to do? I know that if the container is of base class value type, then derived object stored is \'sliced\'. If container is of derived class type, the

4条回答
  •  花落未央
    2021-01-07 04:24

    [http://www.boost.org/doc/libs/1_51_0/libs/ptr_container/doc/ptr_container.html](The Boost pointer container library) is made just for this.

提交回复
热议问题