swap / iter_swap consistency, and brief introduction
chris
caj@cs.york.ac.uk
Tue Aug 24 15:39:00 GMT 2004
Relating toswap / iter_swap discussions, I see that in some places
swap(*a,*b); is being used in places where iter_swap should perhaps be
used (in rotate and __partition. __partition is particularily bad as the
ForwardIterator case uses swap() and the BidirectionalIterator case uses
iter_swap()).
In these cases we know that the types given are the same, so the
"iter_swap can take different types" problem doesn't arise. However it
would I assume be sensible to syncronise on one or the other.. (if
iter_swap was changed to use swap then iter_swap would be the obvious
choice.. if not it might require more thought).
Chris
More information about the Libstdc++
mailing list