std::iter_swap
From Cppreference
Defined in header
<algorithm> | ||
template< class ForwardIterator1, class ForwardIterator2 >
void iter_swap( ForwardIterator1 a, ForwardIterator2 b ); | ||
Swaps the values of the elements the given iterators are pointing to.
Contents |
Parameters
a, b | - | iterators to the elements to swap |
Return value
(none)
Complexity
constant
Equivalent function
template<class ForwardIterator1, class ForwardIterator2> void iter_swap(ForwardIterator1 a, ForwardIterator2 b) { std::swap(*a, *b); }
Example
This section is incomplete |
See also
| swaps the values of two objects (function template) | |
| swaps two ranges of elements (function template) |