std::move_iterator<Iter>::operator[]
From cppreference.com
< cpp | iterator | move iterator
/* unspecified */ operator[]( difference_type n ) const; |
(constexpr since C++17) (until C++20) |
|
| constexpr reference operator[]( difference_type n ) const; |
(since C++20) | |
Returns a reference to the element at specified relative location.
Contents |
[edit] Parameters
| n | - | position relative to current location |
[edit] Return value
std::move(current [n])(until C++20)ranges::iter_move(current + n)(since C++20)
[edit] Notes
|
The return type is unspecified because the return type of the underlying iterator's operator[] is also unspecified (see LegacyRandomAccessIterator). |
(until C++20) |
[edit] Example
Run this code
#include <cstddef> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <string> #include <vector> void print(auto rem, const auto& v) { for (std::cout << rem; const auto& e : v)