friend constexpr basic_const_iterator
operator+(const basic_const_iterator& i, difference_type n)
requires std::random_access_iterator<Iter>;
|
(1) |
(C++23 起) |
friend constexpr basic_const_iterator
operator+(difference_type n, const basic_const_iterator& i)
requires std::random_access_iterator<Iter>;
|
(2) |
(C++23 起) |
friend constexpr basic_const_iterator
operator-(const basic_const_iterator& i, difference_type n)
requires std::random_access_iterator<Iter>;
|
(3) |
(C++23 起) |
| | |
返回增加或減少 n 後的迭代器 i。
1,2) 返回推進 n 個位置後的迭代器。
3) 返回推進 -n 個位置後的迭代器。
這些函數對常規的無限定或有限定查找不可見,而只能在 std::basic_const_iterator<Iter> 為實參的關聯類時由實參依賴查找找到。。
返回值
1,2) basic_const_iterator(i.base() + n)
3) basic_const_iterator(i.base() - n)
示例