shared_ptr and inheritance of the raw pointer
Hi,
I have this code:
#include
Hi You can use explicit converters regards divyank --- Yossi.Itzkovich@ecitele.com wrote:
Hi, I have this code:
#include
class A{ // base class public: };
class B : public A{ public: int b1; };
typedef boost::shared_ptr<A> tSmartA; typedef boost::shared_ptr<B> tSmartB;
void foo (tSmartB& smartOne) // should get a pointer to derived { }
int main () { tSmartA a(new B); foo(a); // This line doesn't compile because foo expects to get tSmartB return 0; }
How can I then send a to foo() ?
Thanks
Yossi
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
participants (2)
-
divyank shukla
-
Yossi.Itzkovich@ecitele.com