嗨,我使用Python啓動其使用boost蟒蛇LIB轉換成可用的蟒蛇一類的cpp。同時,我有一個要求醃製使用python的cpp類的python類。升壓蟒蛇enable_pickling預期
所以我所做的是增加enable_picking()一個實例類的定義是這樣的:
class_<pform::base::Price>("Price", init<double>())
.def(self == self)
.def(self_ns::str(self_ns::self)) // __str__
.def("get_value", &pform::base::Price::get_value)
它使課堂與pickle。但是,如果取消它,我會得到這個錯誤。
Boost.Python.ArgumentError: Python argument types in
Price.__init__(Price)
did not match C++ signature:
__init__(_object*, double)
那麼這裏缺少什麼?