1
我无法理解用boost.python将某些函数导出为python的正确方法。模板导出问题
我已经出口这个类CL_Rectf。它继承了CL_Rectx<float>
。
现在我想导出功能bounding_rect
:
# In CL_Rectf class exporting
.def("BoundingRect", &CL_Rectf::bounding_rect, PYPOLICY_REFERENCE_EXISTING)
它编译,但是当我在Python中使用此代码:
mBox = CL_Rectf()
mBox.BoundingRect(CL_Rectf(x, y, x2, y2))
我有这样的错误:
Boost.Python.ArgumentError: Python argument types in
CL_Rectf.BoundingRect(CL_Rectf, CL_Rectf)
did not match C++ signature:
BoundingRect(CL_Rectf {lvalue}, CL_Rectx<float>)
由于C++签名中的CL_Rectx
导出有问题。怎么了?