diff --git a/Lib/python/std_vector.i b/Lib/python/std_vector.i index 805e0c85c..3d16668de 100644 --- a/Lib/python/std_vector.i +++ b/Lib/python/std_vector.i @@ -83,13 +83,13 @@ namespace std { unsigned int size = (PyTuple_Check($input) ? PyTuple_Size($input) : PyList_Size($input)); - $1 = std::vector(size); + $1.reserve(size); for (unsigned int i=0; i(size); + $result.reserve(size); for (unsigned int i=0; i(size); + temp.reserve(size); $1 = &temp; for (unsigned int i=0; i(size); + temp.reserve(size); $result = &temp; for (unsigned int i=0; i expected"); + throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected"); } } %typemap(out) vector {