Opened 13 years ago

Last modified 10 years ago

#3054 new Bugs

boost::python doesn't support implicit intrusive_ptr casts

Reported by: macke@… Owned by: troy d. straszheim
Milestone: Boost 1.40.0 Component: python USE GITHUB
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

See http://mail.python.org/pipermail/cplusplus-sig/2007-February/011651.html for code that solves this. (the boostPatch namespace contents)

I couldn't find anything on Boost.Python in the release notes for 1.38 or 1.39, so I assume it's still in there.

Also, for those who need this before it's included in boost::python::class_, a better use of the functions (than the typedeffing in the post above) is:

template<class T, class B, class X, class Y>
class myclass : boost::python::class_<T, B, X, Y>
{
public:
   template<class Constructor>
   myclass(const char* name, const Constructor& t) : boost::python::class_<T, B, X, Y>(name, t)
   {
      boostPatch::register_intrusive_ptr_from_python_and_casts( (T *)0, metadata::bases() );
   }
};

Change History (3)

comment:1 by troy d. straszheim, 13 years ago

Owner: changed from Dave Abrahams to troy d. straszheim

comment:2 by kernys01@…, 10 years ago

any progress here?

comment:3 by anonymous, 10 years ago

We haven't upgraded our Boost version since I wrote that, so I can't comment on that

This ticket hasn't gotten any love, that's for sure... :(

Note: See TracTickets for help on using tickets.