|
Boost : |
From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2004-01-21 10:01:56
Jonathan Turkanis wrote:
> If in the end, people agree with your current opinion that the extra
> storage needed for the deleter isn't justified for an ownership
> transfer utility, then move_ptr<T, no_storage> will become the
> 'official' move pointer, and we can get rid of the second template
> parameter. On the other hand, if enough people feel a custom deletion
> facility to be useful, and if one of (2) -(4) above turns to be
> clearly better than the others (not including (1)), we could have two
> move_ptrs.
I'm not sure I agree that adding template parameters is the way to go.
More template parameters complicate the class and can result in
incompatibility issues. I think we need to ask ourselfs if we _really_
need custom deleters or more advanced deleters than the one I posted
earlier. I agree that it is quite possible to dream up scenarios where
it could be of use, but IMO that isn't enough to justify the added
complexity. Please present _real_ common use cases where this is needed,
and where move_ptr can't be replaced with shared_ptr.
Also, in general, it is far easier to start with less and add more later
than to throw everything in from the start and remove later.
If adding a template parameter is absolutely essential, we'll end up
with a half-baked smart_ptr<> and we could just as well spell
move_ptr<>:
smart_ptr<T, move_semantics, array_storage>
smart_ptr<T, move_semantics, scalar_storage>
-- Daniel Wallin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk