25
Ranges library
[ranges]
25.3
Range access
[range.access]
25.3.14
ranges::cdata
[range.prim.cdata]
template
<
class
T
>
constexpr
auto
as-const-pointer
(
const
T
*
p
)
noexcept
{
return
p;
}
//
exposition only
1
#
The name
ranges
::
cdata
denotes a customization point object (
[customization.
point.
object]
)
.
Given a subexpression
E
with type
T
, let
t
be an lvalue that denotes the reified object for
E
.
Then:
(1.1)
If
E
is an rvalue and
enable_
borrowed_
range
<
remove_
cv_
t
<
T
>
>
is
false
,
ranges
::
cdata
(
E
)
is ill-formed
.
(1.2)
Otherwise,
ranges
::
cdata
(
E
)
is expression-equivalent to
as-const-pointer
(
ranges
::
data
(
possibly-const-range
(
t
)
)
)
.
2
#
[
Note
1
:
Whenever
ranges
::
cdata
(
E
)
is a valid expression, it has pointer to constant object type
.
—
end note
]