Hello,
how can I wrap the following overloaded operator+ using boost.python?
The code as is fails with
>...
>pytest.cpp: In function ‘void init_module_pytest()’:
>pytest.cpp:19: error: expected primary-expression before ‘(’ token
>...
If I try ".def(self+B())" instead of ".def(self+other())", the error is
>...
>pytest.cpp: In function ‘void init_module_pytest()’:
>pytest.cpp:17: error: no matching function for call to ‘B::B()’
>...
best wishes
Hans
pytest.cpp:
#include
using namespace boost::python;
class A{
public:
};
class B{
public:
B(int i){};
};
int operator+(const A& a,const B& b){return 42;};
BOOST_PYTHON_MODULE(pytest)
{
class_("A")
.def(self+other()) //.def(self+B())//line 17
;
class_("B",init)//line 19
;
}
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig