diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2008-11-28 23:35:46 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2008-11-28 23:35:46 +0000 |
commit | 93f039032204821d4fc363346587c90f640a1109 (patch) | |
tree | e6d0a9d8e8728fd22750e1ef2c9b515463f3cf39 /Examples/test-suite/li_std_vector_extra.i | |
parent | 0cfccf817f766757ce0311c8d59b89247059ff47 (diff) | |
download | swig-93f039032204821d4fc363346587c90f640a1109.tar.gz |
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
Diffstat (limited to 'Examples/test-suite/li_std_vector_extra.i')
-rw-r--r-- | Examples/test-suite/li_std_vector_extra.i | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Examples/test-suite/li_std_vector_extra.i b/Examples/test-suite/li_std_vector_extra.i index 17baffe04..5aeb403be 100644 --- a/Examples/test-suite/li_std_vector_extra.i +++ b/Examples/test-suite/li_std_vector_extra.i @@ -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 %{ |