我想通过使用SWIG将向量的C++向量包装到Python代码中。包装std ::向量,向量,C++ SWIG Python
是否可以包装这种类型的矢量向量?
std::vector<std::vector<MyClass*>>;
在接口文件中MyApplication.i
我添加这些行:
%include "std_vector.i"
%{
#include <vector>
%}
namespace std {
%template(VectorOfStructVector) vector<vector<MyClass*>>;
}
但是,执行痛饮时,我得到一个错误。我能够把这个包类型(使用参考向量):
std::vector<std::vector<MyClass*>*>;
但是,它不能正常工作,我无法访问的项目。这就是为什么我对这种类型感兴趣(没有参考):
std::vector<std::vector<MyClass*>>;
任何想法?
如果这确实是C++而不是C++ 0x,请确保在右括号之间包含一个空格。例如'>>'应该是'>>' – 2010-09-21 15:47:47
我在辩论评论或回答... – 2010-09-21 15:49:02
http://stackoverflow.com/questions/3754922/how-to-wrap-ac-vector-of-vector与swig? – 2011-01-03 04:32:15