| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-21 20:23:37 +00:00
										 |  |  | // Copyright 2006-2010 Daniel James.
 | 
					
						
							| 
									
										
										
										
											2006-07-01 22:31:26 +00:00
										 |  |  | // Distributed under the Boost Software License, Version 1.0. (See accompanying
 | 
					
						
							|  |  |  | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | // clang-format off
 | 
					
						
							| 
									
										
										
										
											2009-11-26 23:15:30 +00:00
										 |  |  | #include "../helpers/prefix.hpp"
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | #include <boost/unordered_set.hpp>
 | 
					
						
							|  |  |  | #include <boost/unordered_map.hpp>
 | 
					
						
							| 
									
										
										
										
											2012-04-08 15:29:15 +00:00
										 |  |  | #include "../helpers/postfix.hpp"
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | // clang-format on
 | 
					
						
							| 
									
										
										
										
											2012-04-08 15:29:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-03-24 17:03:15 +00:00
										 |  |  | #include "../helpers/test.hpp"
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | #include "../objects/test.hpp"
 | 
					
						
							|  |  |  | #include "../helpers/random_values.hpp"
 | 
					
						
							|  |  |  | #include "../helpers/tracker.hpp"
 | 
					
						
							|  |  |  | #include "../helpers/equivalent.hpp"
 | 
					
						
							|  |  |  | #include "../helpers/invariants.hpp"
 | 
					
						
							| 
									
										
										
										
											2006-08-06 20:42:45 +00:00
										 |  |  | #include "../helpers/input_iterator.hpp"
 | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | #include "../helpers/helpers.hpp"
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <iostream>
 | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace insert_tests { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-07 10:57:35 +00:00
										 |  |  | test::seed_t initialize_seed(243432); | 
					
						
							| 
									
										
										
										
											2007-12-06 11:42:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void unique_insert_tests1(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |     test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							| 
									
										
										
										
											2006-06-12 23:30:46 +00:00
										 |  |  |     typedef test::ordered<X> ordered; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert(value) tests for containers with unique keys.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-06-12 23:30:46 +00:00
										 |  |  |         std::pair<iterator, bool> r1 = x.insert(*it); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |         BOOST_TEST(r1.second == r2.second); | 
					
						
							|  |  |  |         BOOST_TEST(*r1.first == *r2.first); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void equivalent_insert_tests1(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert(value) tests for containers with equivalent keys.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |     test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(*it); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |         BOOST_TEST(*r1 == *r2); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | template <class X> void insert_tests2(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  |     typedef BOOST_DEDUCED_TYPENAME test::ordered<X> tracker_type; | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME tracker_type::iterator tracker_iterator; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert(begin(), value) tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         X x; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         tracker_type tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             iterator r1 = x.insert(x.begin(), *it); | 
					
						
							|  |  |  |             tracker_iterator r2 = tracker.insert(tracker.begin(), *it); | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(*r1 == *r2); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |         tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert(end(), value) tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         X x; | 
					
						
							|  |  |  |         X const& x_const = x; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         tracker_type tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(100, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             const_iterator r1 = x.insert(x_const.end(), *it); | 
					
						
							|  |  |  |             tracker_iterator r2 = tracker.insert(tracker.end(), *it); | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(*r1 == *r2); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |         tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert(pos, value) tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         X x; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         const_iterator pos = x.begin(); | 
					
						
							|  |  |  |         tracker_type tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             pos = x.insert(pos, *it); | 
					
						
							|  |  |  |             tracker_iterator r2 = tracker.insert(tracker.begin(), *it); | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(*pos == *r2); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |         tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert single item range tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         X x; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         tracker_type tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-11 13:36:41 +01:00
										 |  |  |             x.insert(it, test::next(it)); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |             tracker.insert(*it); | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |         tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert range tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         X x; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         x.insert(v.begin(), v.end()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  |         test::check_container(x, v); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2006-08-06 20:42:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert range with rehash tests.\n"; | 
					
						
							| 
									
										
										
										
											2012-09-12 21:09:39 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.insert(*v.begin()); | 
					
						
							|  |  |  |         x.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.insert(v.begin(), v.end()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_container(x, v); | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert input iterator range tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-08-06 20:42:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-08-06 20:42:45 +00:00
										 |  |  |         X x; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2009-12-04 19:44:34 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             begin = v.begin(), | 
					
						
							|  |  |  |             end = v.end(); | 
					
						
							| 
									
										
										
										
											2009-12-04 19:44:34 +00:00
										 |  |  |         x.insert(test::input_iterator(begin), test::input_iterator(end)); | 
					
						
							| 
									
										
										
										
											2006-08-06 20:42:45 +00:00
										 |  |  |         test::check_container(x, v); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-10-21 20:23:37 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert copy iterator range tests.\n"; | 
					
						
							| 
									
										
										
										
											2010-10-21 20:23:37 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-21 20:23:37 +00:00
										 |  |  |         X x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         x.insert(test::copy_iterator(v.begin()), test::copy_iterator(v.end())); | 
					
						
							|  |  |  |         test::check_container(x, v); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-09-17 18:59:03 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert copy iterator range test 2.\n"; | 
					
						
							| 
									
										
										
										
											2012-09-17 18:59:03 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v1(500, generator); | 
					
						
							|  |  |  |         test::random_values<X> v2(500, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         x.insert( | 
					
						
							|  |  |  |             test::copy_iterator(v1.begin()), test::copy_iterator(v1.end())); | 
					
						
							|  |  |  |         x.insert( | 
					
						
							|  |  |  |             test::copy_iterator(v2.begin()), test::copy_iterator(v2.end())); | 
					
						
							| 
									
										
										
										
											2012-09-17 18:59:03 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "insert various ranges.\n"; | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         for (int i = 0; i < 100; ++i) { | 
					
						
							|  |  |  |             X x; | 
					
						
							|  |  |  |             test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |             for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                      v.begin(); | 
					
						
							|  |  |  |                  it != v.end();) { | 
					
						
							|  |  |  |                 BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                     x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |                 float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |                 BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator next = | 
					
						
							|  |  |  |                     it; | 
					
						
							| 
									
										
										
										
											2016-10-06 17:06:32 +01:00
										 |  |  |                 for (std::size_t j = test::random_value(20); j > 0; ++j) { | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |                     ++next; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |                     if (next == v.end()) { | 
					
						
							|  |  |  |                         break; | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 x.insert(it, next); | 
					
						
							|  |  |  |                 tracker.insert(it, next); | 
					
						
							|  |  |  |                 it = next; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 tracker.compare(x); // Slow, but I can't see any other way.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |                 if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |                     b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |                     BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             test::check_equivalent_keys(x); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void unique_emplace_tests1(X*, test::random_generator generator) | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | { | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  |     typedef test::ordered<X> ordered; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "emplace(value) tests for containers with unique keys.\n"; | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							|  |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         std::pair<iterator, bool> r1 = x.emplace(*it); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |         BOOST_TEST(r1.second == r2.second); | 
					
						
							|  |  |  |         BOOST_TEST(*r1.first == *r2.first); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |     tracker.compare(x); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void equivalent_emplace_tests1(X*, test::random_generator generator) | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "emplace(value) tests for containers with equivalent keys.\n"; | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							|  |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         BOOST_DEDUCED_TYPENAME X::iterator r1 = x.emplace(*it); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |         BOOST_TEST(*r1 == *r2); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |     tracker.compare(x); | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | template <class X> void move_emplace_tests(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr | 
					
						
							|  |  |  |         << "emplace(move(value)) tests for containers with unique keys.\n"; | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							|  |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-07 17:06:11 +00:00
										 |  |  |         typename X::value_type value = *it; | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |         x.emplace(boost::move(value)); | 
					
						
							|  |  |  |         tracker.insert(*it); | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |     test::check_equivalent_keys(x); | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | template <class X> void default_emplace_tests(X*, test::random_generator) | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2016-10-22 09:49:14 +01:00
										 |  |  | #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "emplace() tests.\n"; | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     bool is_unique = test::has_unique_keys<X>::value; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     X x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.emplace(); | 
					
						
							|  |  |  |     BOOST_TEST(x.size() == 1); | 
					
						
							|  |  |  |     x.emplace(); | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.size() == (is_unique ? 1u : 2u)); | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     x.emplace(); | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.size() == (is_unique ? 1u : 3u)); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     typename X::value_type y; | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.count(test::get_key<X>(y)) == (is_unique ? 1u : 3u)); | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     BOOST_TEST(*x.equal_range(test::get_key<X>(y)).first == y); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.emplace(y); | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.size() == (is_unique ? 1u : 4u)); | 
					
						
							|  |  |  |     BOOST_TEST(x.count(test::get_key<X>(y)) == (is_unique ? 1u : 4u)); | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     BOOST_TEST(*x.equal_range(test::get_key<X>(y)).first == y); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     x.clear(); | 
					
						
							|  |  |  |     BOOST_TEST(x.empty()); | 
					
						
							|  |  |  |     x.emplace(y); | 
					
						
							|  |  |  |     BOOST_TEST(x.size() == 1); | 
					
						
							|  |  |  |     x.emplace(y); | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.size() == (is_unique ? 1u : 2u)); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-11 10:07:07 +01:00
										 |  |  |     BOOST_TEST(x.count(test::get_key<X>(y)) == (is_unique ? 1u : 2u)); | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     BOOST_TEST(*x.equal_range(test::get_key<X>(y)).first == y); | 
					
						
							| 
									
										
										
										
											2016-10-22 09:49:14 +01:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | } | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | template <class X> void map_tests(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "map tests.\n"; | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |     X x; | 
					
						
							|  |  |  |     test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin(); | 
					
						
							|  |  |  |          it != v.end(); ++it) { | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  |         BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |         float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x[it->first] = it->second; | 
					
						
							|  |  |  |         tracker[it->first] = it->second; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         if (static_cast<double>(x.size()) <= | 
					
						
							|  |  |  |             b * static_cast<double>(old_bucket_count)) | 
					
						
							| 
									
										
										
										
											2009-05-27 17:44:09 +00:00
										 |  |  |             BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-18 12:22:48 +01:00
										 |  |  |     tracker.compare(x); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     test::check_equivalent_keys(x); | 
					
						
							| 
									
										
										
										
											2006-05-21 17:14:11 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | template <class X> void map_tests2(X*, test::random_generator generator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  |     std::cerr << "insert_or_assign\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             std::pair<iterator, bool> r = | 
					
						
							|  |  |  |                 x.insert_or_assign(it->first, it->second); | 
					
						
							|  |  |  |             BOOST_TEST(*r.first == *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker[it->first] = it->second; | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare(x); | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "insert_or_assign(begin)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator r = x.insert_or_assign(x.begin(), it->first, it->second); | 
					
						
							|  |  |  |             BOOST_TEST(*r == *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker[it->first] = it->second; | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare(x); | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "insert_or_assign(end)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator r = x.insert_or_assign(x.end(), it->first, it->second); | 
					
						
							|  |  |  |             BOOST_TEST(*r == *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker[it->first] = it->second; | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare(x); | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "insert_or_assign(last)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  |         iterator last = x.begin(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator r = x.insert_or_assign(last, it->first, it->second); | 
					
						
							|  |  |  |             BOOST_TEST(*r == *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker[it->first] = it->second; | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             last = r; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tracker.compare(x); | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | template <class X> void try_emplace_tests(X*, test::random_generator generator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     std::cerr << "try_emplace(key, value)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator pos = x.find(it->first); | 
					
						
							|  |  |  |             bool found = pos != x.end(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             std::pair<typename X::iterator, bool> r = | 
					
						
							|  |  |  |                 x.try_emplace(it->first, it->second); | 
					
						
							|  |  |  |             if (found) { | 
					
						
							|  |  |  |                 BOOST_TEST(pos == r.first); | 
					
						
							|  |  |  |                 BOOST_TEST(!r.second); | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 BOOST_TEST(r.second); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r.first->first, it->first); | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r.first->second, it->second); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "try_emplace(begin(), key, value)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator pos = x.find(it->first); | 
					
						
							|  |  |  |             bool found = pos != x.end(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             typename X::iterator r = | 
					
						
							|  |  |  |                 x.try_emplace(r.begin(), it->first, it->second); | 
					
						
							|  |  |  |             if (found) { | 
					
						
							|  |  |  |                 BOOST_TEST(pos == r); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->first, it->first); | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->second, it->second); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "try_emplace(end(), key, value)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator pos = x.find(it->first); | 
					
						
							|  |  |  |             bool found = pos != x.end(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             typename X::iterator r = | 
					
						
							|  |  |  |                 x.try_emplace(r.end(), it->first, it->second); | 
					
						
							|  |  |  |             if (found) { | 
					
						
							|  |  |  |                 BOOST_TEST(pos == r); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->first, it->first); | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->second, it->second); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::cerr << "try_emplace(pos, key, value)\n"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         X x; | 
					
						
							|  |  |  |         test::ordered<X> tracker = test::create_ordered(x); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::random_values<X> v(1000, generator); | 
					
						
							|  |  |  |         for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = | 
					
						
							|  |  |  |                  v.begin(); | 
					
						
							|  |  |  |              it != v.end(); ++it) { | 
					
						
							|  |  |  |             BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = | 
					
						
							|  |  |  |                 x.bucket_count(); | 
					
						
							|  |  |  |             float b = x.max_load_factor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             iterator pos = x.find(it->first); | 
					
						
							|  |  |  |             bool found = pos != x.end(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             typename X::iterator r = x.try_emplace(pos, it->first, it->second); | 
					
						
							|  |  |  |             if (found) { | 
					
						
							|  |  |  |                 BOOST_TEST(pos == r); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->first, it->first); | 
					
						
							|  |  |  |             BOOST_TEST_EQ(r->second, it->second); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             tracker.insert(*it); | 
					
						
							|  |  |  |             tracker.compare_key(x, *it); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (static_cast<double>(x.size()) < | 
					
						
							|  |  |  |                 b * static_cast<double>(old_bucket_count)) | 
					
						
							|  |  |  |                 BOOST_TEST(x.bucket_count() == old_bucket_count); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         test::check_equivalent_keys(x); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-04 22:49:39 +00:00
										 |  |  | // Some tests for when the range's value type doesn't match the container's
 | 
					
						
							|  |  |  | // value type.
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void map_insert_range_test1(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "map_insert_range_test1\n"; | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |     test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type, | 
					
						
							|  |  |  |         BOOST_DEDUCED_TYPENAME X::mapped_type> > | 
					
						
							|  |  |  |         list; | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |     test::random_values<X> v(1000, generator); | 
					
						
							| 
									
										
											  
											
												Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
  r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
  
  Remove a trailing comma.
........
  r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
  
  Merge in support for equality operators.
........
  r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
  
  Use my own list container to avoid working around STL container bugs.
........
  r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
  
  Better equality tests.
........
  r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
  
  Remove a superfluous check.
........
  r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
  
  Add equality reference documentation.
........
  r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
  
  New version of list.hpp
........
  r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
  
  Support compilers without ADL in the compile tests.
........
  r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
  
  Change the typedef of buffered functions as it was confusing MSVC 6.5
  
  get_allocator wasn't compiling when the allocator workaround is used because it
  couldn't cast from the wrapped allocator to an allocator of another type. So
  use value_alloc_ when it's available (it's only unavailable on compilers with
  C++0x support, which don't require the workaround).
........
[SVN r44919]
											
										 
											2008-04-30 07:57:04 +00:00
										 |  |  |     list l(v.begin(), v.end()); | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     X x; | 
					
						
							|  |  |  |     x.insert(l.begin(), l.end()); | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | template <class X> | 
					
						
							| 
									
										
										
										
											2012-09-05 23:33:22 +00:00
										 |  |  | void map_insert_range_test2(X*, test::random_generator generator) | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     std::cerr << "map_insert_range_test2\n"; | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-14 18:52:43 +00:00
										 |  |  |     test::check_instances check_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type const, | 
					
						
							|  |  |  |         test::implicitly_convertible> > | 
					
						
							|  |  |  |         list; | 
					
						
							|  |  |  |     test::random_values<boost::unordered_map<BOOST_DEDUCED_TYPENAME X::key_type, | 
					
						
							|  |  |  |         test::implicitly_convertible> > | 
					
						
							|  |  |  |         v(1000, generator); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  |     list l(v.begin(), v.end()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     X x; | 
					
						
							|  |  |  |     x.insert(l.begin(), l.end()); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test::check_equivalent_keys(x); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_set<test::movable, test::hash, test::equal_to, | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     std::allocator<test::movable> >* test_set_std_alloc; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_multimap<test::object, test::object, test::hash, | 
					
						
							|  |  |  |     test::equal_to, std::allocator<test::object> >* test_multimap_std_alloc; | 
					
						
							| 
									
										
										
										
											2012-07-08 11:55:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_set<test::object, test::hash, test::equal_to, | 
					
						
							| 
									
										
										
										
											2012-07-08 11:55:35 +00:00
										 |  |  |     test::allocator1<test::object> >* test_set; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_multiset<test::movable, test::hash, test::equal_to, | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     test::allocator2<test::movable> >* test_multiset; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_map<test::movable, test::movable, test::hash, test::equal_to, | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  |     test::allocator2<test::movable> >* test_map; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | boost::unordered_multimap<test::object, test::object, test::hash, | 
					
						
							|  |  |  |     test::equal_to, test::allocator1<test::object> >* test_multimap; | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | using test::default_generator; | 
					
						
							|  |  |  | using test::generate_collisions; | 
					
						
							| 
									
										
										
										
											2016-10-06 17:06:32 +01:00
										 |  |  | using test::limited_range; | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(unique_insert_tests1, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_set_std_alloc)(test_set)(test_map))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(equivalent_insert_tests1, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_multimap_std_alloc)(test_multiset)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | UNORDERED_TEST( | 
					
						
							|  |  |  |     insert_tests2, ((test_multimap_std_alloc)(test_set)(test_multiset)( | 
					
						
							|  |  |  |                        test_map)(test_multimap))( | 
					
						
							|  |  |  |                        (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | UNORDERED_TEST(unique_emplace_tests1, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_set_std_alloc)(test_set)(test_map))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(equivalent_emplace_tests1, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_multimap_std_alloc)(test_multiset)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(move_emplace_tests, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( | 
					
						
							|  |  |  |         test_multiset)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2012-09-26 08:09:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(default_emplace_tests, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( | 
					
						
							|  |  |  |         test_multiset)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
											  
											
												Merge support for emplace for compilers with rvalue references and variadic templates arguments, and better use of C++0x allocators.
Merged revisions 44058-44075,44078-44084,44086-44108,44110-44365,44367,44369-44414,44416-44419,44421-44457,44467-44469,44471-44511,44513-44535,44537-44737 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk
................
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
................
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
................
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
................
  r44516 | danieljames | 2008-04-17 21:41:48 +0100 (Thu, 17 Apr 2008) | 16 lines
  
  Merge in my work so far on implementing emplace for compilers with variadic
  template & rvalue references.
  
  Merged revisions 44059-44062 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/dev
  
  ........
    r44059 | danieljames | 2008-04-05 17:41:25 +0100 (Sat, 05 Apr 2008) | 1 line
    
    First stab at implementing emplace - only for compilers with variadic template & rvalue references.
  ........
    r44062 | danieljames | 2008-04-05 19:12:09 +0100 (Sat, 05 Apr 2008) | 1 line
    
    Better variable template arguments, need to add proper support to BoostBook.
  ........
................
  r44616 | danieljames | 2008-04-20 13:30:19 +0100 (Sun, 20 Apr 2008) | 1 line
  
  Merge with trunk, fixes tabs.
................
  r44618 | danieljames | 2008-04-20 13:42:38 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Some extra compile tests.
................
  r44619 | danieljames | 2008-04-20 13:42:50 +0100 (Sun, 20 Apr 2008) | 2 lines
  
  Fix an error message.
................
  r44703 | danieljames | 2008-04-21 20:19:50 +0100 (Mon, 21 Apr 2008) | 15 lines
  
  Merge latest changes from trunk.
  
  Merged revisions 44616-44702 via svnmerge from 
  https://svn.boost.org/svn/boost/trunk
  
  ........
    r44650 | danieljames | 2008-04-20 22:08:57 +0100 (Sun, 20 Apr 2008) | 1 line
    
    Update an include.
  ........
    r44697 | danieljames | 2008-04-21 16:55:40 +0100 (Mon, 21 Apr 2008) | 1 line
    
    Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.
  ........
................
  r44733 | danieljames | 2008-04-23 07:55:43 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Remove 'reserve_extra'.
................
  r44734 | danieljames | 2008-04-23 07:55:55 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More unnecessary copy tests - showing some weakness in the emplace implementation.
................
  r44735 | danieljames | 2008-04-23 07:56:06 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  More tests.
................
  r44736 | danieljames | 2008-04-23 07:56:19 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Comment out a test which requires a C++0x std::pair.
................
  r44737 | danieljames | 2008-04-23 07:56:35 +0100 (Wed, 23 Apr 2008) | 2 lines
  
  Avoid creating unnecessary copies in unordered_set::emplace and unordered_map::emplace.
................
[SVN r44738]
											
										 
											2008-04-23 07:09:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | UNORDERED_TEST(map_tests, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_map))((default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | UNORDERED_TEST( | 
					
						
							|  |  |  |     map_tests2, ((test_map))((default_generator)(generate_collisions))) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | UNORDERED_TEST(map_insert_range_test1, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_multimap_std_alloc)(test_map)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2009-10-03 16:42:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_TEST(map_insert_range_test2, | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     ((test_multimap_std_alloc)(test_map)(test_multimap))( | 
					
						
							|  |  |  |                    (default_generator)(generate_collisions)(limited_range))) | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 22:08:01 +00:00
										 |  |  | #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  | struct initialize_from_two_ints | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     int a, b; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     friend std::size_t hash_value(initialize_from_two_ints const& x) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-10-05 13:52:33 +01:00
										 |  |  |         return static_cast<std::size_t>(x.a + x.b); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-25 22:21:51 +00:00
										 |  |  |     bool operator==(initialize_from_two_ints const& x) const | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         return a == x.a && b == x.b; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  | UNORDERED_AUTO_TEST(insert_initializer_list_set) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_set<int> set; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     set.insert({1, 2, 3, 1}); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST_EQ(set.size(), 3u); | 
					
						
							|  |  |  |     BOOST_TEST(set.find(1) != set.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set.find(4) == set.end()); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     boost::unordered_set<initialize_from_two_ints> set2; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 22:39:47 +01:00
										 |  |  | #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
 | 
					
						
							| 
									
										
										
										
											2014-08-02 03:09:48 +01:00
										 |  |  |     set2.insert({{1, 2}}); | 
					
						
							|  |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     set2.insert({1, 2}); | 
					
						
							| 
									
										
										
										
											2014-08-02 03:09:48 +01:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     BOOST_TEST(set2.size() == 1); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     BOOST_TEST(set2.find({1, 2}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({2, 1}) == set2.end()); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     set2.insert({{3, 4}, {5, 6}, {7, 8}}); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     BOOST_TEST(set2.size() == 4); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     BOOST_TEST(set2.find({1, 2}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({3, 4}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({5, 6}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({7, 8}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({8, 7}) == set2.end()); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     set2.insert({{2, 1}, {3, 4}}); | 
					
						
							| 
									
										
										
										
											2013-10-24 18:11:35 +00:00
										 |  |  |     BOOST_TEST(set2.size() == 5); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     BOOST_TEST(set2.find({1, 2}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({2, 1}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({3, 4}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({5, 6}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({7, 8}) != set2.end()); | 
					
						
							|  |  |  |     BOOST_TEST(set2.find({8, 7}) == set2.end()); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-15 17:11:25 +00:00
										 |  |  | #if !BOOST_WORKAROUND(BOOST_MSVC, == 1800)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  | UNORDERED_AUTO_TEST(insert_initializer_list_multiset) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_multiset<std::string> multiset; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     // multiset.insert({});
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST(multiset.empty()); | 
					
						
							|  |  |  |     multiset.insert({"a"}); | 
					
						
							|  |  |  |     BOOST_TEST_EQ(multiset.size(), 1u); | 
					
						
							|  |  |  |     BOOST_TEST(multiset.find("a") != multiset.end()); | 
					
						
							|  |  |  |     BOOST_TEST(multiset.find("b") == multiset.end()); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     multiset.insert({"a", "b"}); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST(multiset.size() == 3); | 
					
						
							|  |  |  |     BOOST_TEST_EQ(multiset.count("a"), 2u); | 
					
						
							|  |  |  |     BOOST_TEST_EQ(multiset.count("b"), 1u); | 
					
						
							|  |  |  |     BOOST_TEST_EQ(multiset.count("c"), 0u); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-15 17:11:25 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  | UNORDERED_AUTO_TEST(insert_initializer_list_map) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_map<std::string, std::string> map; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     // map.insert({});
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST(map.empty()); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     map.insert({{"a", "b"}, {"a", "b"}, {"d", ""}}); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST_EQ(map.size(), 2u); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_AUTO_TEST(insert_initializer_list_multimap) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_multimap<std::string, std::string> multimap; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     // multimap.insert({});
 | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST(multimap.empty()); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     multimap.insert({{"a", "b"}, {"a", "b"}, {"d", ""}}); | 
					
						
							| 
									
										
										
										
											2009-10-03 16:41:32 +00:00
										 |  |  |     BOOST_TEST_EQ(multimap.size(), 3u); | 
					
						
							|  |  |  |     BOOST_TEST_EQ(multimap.count("a"), 2u); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  | struct overloaded_constructor | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2014-01-26 22:57:14 +00:00
										 |  |  |     overloaded_constructor(int x1_ = 1, int x2_ = 2, int x3_ = 3, int x4_ = 4) | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |         : x1(x1_), x2(x2_), x3(x3_), x4(x4_) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  |     int x1, x2, x3, x4; | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  |     bool operator==(overloaded_constructor const& rhs) const | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  |         return x1 == rhs.x1 && x2 == rhs.x2 && x3 == rhs.x3 && x4 == rhs.x4; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  |     friend std::size_t hash_value(overloaded_constructor const& x) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         std::size_t hash = 0; | 
					
						
							|  |  |  |         boost::hash_combine(hash, x.x1); | 
					
						
							|  |  |  |         boost::hash_combine(hash, x.x2); | 
					
						
							|  |  |  |         boost::hash_combine(hash, x.x3); | 
					
						
							|  |  |  |         boost::hash_combine(hash, x.x4); | 
					
						
							|  |  |  |         return hash; | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_AUTO_TEST(map_emplace_test) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         boost::unordered_map<int, overloaded_constructor, test::hash, | 
					
						
							|  |  |  |             test::equal_to, | 
					
						
							|  |  |  |             test::allocator1<std::pair<int const, overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-08 21:11:16 +00:00
										 |  |  | #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.emplace(); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(0) != x.end() && | 
					
						
							|  |  |  |                    x.find(0)->second == overloaded_constructor()); | 
					
						
							| 
									
										
										
										
											2011-09-08 21:11:16 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.emplace(2, 3); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(2) != x.end() && | 
					
						
							|  |  |  |                    x.find(2)->second == overloaded_constructor(3)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.try_emplace(5); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(5) != x.end() && | 
					
						
							|  |  |  |                    x.find(5)->second == overloaded_constructor()); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         boost::unordered_multimap<int, overloaded_constructor, test::hash, | 
					
						
							|  |  |  |             test::equal_to, | 
					
						
							|  |  |  |             test::allocator1<std::pair<int const, overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
 | 
					
						
							|  |  |  |         x.emplace(); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(0) != x.end() && | 
					
						
							|  |  |  |                    x.find(0)->second == overloaded_constructor()); | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.emplace(2, 3); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(2) != x.end() && | 
					
						
							|  |  |  |                    x.find(2)->second == overloaded_constructor(3)); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-08-26 08:12:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  | UNORDERED_AUTO_TEST(set_emplace_test) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_set<overloaded_constructor> x; | 
					
						
							|  |  |  |     overloaded_constructor check; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-08 21:11:16 +00:00
										 |  |  | #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
 | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  |     x.emplace(); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							| 
									
										
										
										
											2011-09-08 21:11:16 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2011-08-27 11:29:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							|  |  |  |     x.emplace(1); | 
					
						
							|  |  |  |     check = overloaded_constructor(1); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							|  |  |  |     x.emplace(2, 3); | 
					
						
							|  |  |  |     check = overloaded_constructor(2, 3); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							|  |  |  |     x.emplace(4, 5, 6); | 
					
						
							|  |  |  |     check = overloaded_constructor(4, 5, 6); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							|  |  |  |     x.emplace(7, 8, 9, 10); | 
					
						
							|  |  |  |     check = overloaded_constructor(7, 8, 9, 10); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | struct derived_from_piecewise_construct_t | 
					
						
							|  |  |  |     : boost::unordered::piecewise_construct_t | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2012-11-17 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | derived_from_piecewise_construct_t piecewise_rvalue() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-17 12:03:32 +00:00
										 |  |  |     return derived_from_piecewise_construct_t(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  | struct convertible_to_piecewise | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     operator boost::unordered::piecewise_construct_t() const | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2012-11-17 12:03:55 +00:00
										 |  |  |         return boost::unordered::piecewise_construct; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  | UNORDERED_AUTO_TEST(map_emplace_test2) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |     // Emulating piecewise construction with boost::tuple bypasses the
 | 
					
						
							|  |  |  |     // allocator's construct method, but still uses test destroy method.
 | 
					
						
							|  |  |  |     test::detail::disable_construction_tracking _scoped; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         boost::unordered_map<overloaded_constructor, overloaded_constructor, | 
					
						
							|  |  |  |             boost::hash<overloaded_constructor>, | 
					
						
							|  |  |  |             std::equal_to<overloaded_constructor>, | 
					
						
							|  |  |  |             test::allocator1<std::pair<overloaded_constructor const, | 
					
						
							|  |  |  |                 overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), | 
					
						
							|  |  |  |             boost::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(convertible_to_piecewise(), boost::make_tuple(1), | 
					
						
							|  |  |  |             boost::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(piecewise_rvalue(), boost::make_tuple(2, 3), | 
					
						
							|  |  |  |             boost::make_tuple(4, 5, 6)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         derived_from_piecewise_construct_t d; | 
					
						
							|  |  |  |         x.emplace(d, boost::make_tuple(9, 3, 1), boost::make_tuple(10)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(9, 3, 1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(10)); | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.clear(); | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.try_emplace(overloaded_constructor()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.try_emplace(1); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         x.try_emplace(overloaded_constructor(2, 3), 4, 5, 6); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-02-27 03:59:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  |         boost::unordered_multimap<overloaded_constructor, | 
					
						
							|  |  |  |             overloaded_constructor, boost::hash<overloaded_constructor>, | 
					
						
							|  |  |  |             std::equal_to<overloaded_constructor>, | 
					
						
							|  |  |  |             test::allocator1<std::pair<overloaded_constructor const, | 
					
						
							|  |  |  |                 overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), | 
					
						
							|  |  |  |             boost::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(convertible_to_piecewise(), boost::make_tuple(1), | 
					
						
							|  |  |  |             boost::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(piecewise_rvalue(), boost::make_tuple(2, 3), | 
					
						
							|  |  |  |             boost::make_tuple(4, 5, 6)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         derived_from_piecewise_construct_t d; | 
					
						
							|  |  |  |         x.emplace(d, boost::make_tuple(9, 3, 1), boost::make_tuple(10)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(9, 3, 1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(10)); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_AUTO_TEST(set_emplace_test2) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     boost::unordered_set< | 
					
						
							|  |  |  |         std::pair<overloaded_constructor, overloaded_constructor> > | 
					
						
							|  |  |  |         x; | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  |     std::pair<overloaded_constructor, overloaded_constructor> check; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), | 
					
						
							|  |  |  |         boost::make_tuple()); | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							| 
									
										
										
										
											2017-02-19 13:05:17 +00:00
										 |  |  |     x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(1), | 
					
						
							|  |  |  |         boost::make_tuple(2, 3)); | 
					
						
							|  |  |  |     check = | 
					
						
							|  |  |  |         std::make_pair(overloaded_constructor(1), overloaded_constructor(2, 3)); | 
					
						
							| 
									
										
										
										
											2011-08-29 09:40:41 +00:00
										 |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-04-18 10:14:26 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_AUTO_TEST(map_std_emplace_test2) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         boost::unordered_map<overloaded_constructor, overloaded_constructor, | 
					
						
							|  |  |  |             boost::hash<overloaded_constructor>, | 
					
						
							|  |  |  |             std::equal_to<overloaded_constructor>, | 
					
						
							|  |  |  |             test::allocator1<std::pair<overloaded_constructor const, | 
					
						
							|  |  |  |                 overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace( | 
					
						
							|  |  |  |             std::piecewise_construct, std::make_tuple(), std::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace( | 
					
						
							|  |  |  |             convertible_to_piecewise(), std::make_tuple(1), std::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(piecewise_rvalue(), std::make_tuple(2, 3), | 
					
						
							|  |  |  |             std::make_tuple(4, 5, 6)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         derived_from_piecewise_construct_t d; | 
					
						
							|  |  |  |         x.emplace(d, std::make_tuple(9, 3, 1), std::make_tuple(10)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(9, 3, 1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(10)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.try_emplace(overloaded_constructor()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.try_emplace(1); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.try_emplace(overloaded_constructor(2, 3), 4, 5, 6); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         boost::unordered_multimap<overloaded_constructor, | 
					
						
							|  |  |  |             overloaded_constructor, boost::hash<overloaded_constructor>, | 
					
						
							|  |  |  |             std::equal_to<overloaded_constructor>, | 
					
						
							|  |  |  |             test::allocator1<std::pair<overloaded_constructor const, | 
					
						
							|  |  |  |                 overloaded_constructor> > > | 
					
						
							|  |  |  |             x; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace( | 
					
						
							|  |  |  |             std::piecewise_construct, std::make_tuple(), std::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor()) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor())->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace( | 
					
						
							|  |  |  |             convertible_to_piecewise(), std::make_tuple(1), std::make_tuple()); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         x.emplace(piecewise_rvalue(), std::make_tuple(2, 3), | 
					
						
							|  |  |  |             std::make_tuple(4, 5, 6)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(2, 3))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(4, 5, 6)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         derived_from_piecewise_construct_t d; | 
					
						
							|  |  |  |         x.emplace(d, std::make_tuple(9, 3, 1), std::make_tuple(10)); | 
					
						
							|  |  |  |         BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && | 
					
						
							|  |  |  |                    x.find(overloaded_constructor(9, 3, 1))->second == | 
					
						
							|  |  |  |                        overloaded_constructor(10)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UNORDERED_AUTO_TEST(set_std_emplace_test2) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     boost::unordered_set< | 
					
						
							|  |  |  |         std::pair<overloaded_constructor, overloaded_constructor> > | 
					
						
							|  |  |  |         x; | 
					
						
							|  |  |  |     std::pair<overloaded_constructor, overloaded_constructor> check; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.emplace(std::piecewise_construct, std::make_tuple(), std::make_tuple()); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     x.clear(); | 
					
						
							|  |  |  |     x.emplace( | 
					
						
							|  |  |  |         std::piecewise_construct, std::make_tuple(1), std::make_tuple(2, 3)); | 
					
						
							|  |  |  |     check = | 
					
						
							|  |  |  |         std::make_pair(overloaded_constructor(1), overloaded_constructor(2, 3)); | 
					
						
							|  |  |  |     BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2008-04-17 07:39:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | RUN_TESTS() |