Boost logo

Boost Users :

Subject: [Boost-users] [python] TypeError when left side is noncopyable
From: Igor R (boost.lists_at_[hidden])
Date: 2014-06-12 08:43:51


 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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net