The const_cast operator performs a type cast that can add or remove const and volatile qualifiers. No other modifications to the type are permitted. If you cast away a const or volatile qualifier from an object, and then modify the object, the behavior is undefined. Exampletemplate<typename T> T& unsafe(const T& x) { return const_cast<T&>(x); } See Alsoconst, dynamic_cast, expression, reinterpret_cast, static_cast, type, volatile, Chapter 3 |