casting - C++ What's the named cast equivalent -


what's named cast equivalent following old-style cast?

const string *ps; void *pv;  pv = (void*)ps; // <--- 

is pv = static_cast<void*>(const_cast<string*>(ps)); ?

pv = const_cast<string *>(ps); 

is enough - void * implicitly assignable from (non-qualified) data (object) pointer type.

(of course, same reason, direct assignment const void * without casting work.)


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -