Code with old style cast:
const string *ps;
void *pv;
pv = (void*)ps;
I have try three various named casts:
pv = static_cast<void*>(ps); // error: invalid static_cast from type ‘const string* {aka const std::basic_string<char>*}’ to type ‘void*’
pv = const_cast<void*>(ps); // error: invalid const_cast from type ‘const string* {aka const std::basic_string<char>*}’ to type ‘void*’
pv = reinterpret_cast<void*>(ps); // error: reinterpret_cast from type ‘const string* {aka const std::basic_string<char>*}’ to type ‘void*’ casts away qualifiers
As you can see. Nothing works.