|
ALINK="#ff0000">
iter_swap
Prototypetemplate <class ForwardIterator1, class ForwardIterator2> inline void iter_swap(ForwardIterator1 a, ForwardIterator2 b); DescriptionEquivalent to swap(*a, *b). [1]DefinitionDeclared in algo.h. The implementation is in algobase.h.Requirements on types
Preconditions
ComplexitySee swap for a discussion.Exampleint x = 1; int y = 2; assert(x == 1 && y == 2); iter_swap(&x, &y); assert(x == 2 && y == 1); Notes[1] Strictly speaking, iter_swap is redundant. It exists only for technical reasons: in some circumstances, some compilers have difficulty performing the type deduction required to interpret swap(*a, *b). See alsoswap, swap_rangesCopyright © 1999 Silicon Graphics, Inc. All Rights Reserved. TrademarkInformation
|