Skip to content

Commit 899826e

Browse files
committed
P2520R0 move_iterator<T*> should be a random access iterator
1 parent d59a4f3 commit 899826e

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
@@ -4139,7 +4139,7 @@
41394139
class move_iterator {
41404140
public:
41414141
using iterator_type = Iterator;
4142-
using iterator_concept = input_iterator_tag;
4142+
using iterator_concept = @\seebelow@;
41434143
using iterator_category = @\seebelow@; // not always present
41444144
using value_type = iter_value_t<Iterator>;
41454145
using difference_type = iter_difference_t<Iterator>;
@@ -4189,6 +4189,23 @@
41894189
}
41904190
\end{codeblock}
41914191

4192+
\pnum
4193+
The member \grammarterm{typedef-name} \tcode{iterator_concept} is defined
4194+
as follows:
4195+
\begin{itemize}
4196+
\item
4197+
If \tcode{Iterator} models \libconcept{random_access_iterator},
4198+
then \tcode{iterator_concept} denotes \tcode{random_access_iterator_tag}.
4199+
\item
4200+
Otherwise, if \tcode{Iterator} models \libconcept{bidirectional_iterator},
4201+
then \tcode{iterator_concept} denotes \tcode{bidirec\-tional_iterator_tag}.
4202+
\item
4203+
Otherwise, if \tcode{Iterator} models \libconcept{forward_iterator},
4204+
then \tcode{iterator_concept} denotes \tcode{forward_itera\-tor_tag}.
4205+
\item
4206+
Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}.
4207+
\end{itemize}
4208+
41924209
\pnum
41934210
The member \grammarterm{typedef-name} \tcode{iterator_category} is defined
41944211
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
@@ -656,6 +656,7 @@
656656
#define @\defnlibxname{cpp_lib_math_constants}@ 201907L // also in \libheader{numbers}
657657
#define @\defnlibxname{cpp_lib_math_special_functions}@ 201603L // also in \libheader{cmath}
658658
#define @\defnlibxname{cpp_lib_memory_resource}@ 201603L // also in \libheader{memory_resource}
659+
#define @\defnlibxname{cpp_lib_move_iterator_concept}@ 202207L // also in \libheader{iterators}
659660
#define @\defnlibxname{cpp_lib_move_only_function}@ 202110L // also in \libheader{functional}
660661
#define @\defnlibxname{cpp_lib_node_extract}@ 201606L
661662
// also in \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}

0 commit comments

Comments
 (0)