|
Boost : |
From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2005-01-28 16:22:29
Rob Stewart wrote:
[...]
>
> Note, however, that a namespace scope reset() can be construed as
> meaning different things to different types. For example, it
> could be specialized to provide the fastest means to reset any
> object to its initial state. Thus, it might do
> std::vector<T>().swap(v) or something uglier for other types.
>
> Thus, reset() should be designed and documented to be
> customizable for a reasonable meaning of "reset" for any type.
>
Everybody is free to overload reset for his own types, which makes
perfect sense e.g. for smart prts:
template <typename T>
void reset(shared_ptr<T> &p)
{
p.reset();
}
...is found via ADL
Stefan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk