Fix delete_if (reject!) for the STL container wrappers.
Previously they would sometimes seg fault or not work.
This commit is contained in:
parent
38b2b95c30
commit
2e0d1b12dc
5 changed files with 46 additions and 21 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue