Fix delete_if (reject!) for the STL container wrappers.

Previously they would sometimes seg fault or not work.
This commit is contained in:
William S Fulton 2013-03-29 06:28:15 +00:00
commit 2e0d1b12dc
5 changed files with 46 additions and 21 deletions

View file

@ -61,3 +61,7 @@ s.to_a == [1,[1,2],'hello'] # sort order: s.sort {|a,b| a.hash <=> b.hash}
EOF
iv = Set_int.new([0,1,2,3,4,5,6])
iv.delete_if { |x| x == 0 || x == 3 || x == 6 }
swig_assert_equal(iv.to_s, '1245', binding)

View file

@ -64,6 +64,11 @@ y = average([1, 2, 3, 4])
half([10, 10.5, 11, 11.5])
EOF
iv = IntVector.new([0,1,2,3,4,5,6])
iv.delete_if { |x| x == 0 || x == 3 || x == 6 }
swig_assert_equal(iv.to_s, '1245', binding)
dv = DoubleVector.new(10)
swig_assert( "dv.respond_to? :each_with_index", binding )