cpp/language/const cast

Converts between types with different cv-qualification.

Syntax
Returns a value of type.

Explanation
Only the following conversions can be done with. In particular, only may be used to cast away (remove) constness or volatility.

@1@ Two possibly multilevel pointers to the same type may be converted between each other, regardless of cv-qualifiers at each level. @2@ lvalue of any type may be converted to an lvalue or rvalue reference to the same type, more or less cv-qualified. Likewise, a prvalue of class type or an xvalue of any type may be converted to a more or less cv-qualified rvalue reference. The result of a reference refers to the original object. @3@ Same rules apply to possibly multilevel pointers to data members @4@ null pointer value may be converted to the null pointer value of