24
Iterators library
[iterators]
24.5
Iterator adaptors
[predef.iterators]
24.5.4
Move iterators and sentinels
[move.iterators]
24.5.4.2
Class template
move_
iterator
[move.iterator]
🔗
namespace
std
{
template
<
class
Iterator
>
class
move_iterator
{
public
:
using
iterator_type
=
Iterator;
using
iterator_concept
=
see below
;
using
iterator_category
=
see below
;
// not always present
using
value_type
=
iter_value_t
<
Iterator
>
;
using
difference_type
=
iter_difference_t
<
Iterator
>
;
using
pointer
=
Iterator;
using
reference
=
iter_rvalue_reference_t
<
Iterator
>
;
constexpr
move_iterator
(
)
;
constexpr
explicit
move_iterator
(
Iterator i
)
;
template
<
class
U
>
constexpr
move_iterator
(
const
move_iterator
<
U
>
&
u
)
;
template
<
class
U
>
constexpr
move_iterator
&
operator
=
(
const
move_iterator
<
U
>
&
u
)
;
constexpr
const
Iterator
&
base
(
)
const
&
noexcept
;
constexpr
Iterator base
(
)
&
&
;
constexpr
reference
operator
*
(
)
const
;
constexpr
move_iterator
&
operator
+
+
(
)
;
constexpr
auto
operator
+
+
(
int
)
;
constexpr
move_iterator
&
operator
-
-
(
)
;
constexpr
move_iterator
operator
-
-
(
int
)
;
constexpr
move_iterator
operator
+
(
difference_type n
)
const
;
constexpr
move_iterator
&
operator
+
=
(
difference_type n
)
;
constexpr
move_iterator
operator
-
(
difference_type n
)
const
;
constexpr
move_iterator
&
operator
-
=
(
difference_type n
)
;
constexpr
reference
operator
[
]
(
difference_type n
)
const
;
template
<
sentinel_
for
<
Iterator
>
S
>
friend
constexpr
bool
operator
=
=
(
const
move_iterator
&
x,
const
move_sentinel
<
S
>
&
y
)
;
template
<
sized_
sentinel_
for
<
Iterator
>
S
>
friend
constexpr
iter_difference_t
<
Iterator
>
operator
-
(
const
move_sentinel
<
S
>
&
x,
const
move_iterator
&
y
)
;
template
<
sized_
sentinel_
for
<
Iterator
>
S
>
friend
constexpr
iter_difference_t
<
Iterator
>
operator
-
(
const
move_iterator
&
x,
const
move_sentinel
<
S
>
&
y
)
;
friend
constexpr
iter_rvalue_reference_t
<
Iterator
>
iter_move
(
const
move_iterator
&
i
)
noexcept
(
noexcept
(
ranges
::
iter_move
(
i
.
current
)
)
)
;
template
<
indirectly_
swappable
<
Iterator
>
Iterator2
>
friend
constexpr
void
iter_swap
(
const
move_iterator
&
x,
const
move_iterator
<
Iterator2
>
&
y
)
noexcept
(
noexcept
(
ranges
::
iter_swap
(
x
.
current, y
.
current
)
)
)
;
private
:
Iterator current;
//
exposition only
}
;
}
1
#
The member
typedef-name
iterator_
concept
is defined as follows:
(1.1)
If
Iterator
models
random_
access_
iterator
, then
iterator_
concept
denotes
random_
access_
iterator_
tag
.
(1.2)
Otherwise, if
Iterator
models
bidirectional_
iterator
, then
iterator_
concept
denotes
bidirectional_
iterator_
tag
.
(1.3)
Otherwise, if
Iterator
models
forward_
iterator
, then
iterator_
concept
denotes
forward_
iterator_
tag
.
(1.4)
Otherwise,
iterator_
concept
denotes
input_
iterator_
tag
.
2
#
The member
typedef-name
iterator_
category
is defined if and only if the
qualified-id
iterator_
traits
<
Iterator
>
::
iterator_
category
is valid and denotes a type
.
In that case,
iterator_
category
denotes
(2.1)
random_
access_
iterator_
tag
if the type
iterator_
traits
<
Iterator
>
::
iterator_
category
models
derived_
from
<
random_
access_
iterator_
tag
>
, and
(2.2)
iterator_
traits
<
Iterator
>
::
iterator_
category
otherwise
.