int ポインターを取り、boost::python を介して公開する関数があります。この関数を Python から呼び出すにはどうすればよいですか?
boost::python を使用した C++ の場合:
void foo(int* i);
...
def("foo", foo);
パイソンで:
import foo_ext
i = 12
foo_ext.foo(i)
結果は
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
foo(int)
did not match C++ signature:
foo(int* i)
では、ポインタを渡す方法は?