Fixes bug 1386579. When returning a vector of pointers, do not create

copies of the objects that are pointed to since they may not have
copy constructors.  This also is more inline with returning a vector from a method
in C++ where the pointers are copied but not what they point to.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8083 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Charlie Savage 2005-12-27 19:56:35 +00:00
commit e5443e3bd4

View file

@ -225,7 +225,7 @@ namespace std {
%typemap(out) vector<T*> {
$result = rb_ary_new2($1.size());
for (unsigned int i=0; i<$1.size(); i++) {
T* x = new T((($1_type &)$1)[i]);
T* x = (($1_type &)$1)[i];
rb_ary_store($result,i,
SWIG_NewPointerObj((void *) x,
$descriptor(T *), 0));