fix std::vector<const int*>, reported by tagna@gaia.ecs.csus.edu
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9084 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
eb5053c631
commit
aef1bfcf1a
2 changed files with 11 additions and 0 deletions
|
|
@ -122,3 +122,7 @@ std::vector<std::string> vecStr(std::vector<std::string> v) {
|
||||||
|
|
||||||
|
|
||||||
%template(pyvector) std::vector<swig::PyObject_ptr>;
|
%template(pyvector) std::vector<swig::PyObject_ptr>;
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
%template(ConstIntVector) vector<const int *>;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,13 @@ namespace swig {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class Type> struct traits_from<const Type *> {
|
||||||
|
static PyObject *from(const Type* val) {
|
||||||
|
return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
inline PyObject *from(const Type& val) {
|
inline PyObject *from(const Type& val) {
|
||||||
return traits_from<Type>::from(val);
|
return traits_from<Type>::from(val);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue