Boost logo

Boost :

Subject: Re: [boost] enable_shared_from_this2
From: Berserker (berserker_r_at_[hidden])
Date: 2009-10-28 11:17:39

The expirity check seems working fine to me if merged in
enable_shared_ptr2 and solves some problems.
I can summarize other boost::python's problems in this example:

class X : public boost::enable_shared_from_this2<X>
    void test()
       shared_ptr<X> me = shared_from_this();

void expose_x()
    boost::python::class_<X>("X", boost::python::init<>()).
       def("test", &X::test);


C++ case 1 (works fine):

shared_ptr<X> x(new X);


C++ case 2 (doesn't work because of the missing static/dynamic cast):

X x;


Python case (doesn't work, same problem of C++ case 2)

x = X()

Boost list run by bdawes at, gregod at, cpdaniel at, john at