Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-04-08 01:25:28


on 4/8/00 11:12 AM, Alan Griffiths at alan_at_[hidden] wrote:

>>> Also is there a consensus on use of std::swap? In the views code we added
>>> specializations of std::swap(viewType&,viewType&) [...]
>>>
>>> namespace std {
>>> swap(viewType &a,viewType &b)
>>> {
>>> a.swap(b);
>>> }
>>> }
>>>
>>> I've been following a discussion in C.L.C++.M on swap and I'm confused. Is
>>> it illegal to make more std::swap() specializations?
>
> No this is fine - although adherents of option "A" (below) would
> probably advise against since it is inconsistent with the more general
> case.
>
> It is overloading that is illegal. That is:
>

I think that technically the original code _was_ an overload (note that
template<> is missing).

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk