Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2000-01-13 13:13:04


> One could retain the lower performance iter_swap, but recommend that
> iterators of heavy value_types overload iter_swap. But it seems easier
> to just overload swap in the proxy when required. Still, you could
> overload the higher performance iter_swap as another way to get around a
> broken proxy.

The one good thing about overriding iter_swap instead of swap is that then
the algorithm doesn't need to call swap at all. The iter_swap might then use
information that's present in the iterators but not in the proxy, so the
proxy could be simpler than it would otherwise be.

To allow this, it's important that the collection algorithms all continue to
use iter_swap instead of swap.

    -- Darin


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