Collaboration diagram for Swapping:
|Swap two elements. |
|Swap elements to which iterators point. |
|(OLForwardIterator *)||+ swapRangesFrom:to:with:|
|Swap elements in two ranges. |
Individual elements, elements referred to by iterators, and entire ranges may be swapped.
|+ (void) swap:||(id *)||left|
Swap two elements.
The message performs a very fast swap of two distinct elements given pointers to the elements.
|left||the first element to swap|
|right||the second element to swap|
Swap elements to which iterators point.
The element pointed to by left is assigned to the element pointed to by the iterator right and vice versa.
|left||the first iterator to swap|
|right||the second iterator to swap|
|+ (OLForwardIterator*) swapRangesFrom:||(OLForwardIterator *)||first1|
Swap elements in two ranges.
All elements in the range
[first1, last1) are assigned to the corresponding element in the range starting at first2 and vice versa. An iterator is returned pointing to one position beyond the last element swapped in the range starting from first2.
|first1||the first in the first range to swap|
|last1||one beyond the last in the first range to swap|
|first2||the first in the second range to swap|