23
Ranges library
[ranges]
23.8
Range adaptors
[range.adaptors]
23.8.9
Counted view
[range.counted]
1
#
The name
view
:
:
counted
denotes a
customization point object
.
Let
E
and
F
be expressions, and let
T
be
decay_t
<
decltype
(
(
E
)
)
>
.
Then the expression
view
:
:
counted
(
E, F
)
is expression-equivalent to:
(1.1)
If
T
models
Iterator
and
decltype
(
(
F
)
)
models
ConvertibleTo
<
iter_difference_t
<
T
>
>
,
(1.1.1)
subrange
{
E, E
+
static_cast
<
iter_difference_t
<
T
>
>
(
F
)
}
if
T
models
RandomAccessIterator
.
(1.1.2)
Otherwise,
subrange
{
counted_iterator
{
E, F
}
, default_sentinel
}
.
(1.2)
Otherwise,
view
:
:
counted
(
E, F
)
is ill-formed
.
[
Note
:
This case can result in substitution failure when
view
:
:
counted
(
E, F
)
appears in the immediate context of a template instantiation
.
—
end note
]