C++ 中有结构 B
// POINT 为 GDI 的一个结构 struct POINT {int x,int y};
struct B{
POINT a1;
int c;
};
用 boost.python 把 B 结构导出
class_<B>("B")
.def_readwrite("c",&B::c)
.def_readwrite("a1",&B::a1)
;
那么在 python 中怎么 对 a1.x 读写呢?直接操作 a1.x 会出错
// POINT 为 GDI 的一个结构 struct POINT {int x,int y};
struct B{
POINT a1;
int c;
};
用 boost.python 把 B 结构导出
class_<B>("B")
.def_readwrite("c",&B::c)
.def_readwrite("a1",&B::a1)
;
那么在 python 中怎么 对 a1.x 读写呢?直接操作 a1.x 会出错