Subject: Re: [boost] Rationale for shared_ptr/array including both ptr to control and ptr to data in class
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-09-26 08:11:03
On 24/09/2011 17:45, Olaf van der Spek wrote:
> 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.
Because it's not storing that information.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk