python访问struct中的struct
boost::python access struct within struct
有两个结构体:
struct A {
float x,y;
};
struct B {
A my_A;
};
我试图使用boost::python设置绑定来访问my_A
。到目前为止,我有:
using boost::python;
scope in_B = class_<B>("B")
.def_readwrite("my_A", B::my_A);
class_<A>("A")
.def_readwrite("x", &A::x)
.def_readwrite("y", &A::y);
,但这不允许我检索B.my_A.x
。欢迎提出任何建议。
好吧,@imreal的评论是正确的;我的错误是访问了数据。我用B.A.x
代替B.my_A.x
。
相关文章:
- 如何在c++中定义以struct为数据成员的类中的构造函数
- 在 SVM-Struct 中未定义对 sqrt 的引用(已使用 -lm)
- C++ 中的"template <typename From, typename Tag> struct Alias;"是什么?
- 错误:使用 tesseract 引擎时 C++ 中的声明'typedef struct tagBLOB BLOB'冲突
- 使用 c 头文件时,是否需要将 "struct" 放在 c++ 中的结构实例前面?
- 删除字符串指针在struct中的内存
- C :struct中的向量,push_back错误
- 如何初始化struct []或制作别名或将C 中的现有struct []指向
- 删除和更新矢量<struct>中的特定元素
- struct _stack*和Digit :: struct_stack*中的一些麻烦
- 如何将CPP结构中的字符串转换为Python struct
- 构造函数不允许在匿名聚合中,struct中的字符串
- 如何在C#struct中声明和使用固定尺寸的char缓冲区
- 从数组列表中的字符串迭代器获取 int dat<struct>
- 读取struct类型的循环中的变量
- 在struct构建的向量中添加元素
- 如何从采用 int 和 struct 类型的指针的函数中取消引用指针返回的地址?
- 自动更新struct中的指针值
- python访问struct中的struct
- Struct+中的C++Struct删除了函数错误