Boost logo

Boost :

From: Sam Partington (sam.partington_at_[hidden])
Date: 2006-03-30 04:25:55

Hi there,

I'm very much in support of new_<>, it seems like an excellent addition. But...

...might it be better for new_<> to return a unique_ptr [1] rather
than an auto_ptr?

You'd get static custom deleter support (which shared_ptr could then
store as a dynamic deleter) :

shared_ptr<T> p = new_<T, null_deleter>();

(I'm not sure how you'd initialise the deleter)

and array support as well :

shared_array<T> collection = new_<T[10]>();

(you'd have to disable unique_ptr<T[]> conversion to shared_ptr, but
allow shared_array conversion)


[1] N1856

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