Boost logo

Boost :

Subject: Re: [boost] make_shared_array
From: Peter Dimov (lists_at_[hidden])
Date: 2012-11-02 21:03:50

Nathan Crookston wrote:
> To be clear, is there still a version that would initialize the array
> to a particular value?


>> shared_ptr<int[]> sp5 = make_shared<int[]>(number_of_ints, 5);

will still work.

> While I'd prefer to only initialize if an initializer is given (like
> std::vector<int>), ...

std::vector<int> initializes to zero. :-)

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