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
導出有問題。怎麼了?