Boost logo

Boost Users :

Subject: Re: [Boost-users] How to make multi_index_container work withstd::unique_ptr?
From: Igor R (boost.lists_at_[hidden])
Date: 2011-12-20 17:23:54


Please don't top-post.

> My case is like that: I have a number of polymorphic objects which can be
> used or referenced by other objects. I put them (the polymorphic objects) in
> MIC. And if one changes its type (not only its value), its users know it
> automatically by shared_ptr. I think I need MIC with shared_ptr pointing to
> scoped_ptr. Am I right? Or is there other way to easy handle it?

How can an object change its type?! In c++ type is a compile-type attribute.
Perhaps you mean that you erase an object from the container and add
another one, or replace some object. In any case, shared_ptr would be
fine.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net