debugging library, and also make me nervous as they are adding overloads
of member functions of elements of std. It seems their purpose is to
check that the O(1) swap is being called. Wouldn't therefore something like:
<snip code>
Test the same thing, and not require adding overloads?
They're specialisations, not overloads, so are absolutely fine. It's
legal to add specialisation to namespace std for stdlib components
with user-defined types as template arguments. The point is to test
that std::swap<std::deque<T> >() calls std::deque<T>::swap(), which I
don't think your code above does - it assumes that the default
specialisation of std::swap() will cause copies of the elements, but
it's possible it could be implemented purely in terms of assigments
(however unlikely that may be).