Код: Выделить всё
class A {
public:
std::vector &v() {return m_v;}
private:
std::vector m_v;
};
Код: Выделить всё
pybind11::class_(m, "A")
.def(pybind11::init())
.def_property("v", &A::v);
Подробнее здесь: https://stackoverflow.com/questions/784 ... h-pybind11
Мобильная версия