Skip to content

Commit 94ed1f4

Browse files
burblebeetkoeppe
authored andcommitted
LWG3872 basic_const_iterator should have custom iter_move
1 parent 74d0dca commit 94ed1f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/iterators.tex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4216,10 +4216,16 @@
42164216
template<class I>
42174217
concept @\exposconcept{not-a-const-iterator}@ = @\seebelow@; // \expos
42184218

4219+
template<@\libconcept{indirectly_readable}@ I>
4220+
using @\exposidnc{iter-const-rvalue-reference-t}@ = // \expos
4221+
common_reference_t<const iter_value_t<I>&&, iter_rvalue_reference_t<I>>;
4222+
42194223
template<@\libconcept{input_iterator}@ Iterator>
42204224
class @\libglobal{basic_const_iterator}@ {
42214225
Iterator @\exposidnc{current_}@ = Iterator(); // \expos
42224226
using @\exposidnc{reference}@ = iter_const_reference_t<Iterator>; // \expos
4227+
using @\exposidnc{rvalue-reference}@ = // \expos
4228+
@\exposid{iter-const-rvalue-reference-t}@<Iterator>;
42234229

42244230
public:
42254231
using iterator_concept = @\seebelow@;
@@ -4315,6 +4321,11 @@
43154321
template<@\exposconcept{not-a-const-iterator}@ S>
43164322
requires @\libconcept{sized_sentinel_for}@<S, Iterator>
43174323
friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y);
4324+
friend constexpr @\exposid{rvalue-reference}@ iter_move(const basic_const_iterator& i)
4325+
noexcept(noexcept(static_cast<@\exposid{rvalue-reference}@>(ranges::iter_move(i.@\exposid{current_}@))))
4326+
{
4327+
return static_cast<@\exposid{rvalue-reference}@>(ranges::iter_move(i.@\exposid{current_}@));
4328+
}
43184329
};
43194330
}
43204331
\end{codeblock}

0 commit comments

Comments
 (0)