|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-01-07 14:46:03
From: "Howard Hinnant" <hinnant_at_[hidden]>
> Peter Dimov wrote on 1/7/2001 12:50 PM
> >I think that such an "overloading" of a class template is acceptable if
> >auto_ptr<T> behaves similarly in the two cases, enabling generic code to
> >transparently operate on both variants.
[...]
> To tell you the truth, I'm not sure generic programming is very much of
> an argument here one way or the other.
I'm trying to answer the question 'are auto_ptr<X> and auto_ptr<X[]> similar
enough to justify the same name' with 'they are if client code can use
auto_ptr<T> without having to determine whether T=X[].'
Whether this is the correct answer remains to be determined. :-)
> But yes, auto_ptr<T[]> could be
> used in this environment (combined with a few utilities):
(code omitted)
No, this is not what I had in mind. The code checks whether it's dealing
with the array version. Whether it's called auto_ptr<X[]> or auto_array<X>
makes no difference.
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk