[python] TypeError when left side is noncopyable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[python] TypeError when left side is noncopyable

Igor R.
 I'm trying to expose an operator:

struct my_class : boost::noncopyable
{};
my_class &operator <<(my_class &e, int i);

// in the module definition:
class_<my_class, boost::noncopyable>("my_class")
   .def(self << int())
 ;

However, an attempt to invoke this operator in python causes the
following error:
TypeError: No to_python (by-value) converter found for C++ type: my_class

I guess this is related to the fact my_class is noncopyable, isn't it?
Is there a workaround for this issue?

Thanks.
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users