On Tue, Dec 20, 2011 at 7:07 PM, Nevin Liber
<nevin@eviloverlord.com> wrote:
On 20 December 2011 17:53, Jayden Shui <
jayden.shui@gmail.com> wrote:
> Do I need std::set/map< shared_ptr<scoped_ptr<B>>, your_compare > to do it,
> since it is the B* shared? Thanks a lot.
Yes. In addition, you'll have to erase then insert whenever you
change the object which scoped_ptr<B> holds, unless you have some
other way of guaranteeing that B::Name() won't change when the object
changes. Multiindex might be easier to use in this respect.
Thanks a lot! Elements in container are on heap. I just feel the
somehow_container_ptr<shared_ptr<scoped_ptr<B>>>
so unfriendly to developers.