Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77833 - in trunk: boost/unordered/detail libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2012-04-08 11:29:50


Author: danieljames
Date: 2012-04-08 11:29:49 EDT (Sun, 08 Apr 2012)
New Revision: 77833
URL: http://svn.boost.org/trac/boost/changeset/77833

Log:
Unordered: Fix equality for multimap/multiset.
Text files modified:
   trunk/boost/unordered/detail/equivalent.hpp | 2 +-
   trunk/libs/unordered/test/unordered/equality_tests.cpp | 9 ++++++++-
   2 files changed, 9 insertions(+), 2 deletions(-)

Modified: trunk/boost/unordered/detail/equivalent.hpp
==============================================================================
--- trunk/boost/unordered/detail/equivalent.hpp (original)
+++ trunk/boost/unordered/detail/equivalent.hpp 2012-04-08 11:29:49 EDT (Sun, 08 Apr 2012)
@@ -330,7 +330,7 @@
             }
 
             node_pointer start = n1;
- for(;n1 != end2; n1 = static_cast<node_pointer>(n1->next_))
+ for(;n1 != end1; n1 = static_cast<node_pointer>(n1->next_))
             {
                 value_type const& v = n1->value();
                 if (find(start, n1, v)) continue;

Modified: trunk/libs/unordered/test/unordered/equality_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/equality_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/equality_tests.cpp 2012-04-08 11:29:49 EDT (Sun, 08 Apr 2012)
@@ -150,6 +150,14 @@
             ((1)(2))((1001)(1)), !=, ((1001)(2))((1)(1)))
     }
 
+ UNORDERED_AUTO_TEST(equality_multiple_group_test)
+ {
+ UNORDERED_EQUALITY_MULTISET_TEST(
+ (1)(1)(1)(1001)(2001)(2001)(2)(1002)(3)(1003)(2003), ==,
+ (3)(1003)(2003)(1002)(2)(2001)(2001)(1)(1001)(1)(1)
+ );
+ }
+
     // Test that equality still works when the two containers have
     // different hash functions but the same equality predicate.
 
@@ -168,7 +176,6 @@
         set1.insert(20); set2.insert(10);
         BOOST_TEST(set1 == set2);
     }
-
 }
 
 RUN_TESTS()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk