[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?

Boost-users mailing list
[hidden email]