25
Ranges library
[ranges]
25.6
Range factories
[range.factories]
25.6.3
Single view
[range.single]
25.6.3.1
Overview
[range.single.overview]
1
#
single_
view
produces a view that contains exactly one element of a specified value
.
2
#
The name
views
::
single
denotes a customization point object (
[customization.
point.
object]
)
.
Given a subexpression
E
, the expression
views
::
single
(
E
)
is expression-equivalent to
single_
view
<
decay_
t
<
decltype
(
(
E
)
)
>
>
(
E
)
.
3
#
[
Example
1
:
for
(
int
i
:
views
::
single
(
4
)
)
cout
<
<
i;
// prints
4
—
end example
]