4
General utilities library
[utilities]
4.2
Utility components
[utility]
4.2.3
static_downcast
[static.downcast]
1
#
A
static_cast
that performs a downcast
.
🔗
template
<
class
DerivedRef,
class
Base
>
constexpr
DerivedRef static_downcast
(
Base
&
&
base
)
noexcept
;
2
#
Let
derived-ref
be
static_cast
<
DerivedRef
>
(
std
::
forward
<
Base
>
(
base
)
)
.
3
#
Constraints:
(3.1)
DerivedRef
is a reference type,
(3.2)
std
::
remove_cvref_t
<
DerivedRef
>
is derived from
std
::
remove_cvref_t
<
Base
>
, and
(3.3)
derived-ref
is well-formed
.
4
#
Preconditions:
derived-ref
has well-defined behavior
.
5
#
Returns:
derived-ref
.