UTL - Fix some incorrect acceptance of types in the STL, eg a double * element passed into a vector<int *> constructor would be accepted, but the ensuing behaviour was undefined. Now the type conversion correctly raises an exception

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-11-28 23:35:46 +00:00
commit 93f0390322
10 changed files with 75 additions and 5 deletions

View file

@ -123,11 +123,17 @@ std::vector<std::string> vecStr(std::vector<std::string> v) {
%pointer_class(int,PtrInt)
%array_functions(int,ArrInt)
%inline %{
int *makeIntPtr(int v) { return new int(v); }
double *makeDoublePtr(double v) { return new double(v); }
int extractInt(int *p) { return *p; }
%}
%template(pyvector) std::vector<swig::PyObject_ptr>;
namespace std {
%template(ConstIntVector) vector<const int *>;
%template(ConstShortVector) vector<const short *>;
// %template(ConstIntVector) vector<const int *>; // interferes with vector<int *>... see new testcase li_std_vector_ptr
}
%inline %{