diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
commit | 5f98fe5c4f2a2090eeb9d30c030305a70a8347d1 (patch) | |
tree | 9b6002f850e6dea1e3400c6b19bb31a9cdf3067f /jam-files/boost-build/util/set.jam | |
parent | cf9994131993b40be62e90e213b1e11e6b550143 (diff) | |
parent | 21825a09d97c2e0afd20512f306fb25fed55e529 (diff) |
Merge remote branch 'upstream/master'
Conflicts:
Jamroot
bjam
decoder/Jamfile
decoder/cdec.cc
dpmert/Jamfile
jam-files/sanity.jam
klm/lm/Jamfile
klm/util/Jamfile
mira/Jamfile
Diffstat (limited to 'jam-files/boost-build/util/set.jam')
-rw-r--r-- | jam-files/boost-build/util/set.jam | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/jam-files/boost-build/util/set.jam b/jam-files/boost-build/util/set.jam deleted file mode 100644 index fc179134..00000000 --- a/jam-files/boost-build/util/set.jam +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2001, 2002 Dave Abrahams -# Copyright 2003 Vladimir Prus -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - -class set -{ - rule __init__ ( ) - { - } - - rule add ( elements * ) - { - for local e in $(elements) - { - if ! $($(e)) - { - $(e) = 1 ; - self.result += $(e) ; - } - } - } - - rule contains ( element ) - { - return $($(element)) ; - } - - rule list ( ) - { - return $(self.result) ; - } -} - - - -# Returns the elements of set1 that are not in set2. -# -rule difference ( set1 * : set2 * ) -{ - local result = ; - for local element in $(set1) - { - if ! ( $(element) in $(set2) ) - { - result += $(element) ; - } - } - return $(result) ; -} - -NATIVE_RULE set : difference ; - - -# Removes all the items appearing in both set1 & set2. -# -rule intersection ( set1 * : set2 * ) -{ - local result ; - for local v in $(set1) - { - if $(v) in $(set2) - { - result += $(v) ; - } - } - return $(result) ; -} - - -# Returns whether set1 & set2 contain the same elements. Note that this ignores -# any element ordering differences as well as any element duplication. -# -rule equal ( set1 * : set2 * ) -{ - if $(set1) in $(set2) && ( $(set2) in $(set1) ) - { - return true ; - } -} - - -rule __test__ ( ) -{ - import assert ; - - assert.result 0 1 4 6 8 9 : difference 0 1 2 3 4 5 6 7 8 9 : 2 3 5 7 ; - assert.result 2 5 7 : intersection 0 1 2 4 5 6 7 8 9 : 2 3 5 7 ; - - assert.true equal : ; - assert.true equal 1 1 2 3 : 3 2 2 1 ; - assert.false equal 2 3 : 3 2 2 1 ; -} |