Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] scoped_array / shared_array (size_t) constructor
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2011-11-04 13:02:56


>>> Great. Does anyone else have comments / concerns about a (size_t)
>>> constructor?
>>
>> I still don't like the idea. If you really want to add this feature, please
>
> Why not?

I'll chime in. None of boost::{shared,scoped}_{ptr,array}<T> allocate
T instances within their constructors. That's (part of) what
make_shared is intended to do. Avoiding redundant type specifications
is auto/BOOST_AUTO's job. Rather than adding potentially ambiguous
constructor overloads to well-defined, heavily-used classes, spend the
time implementing boost::make_{shared,scoped}_array instead. auto +
make_{shared,scoped}_array will accomplish what you want (avoiding
specifying the type twice) and the functionality will benefit a much
broader audience.

- Rhys


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk