Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] scoped_array / shared_array (size_t) constructor
From: Ivan Sorokin (vanyacpp_at_[hidden])
Date: 2011-10-27 16:00:32

On 27.10.2011 01:14, Olaf van der Spek wrote:

>> Maybe off-topic, but why should one prefer scoped_array to vector? Just
>> curious, I never used it myself.
> And it can be used when construction of elements (like int) is
> unwanted.

Then "new T[sz]" will be better than "new T[sz]()".

> 2. What should happen when size = 0? Should it call new T[0] or
> should it just use NULL?

Will two overloads scoped_ptr(T*) and scoped_ptr(size_t) conflict with
each other, when somebody calls scoped_ptr<T>(0)?

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