我很惊讶地发现下面的函数不是由SWIG自动包装的。当然,我一定做错了什么,因为这是一个非常基本的例子。在
接口文件(stdmap.i
):
%module stdmap;
%include "std_map.i"
%template(map_ii) std::map<int, int>;
%{
extern std::map<int, int> test_map();
%}
extern std::map<int, int> test_map();
实现(stdmap.cpp
):
当包装到Python时,我得到
> test_map()
<stdmap.map_ii; proxy of <Swig Object of type 'std::map< int,int > *' at 0x10801dd50> >
而不是
{1: 0, 4: 5}
一如预期。我在哪里出错?在
目前没有回答
相关问题 更多 >
编程相关推荐