开发者

Wrap std::vector of std::vectors, C++ SWIG Python

I want to wrap a C++ vector of vectors to Pytho开发者_JAVA技巧n code by using SWIG.

Is it possible to wrap this type of vector of vectors?

std::vector<std::vector<MyClass*>>;

In the interface file MyApplication.i I added these lines:

%include "std_vector.i"
%{ 
#include <vector> 
%} 

namespace std {
   %template(VectorOfStructVector) vector<vector<MyClass*>>;
}

But, I'm getting an Error when SWIG is executed. I'm able to wrap this type (using reference to the vector):

 std::vector<std::vector<MyClass*>*>;

But, it's not working properly, I cannot access the items. That's why I'm interested in this type (without the reference):

 std::vector<std::vector<MyClass*>>;

Any ideas?


Is it a C++ parsing issue?

 std::vector<std::vector<MyClass*> >;
 ---Important space---------------^
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜