0
boost::python::object
からベースクラスへの参照を抽出できると言われました。ベースクラスの抽出ポインタ
簡単なコードは次のようになります。
// c++:
class Base {};
// Export Base into python module
// python:
class Der(Base):
pass
//c++:
boost::python::object obj; // It points to some Der class object made from python
boost::shared_ptr<Object> temp = extract< boost::shared_ptr<Object> >(obj);
最後の行はで失敗します。
TypeError: No registered converter was able to produce a C++ rvalue of type boost::shared_ptr from this Python object of type Der
Base
クラスのポインタを抽出することが可能ですか?