Skip to content

Commit 3439a34

Browse files
authored
Merge 2022-07 LWG Motion 35
P2520R0 move_iterator<T*> should be a random access iterator
2 parents a603126 + 1f909a6 commit 3439a34

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

source/iterators.tex

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4729,7 +4729,7 @@
47294729
class move_iterator {
47304730
public:
47314731
using iterator_type = Iterator;
4732-
using iterator_concept = input_iterator_tag;
4732+
using iterator_concept = @\seebelow@;
47334733
using iterator_category = @\seebelow@; // not always present
47344734
using value_type = iter_value_t<Iterator>;
47354735
using difference_type = iter_difference_t<Iterator>;
@@ -4779,6 +4779,23 @@
47794779
}
47804780
\end{codeblock}
47814781

4782+
\pnum
4783+
The member \grammarterm{typedef-name} \tcode{iterator_concept} is defined
4784+
as follows:
4785+
\begin{itemize}
4786+
\item
4787+
If \tcode{Iterator} models \libconcept{random_access_iterator},
4788+
then \tcode{iterator_concept} denotes \tcode{random_access_iterator_tag}.
4789+
\item
4790+
Otherwise, if \tcode{Iterator} models \libconcept{bidirectional_iterator},
4791+
then \tcode{iterator_concept} denotes \tcode{bidirec\-tional_iterator_tag}.
4792+
\item
4793+
Otherwise, if \tcode{Iterator} models \libconcept{forward_iterator},
4794+
then \tcode{iterator_concept} denotes \tcode{forward_itera\-tor_tag}.
4795+
\item
4796+
Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}.
4797+
\end{itemize}
4798+
47824799
\pnum
47834800
The member \grammarterm{typedef-name} \tcode{iterator_category} is defined
47844801
if and only if the \grammarterm{qualified-id}

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@
668668
#define @\defnlibxname{cpp_lib_mdspan}@ 202207L // also in \libheader{mdspan}
669669
#define @\defnlibxname{cpp_lib_memory_resource}@ 201603L // also in \libheader{memory_resource}
670670
#define @\defnlibxname{cpp_lib_modules}@ 202207L
671+
#define @\defnlibxname{cpp_lib_move_iterator_concept}@ 202207L // also in \libheader{iterator}
671672
#define @\defnlibxname{cpp_lib_move_only_function}@ 202110L // also in \libheader{functional}
672673
#define @\defnlibxname{cpp_lib_node_extract}@ 201606L
673674
// also in \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}

0 commit comments

Comments
 (0)