Boost logo

Boost Users :

Subject: [Boost-users] How to cast a boost::shared_ptr to void*
From: Mupparthy Ravindranath (rv_nath_at_[hidden])
Date: 2011-05-10 03:56:09


Hi all, My requirement is to cast an object of type shared_ptr as void*, so that I can send it to a callback function that accepts a void*.  I cannot change callback the function signature because it is part of an existing legacy code. In the existing code, I am sending a raw object pointer (instead of shared_ptr).  Now, if I want to pass a shared_ptr, it won't compile because I cannot cast the shared ptr to void*.  Can anyone suggest some workaround for this.  I tried searching the mailing lists and internet, but not much luck. regards, RV



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net