python和C++对于管理内存和对象的生存时间非常不同。这样当在C++和python之间创建binding的时候,如果function返回的类型是a non-trivial type. 只通过类型信息,python无法确定是否管理返回的value并释放其资源,无法确定其是否在C++侧进行处理。
a better pybind11 (simpler, smaller, faster to compile and run, thanks to C++17, and because it supports Python 3.8+ only). In the meantime, Boost.Python has found a new maintainer. SWIG is still maintained. And at Google there is ongoing work on a new C++ wrapper generatorpywrapcc...
c++ pybind11和eigen给出“错误:使用已删除的函数'bool pybind11::detail::eigen_map_caster< MapType>::load”我发现了错误:我使用的是Eigen::Map而不是Eigen::Ref。