C++ Swig:ValueWrapper和模板错误?
我试图为in-typemap获取一个没有ValueWrapper包围的SmartPointer模板类型。我没有找到解决办法。因此,我检查了swig源代码,发现C++ Swig:ValueWrapper和模板错误?,c++,swig,C++,Swig,我试图为in-typemap获取一个没有ValueWrapper包围的SmartPointer模板类型。我没有找到解决办法。因此,我检查了swig源代码,发现typsys.c中的SwigType\u alttype正在为所有模板将use\u wrapper设置为true使用包装器=!n | | |!GetFlag(n,“特性:novaluewrapper”)始终为真!n。这是故意的还是错误 n = Swig_symbol_clookup(td, 0); if (n) { if
typsys.c
中的SwigType\u alttype
正在为所有模板将use\u wrapper
设置为true<代码>使用包装器=!n | | |!GetFlag(n,“特性:novaluewrapper”)由于,code>始终为真
!n
。这是故意的还是错误
n = Swig_symbol_clookup(td, 0);
if (n) {
if (GetFlag(n, "feature:valuewrapper")) {
use_wrapper = 1;
} else {
if (Checkattr(n, "nodeType", "class")
&& (!Getattr(n, "allocate:default_constructor")
|| (Getattr(n, "allocate:noassign")))) {
use_wrapper = !GetFlag(n, "feature:novaluewrapper") || GetFlag(n, "feature:nodefault");
}
}
} else {
if (SwigType_issimple(td) && SwigType_istemplate(td)) {
use_wrapper = !n || !GetFlag(n, "feature:novaluewrapper");
}
}
我无法回答他们为什么这么做,但我从他们那里找到了工作 从上一篇文章: 我已经找到了一个简洁的解决方案,可以使用%template指令来解决这个问题 没有名字 %template()std::auto_ptr
我自己也用过它,虽然你不得不为每种类型声明它并不太糟糕,但令人恼火。我无法回答他们为什么这么做,但我从中找到了解决办法 从上一篇文章: 我已经找到了一个简洁的解决方案,可以使用%template指令来解决这个问题 没有名字 %template()std::auto_ptr 我自己也用过它,虽然你不得不为每种类型声明它并不太糟糕,这很烦人