|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2007-08-11 15:19:13
on Sat Aug 11 2007, Steven Watanabe <steven-AT-providere-consulting.com> wrote:
> To prevent infinite recursion or ambiguity we need:
>
> namespace boost_swap_impl {
>
> template<class T>
> void swap_impl(T& left, T&, right) {
> using std::swap;
> swap(left, right);
> }
>
> }
>
> namespace boost {
>
> namespace swap_adl_barrier {
>
> template<class T>
> void swap(T& left, T& right) {
> ::boost_swap_impl::swap_impl(left, right);
> }
>
> }
>
> using swap_adl_barrier::swap;
>
> }
Yep
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk