Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -64,23 +65,61 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } + assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == A(4)); @@ -141,23 +180,60 @@ assert(c.bucket_count() >= 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == A(10)); @@ -201,23 +277,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == A()); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -58,19 +59,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -114,19 +124,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -68,19 +69,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -133,19 +143,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -198,19 +217,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -263,19 +291,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -56,23 +57,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == @@ -110,23 +148,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == @@ -163,23 +238,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -56,23 +57,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == @@ -110,23 +148,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == @@ -164,23 +239,60 @@ LIBCPP_ASSERT(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); - ++i; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); - ++i; - assert(i->first == 3); - assert(i->second == "three"); - ++i; - assert(i->first == 4); - assert(i->second == "four"); + C::const_iterator ie = c.end(); + std::set sf; + sf.insert(1); + sf.insert(2); + sf.insert(3); + sf.insert(4); + while (i != ie) + { + int fi = i->first; + assert(sf.find(fi) != sf.end()); + switch (fi) + { + case 1: + { + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 2: + { + std::set s; + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } + break; + } + case 3: + assert(i->first == 3); + assert(i->second == "three"); + ++i; + break; + case 4: + assert(i->first == 4); + assert(i->second == "four"); + ++i; + break; + default: assert(false); + } + sf.erase(sf.find(fi)); + } assert(c.hash_function() == test_hash >(8)); assert(c.key_eq() == test_compare >(9)); assert(c.get_allocator() == A{}); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -53,19 +54,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -106,19 +116,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -161,19 +180,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -217,19 +245,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -55,19 +56,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -110,19 +120,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -56,19 +57,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -112,19 +122,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -58,19 +59,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -115,19 +125,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -59,19 +60,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -117,19 +127,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -176,19 +195,29 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -88,19 +89,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -177,19 +187,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -64,19 +65,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -128,19 +138,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -192,19 +211,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -256,19 +284,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -56,19 +57,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -112,19 +122,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -169,19 +188,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -227,19 +255,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -58,19 +59,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -116,19 +126,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -60,19 +61,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -119,19 +129,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -61,19 +62,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -121,19 +131,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -63,19 +64,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -124,19 +134,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); @@ -185,19 +204,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator i = eq.first; - assert(i->first == 1); - assert(i->second == "one"); - ++i; - assert(i->first == 1); - assert(i->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 1); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); i = eq.first; - assert(i->first == 2); - assert(i->second == "two"); - ++i; - assert(i->first == 2); - assert(i->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(i->first == 2); + assert(s.find(i->second) != s.end()); + s.erase(s.find(i->second)); + ++i; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); Index: test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -49,6 +50,7 @@ C::const_iterator i = c.find(2); C::const_iterator i_next = i; ++i_next; + std::string es = i->second; C::iterator j = c.erase(i); assert(j == i_next); @@ -57,16 +59,21 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; assert(k->first == 2); - assert(k->second == "four"); + assert(k->second == (es == "two" ? "four" : "two")); eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -98,6 +105,7 @@ C::const_iterator i = c.find(2); C::const_iterator i_next = i; ++i_next; + std::string es = i->second; C::iterator j = c.erase(i); assert(j == i_next); @@ -106,16 +114,21 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; assert(k->first == 2); - assert(k->second == "four"); + assert(k->second == (es == "two" ? "four" : "two")); eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; Index: test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -59,19 +60,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -90,11 +100,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -113,11 +127,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -136,11 +154,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -154,11 +176,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -222,19 +248,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::const_iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -253,11 +288,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -276,11 +315,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -299,11 +342,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -317,11 +364,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; Index: test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -46,19 +47,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -77,11 +87,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -123,19 +137,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -154,11 +177,15 @@ eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + s.insert("one"); + s.insert("four"); + for ( int ii = 0; ii < 2; ++ii ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; Index: test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -46,19 +47,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -92,19 +102,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; Index: test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -45,19 +46,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; @@ -92,19 +102,28 @@ Eq eq = c.equal_range(1); assert(std::distance(eq.first, eq.second) == 2); C::iterator k = eq.first; - assert(k->first == 1); - assert(k->second == "one"); - ++k; - assert(k->first == 1); - assert(k->second == "four"); + std::set s; + s.insert("one"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 1); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(2); assert(std::distance(eq.first, eq.second) == 2); k = eq.first; - assert(k->first == 2); - assert(k->second == "two"); - ++k; - assert(k->first == 2); - assert(k->second == "four"); + s.insert("two"); + s.insert("four"); + for ( int i = 0; i < 2; ++i ) + { + assert(k->first == 2); + assert(s.find(k->second) != s.end()); + s.erase(s.find(k->second)); + ++k; + } eq = c.equal_range(3); assert(std::distance(eq.first, eq.second) == 1); k = eq.first; Index: test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp +++ test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -135,10 +136,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1)); @@ -198,10 +211,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1)); @@ -319,10 +344,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1)); @@ -382,10 +419,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1)); @@ -503,10 +552,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1)); @@ -566,10 +627,22 @@ assert(c2.bucket_count() >= 6); assert(c2.size() == 6); - assert(c2.find(1)->second == "one"); - assert(next(c2.find(1))->second == "four"); - assert(c2.find(2)->second == "two"); - assert(next(c2.find(2))->second == "four"); + { + std::set s; + s.insert("one"); + s.insert("four"); + assert(s.find(c2.find(1)->second) != s.end()); + s.erase(s.find(c2.find(1)->second)); + assert(s.find(next(c2.find(1))->second) != s.end()); + } + { + std::set s; + s.insert("two"); + s.insert("four"); + assert(s.find(c2.find(2)->second) != s.end()); + s.erase(s.find(c2.find(2)->second)); + assert(s.find(next(c2.find(2))->second) != s.end()); + } assert(c2.find(3)->second == "three"); assert(c2.find(4)->second == "four"); assert(c2.hash_function() == Hash(1));