Namespaces
Variants
Actions

iter_swap(std::common_iterator)

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
 
template< std::indirectly_swappable<I> I2, class S2 >

friend constexpr void
    iter_swap( const common_iterator& x,

               const std::common_iterator<I2, S2>& y ) noexcept(/*see below*/);
(since C++20)

Swaps the objects pointed to by two underlying iterators. The behavior is undefined if x does not hold an I object or y does not hold an I2 object (i.e. at least one of x and y does not hold an iterator).

The function body is equivalent to ranges::iter_swap(std::get<I>(x.var), std::get<I2>(y.var)).

This function template is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::common_iterator<I,S> is an associated class of the arguments.

Contents