|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-01-07 12:50:00
From: "Howard Hinnant" <hinnant_at_[hidden]>
> It is only because the semantics are so similar that one would even
> consider sharing the name "auto_ptr" over two distinct classes. The big
> question is: Are the semantics close enough that such sharing has
> benefits (such as self documentation)?
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.
The peculiar semantics of built-in arrays complicate matters even further,
as this code:
std::auto_ptr<T> p(new T);
doesn't work for T = X[N]. This is perhaps an argument 'for' the
overloading; but what should the element_type of auto_ptr<X[N]> be?
-- 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