#
The library provides the function template
declval
to simplify the definition of expressions which occur as
unevaluated operands
.
🔗
template
<
class
T
>
add_rvalue_reference_t
<
T
>
declval
(
)
noexcept
;
/ as unevaluated operand
2
#
[
Example
1
:
template
<
class
To,
class
From
>
decltype
(
static_cast
<
To
>
(
declval
<
From
>
(
)
convert
(
From
&
&
)
;
declares a function template
convert
which only participates in overload resolution if the type
From
can be explicitly converted to type
To
.
For another example see class template
common_
type
(
[meta.
trans.
other]
)
.
—
end example
]