How would someone do that? for example:
Client* client = it->second;
where it->second is a boost::shared_ptr to Client error:
cannot convert `const ClientPtr' to `Client*' in initialization
boost::shared_ptr has a .get() method to retrieve the raw pointer.
Documentation here about when and why not to use it: http://www.boost.org/doc/libs/1_44_0/libs/smart_ptr/shared_ptr.htm
You can use the get method on the boost::shared_ptr to retrieve the pointer, but be very careful in what you do : extracting a naked pointer from a reference counted shared pointer can be dangerous (deletion will be triggered if the reference count reaches zero, thus invalidating your raw pointer).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With