Boost logo

Boost :

Subject: Re: [boost] make_shared_array
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-11-02 05:05:45


On Fri, Nov 2, 2012 at 1:37 AM, Peter Dimov <lists_at_[hidden]> wrote:
>> Does Glen's make_shared_array have variants for both initialized and
>> uninitialized allocations (for builtin types)?
>
>
> This is a thorny issue. Some people want initialized allocations, some
> don't. I'm personally in the initialized camp, so I think that
> make_shared_array should initialize. But there is a legitimate need to
> allocate big uninitialized arrays. We probably ought to provide both. So how
> about...

How thorny can it be? Providing two variants seems like an easy and
good solution.

What's the use case for default/zero initialized arrays of builtin types though?

In most of not all cases I'd expect the user to fill the array with other data.

-- 
Olaf

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