[C++-sig] Magic boost conversion unicorn hook?
Francesco Biscani
bluescarni at gmail.com
Sat Sep 26 19:30:53 CEST 2015
On 25 September 2015 at 17:20, Stefan Seefeld <stefan at seefeld.name> wrote:
> I don't entirely understand what you are saying. What do you mean by
> "boost.python object", and what by "boost.python library function" ?
>
I think he has a C++ class that was exposed to Python, and which is
included as a member of a pure Python class. I think he would like to be
able to "implicitly convert" said pure Python class to the type of the
exposed C++ class, so that it can be used directly as an argument to
exposed C++ functions that expect the exposed C++ class as argument.
Maybe a possible solution would be to register a Python converter for your
wrapping class? This blog post was helpful to me when I had to learn how to
write custom to/from Python converters:
http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters
Hope that helps! Cheers,
Francesco.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20150926/b76a3fa5/attachment.html>
More information about the Cplusplus-sig
mailing list