[C++-sig] Best way to register shared_ptr<const T>

Andrea mariofutire at googlemail.com
Wed Jan 23 21:28:56 CET 2008


Hi,

I've run into the problem of registering a shared_ptr<const T>.
I've found a workaround using a const_cast in get_pointer.

I've also read that there exist a patch to implement a proper fix.

Unfortunately I cannot find more details on that.

Could someone please quick list pros and cons of both approaches.
I am a bit uncomfortable about const_casting, but I cannot understand if it is just a way to please 
the compiler or something deeper.

Andrea




More information about the Cplusplus-sig mailing list