Описание тега static-cast
A C++ cast operator to convert from one type to another, using only information about the static type of the object being cast
From cppreference.com:
Converts between types using a combination of implicit and user-defined conversions. It has the form
static_cast<new_type>(expression)
.
static_cast
is the C++ cast operator used to convert from one type to another. It only uses information about the static type of the object being cast and not its dynamic type; i.e. using only information known at compile-time and not performing a run-time check. The conversion returns a value of type being converted to.
As with all cast expressions, the result is:
- an lvalue if new_type is an lvalue reference type or an rvalue reference to function type;
- an xvalue if new_type is an rvalue reference to object type;
- a prvalue otherwise.