Boost logo

Boost :

Subject: Re: [boost] Rationale for shared_ptr/array including both ptr to control and ptr to data in class
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-09-24 11:45:26

On Fri, Sep 23, 2011 at 4:18 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
> It's true that the separate pointer enables aliasing, but this is not the
> original reason for its existence. It supports pointer conversions
> (shared_ptr<T> converts to shared_ptr<U> when T* converts to U*.)
> shared_array doesn't technically need aliasing or conversions, its
> implementation just mirrors shared_ptr.

Ah. BTW, why doesn't shared_array provide size()?
IMO it'd be quite useful to have.

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