Boost logo

Boost :

Subject: [boost] Review: Code Review: allocate_shared_array and make_shared_array
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2012-11-01 08:31:55

A big thank you to Peter Dimov who has been kind enough to review my code.

The open question we both have is whether these functions should
continue to return shared_ptr<T> or be changed to return
shared_array<T> after some modification to shared_array (both to
support construction from (or conversion to) a shared_ptr and to have
things like a no-throw constructor).

Updated code:

Original blog post:

Some context from our discussion:

Peter Dimov wrote:
> Providing two separate sets of functions doesn't appeal to me much.
> make_shared_array should return whatever we decide they should return. You
> are right about shared_array's default constructor though, and maybe we can
> use this opportunity to fix it (and add move support), and perhaps provide a
> way for people to get a shared_ptr from a shared_array, if they have to work
> with other people who only use that in their APIs. :-)
> Let's see what the Boost list will say.
> Glen Fernandes wrote:
> > 1. I keep the functions returning shared_ptr but rename them to
> > allocate_shared_sequence and make_shared_sequence. I think they are still
> > useful for people who would want to avoid shared_array in their APIs for
> > various reasons (e.g. its default constructor can throw).
> >

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