Collaboration diagram for Swapping:
Swapping | |
(void) | + swap:and: |
Swap two elements. | |
(void) | + swapIterators:and: |
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 | ||
and: | (id *) | right | ||
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 |
+ (void) swapIterators: | (OLIterator *) | left | ||
and: | (OLIterator *) | right | ||
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 | ||
to: | (OLForwardIterator *) | last1 | ||
with: | (OLForwardIterator *) | first2 | ||
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, last1)
.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 |
|