Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2008-04-22 14:25:18

On Tue, 2008-04-22 at 01:54 +0300, Peter Dimov wrote:
> as for the rest, I'd really like to see the
> patch without #1 and #2.

Please see the attached patch. OK to commit?

Note that with this patch, the alternative aliasing is already possible:

shared_ptr<X> x = ...;
Y* y = ...;

shared_ptr<Y>( x.get_shared_count(), y ); // aliasing

Since the current aliasing ctor is not as explicit and it is not yet
standardizes: What do you think about removing it? One might document
get_shared_count as returning a const reference to an
unspecified-internal-shared-counter-type, as well as documenting the new
aliasing ctor(s) to accept this argument. That way, the interface is
useful as a public interface, not just for internal optimizations.

Regards, Daniel

Boost list run by bdawes at, gregod at, cpdaniel at, john at