2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 00:12:11 +00:00

* new/container.jam

(vector.equal): Fix a bug, which causes all vectors with different sizes
   to be considered equal.


[SVN r19836]
This commit is contained in:
Vladimir Prus
2003-08-28 13:53:06 +00:00
parent 4afba02440
commit 8c2aa80007

View File

@@ -223,7 +223,7 @@ class vector : node
# Returns true if content is equal to the content of other vector.
# Uses 'utility.equal' for comparison.
rule equal ( another )
{
{
local mismatch ;
if [ size ] = [ $(another).size ]
{
@@ -234,7 +234,12 @@ class vector : node
mismatch = true ;
}
}
}
else
{
mismatch = true ;
}
if ! $(mismatch)
{
return true ;
@@ -299,6 +304,9 @@ local rule __test__ ( )
assert.false $(l4).equal $(l3) ;
local l5 = [ new vector 3 4 6 ] ;
assert.true $(l4).equal $(l5) ;
# Check that vectors of different sizes are considered non-equal
$(l5).pop-back ;
assert.false $(l4).equal $(l5) ;
local l6 = [ new vector [ new vector 1 2 3 ] ] ;
assert.true $(l6).equal [ new vector [ new vector 1 2 3 ] ] ;
}