Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] scoped_array / shared_array (size_t) constructor
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2011-11-04 13:14:52


On Friday, November 04, 2011 12:02:56 Rhys Ulerich wrote:
> >>> 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.

I hate to repeat myself, but +100500 for make_* functions.


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