| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Merge hash and unordered changes.
Remove deprecated headers, move hash_fwd.hpp into hash subdirectory. And
several minor internal changes.
Mostly minor internal details.
Merged revisions 51262-51263,51407-51409,51504-51505,51644-51646,51667 via svnmerge from 
https://svn.boost.org/svn/boost/trunk
........
  r51262 | danieljames | 2009-02-15 19:32:04 +0000 (Sun, 15 Feb 2009) | 1 line
  
  Use the new 'boost:' links for the hash, unordered and quickbook documentation.
........
  r51263 | danieljames | 2009-02-15 19:32:19 +0000 (Sun, 15 Feb 2009) | 2 lines
  
  Don't copy images for the standalone hash and unordered documentation, was only
  really required before the libraries were integrated into boost.
........
  r51407 | danieljames | 2009-02-22 23:49:51 +0000 (Sun, 22 Feb 2009) | 1 line
  
  Fix the hash dirname.
........
  r51408 | danieljames | 2009-02-22 23:50:04 +0000 (Sun, 22 Feb 2009) | 1 line
  
  Make copy_buckets and move_buckets member functions - so that calling them is a bit simpler.
........
  r51409 | danieljames | 2009-02-22 23:50:20 +0000 (Sun, 22 Feb 2009) | 1 line
  
  Move some of the data structure classes out of hash table data.
........
  r51504 | danieljames | 2009-03-01 14:15:09 +0000 (Sun, 01 Mar 2009) | 1 line
  
  Add missing return for operator=.
........
  r51505 | danieljames | 2009-03-01 14:15:39 +0000 (Sun, 01 Mar 2009) | 3 lines
  
  Make the sort stable.
  
  Doesn't really matter, but it might as well be.
........
  r51644 | danieljames | 2009-03-08 09:44:51 +0000 (Sun, 08 Mar 2009) | 1 line
  
  Detab.
........
  r51645 | danieljames | 2009-03-08 09:45:11 +0000 (Sun, 08 Mar 2009) | 4 lines
  
  Move hash_fwd into the hash subdirectory.
  
  I should have done this in the last release. But now all of the hash
  implementation is in the hash subdirectory.
........
  r51646 | danieljames | 2009-03-08 09:45:30 +0000 (Sun, 08 Mar 2009) | 3 lines
  
  Remove deprecated headers.
  
  Fixes #2412.
........
  r51667 | danieljames | 2009-03-09 20:56:23 +0000 (Mon, 09 Mar 2009) | 1 line
  
  Update copyright dates in hash and unordered.
........
[SVN r51729]
											
										 
											2009-03-11 22:51:09 +00:00
										 |  |  | // Copyright 2005-2009 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-01 21:24:48 +00:00
										 |  |  | // This uses std::rand to generate random values for tests.
 | 
					
						
							|  |  |  | // Which is not good as different platforms will be running different tests.
 | 
					
						
							|  |  |  | // It would be much better to use Boost.Random, but it doesn't
 | 
					
						
							|  |  |  | // support all the compilers that I want to test on.
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #if !defined(BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER)
 | 
					
						
							|  |  |  | #define BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <string>
 | 
					
						
							|  |  |  | #include <utility>
 | 
					
						
							| 
									
										
										
										
											2006-10-31 22:19:26 +00:00
										 |  |  | #include <stdexcept>
 | 
					
						
							| 
									
										
										
										
											2007-05-01 21:24:48 +00:00
										 |  |  | #include <cstdlib>
 | 
					
						
							| 
									
										
										
										
											2008-01-10 22:30:46 +00:00
										 |  |  | #include <boost/type_traits/add_const.hpp>
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | #include "./fwd.hpp"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace test | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2007-12-06 11:42:28 +00:00
										 |  |  |     struct seed_t { | 
					
						
							|  |  |  |         seed_t(unsigned int x) { | 
					
						
							|  |  |  |             using namespace std; | 
					
						
							|  |  |  |             srand(x); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     inline int generate(int const*) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2007-05-01 21:24:48 +00:00
										 |  |  |         using namespace std; | 
					
						
							|  |  |  |         return rand(); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     inline char generate(char const*) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2007-05-01 21:24:48 +00:00
										 |  |  |         using namespace std; | 
					
						
							| 
									
										
											  
											
												Merged revisions 41808-41821,41823-41927,41934-41942,41944-41950,41952-41993,41998-42091,42094-42095,42104-42105,42107,42109,42111-42152,42154,42160-42171,42173-42180,42183-42196,42198-42402 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/dev
........
  r41993 | danieljames | 2007-12-13 00:23:27 +0000 (Thu, 13 Dec 2007) | 3 lines
  
  Add the hash documentation to the unordered library so that it'll be easier to
  link between the libraries.
........
  r42104 | danieljames | 2007-12-16 13:36:50 +0000 (Sun, 16 Dec 2007) | 1 line
  
  Don't include any hash source in tarballs (although I'm including the documentation).
........
  r42198 | danieljames | 2007-12-20 10:49:10 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Restore the extra warnings in the unit tests.
........
  r42199 | danieljames | 2007-12-20 11:25:38 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Make a cast explicit in order to avoid a warning.
........
  r42203 | danieljames | 2007-12-20 15:54:31 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Use 'BOOST_UNORDERED' prefix for macros.
........
  r42209 | danieljames | 2007-12-20 19:41:17 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Initialise this branch (hopefully..)
........
  r42210 | danieljames | 2007-12-20 19:51:21 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Merge in changes.
........
  r42215 | danieljames | 2007-12-20 21:15:42 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Don't add size_type to pointers, cast to difference_type.
........
  r42216 | danieljames | 2007-12-20 21:17:38 +0000 (Thu, 20 Dec 2007) | 1 line
  
  I messed up the last commit, this fixes it.
........
  r42218 | danieljames | 2007-12-20 21:22:20 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Get rid of last_in_group.
........
  r42219 | danieljames | 2007-12-20 21:27:46 +0000 (Thu, 20 Dec 2007) | 1 line
  
  Use node_count to implement group_count.
........
  r42231 | danieljames | 2007-12-21 12:04:52 +0000 (Fri, 21 Dec 2007) | 1 line
  
  Some minor changes for Visual C++.
........
  r42233 | danieljames | 2007-12-21 19:41:27 +0000 (Fri, 21 Dec 2007) | 1 line
  
  Inline some more methods.
........
  r42335 | danieljames | 2007-12-29 13:14:45 +0000 (Sat, 29 Dec 2007) | 3 lines
  
  Some of the changes to the introduction mention in the review. Hopefully this
  will make it a little clearer.
........
  r42336 | danieljames | 2007-12-29 13:16:55 +0000 (Sat, 29 Dec 2007) | 3 lines
  
  Try to make the buckets explanation a little easier to read. Most of the
  changes were based on Jamie Allsop (same for the last commit).
........
  r42339 | danieljames | 2007-12-29 16:00:32 +0000 (Sat, 29 Dec 2007) | 1 line
  
  Specify the namespace for 'std::out_of_range' in the reference documentation.
........
  r42345 | danieljames | 2007-12-29 20:41:10 +0000 (Sat, 29 Dec 2007) | 8 lines
  
  Rewrite much of the 'controlling the number of buckets' section.
  
  I'm trying to make it clearer. It's a bit tricky as the standard doesn't guarantee much.
  Instead of diving straight into the details I have tried to give the reader a rough
  idea of what 'rehash' does and what the load factor is. This is hopefully enough to
  understand the more detailled discussion of how you can control the number of buckets.
  Then finally I discuss iterator invalidation.
........
  r42346 | danieljames | 2007-12-29 20:52:22 +0000 (Sat, 29 Dec 2007) | 1 line
  
  Move the table summarizing methods for controlling bucket size next to the discussion of these methods. The paragraphs about insert and invalidating iterator moves on to something else.
........
  r42348 | danieljames | 2007-12-29 20:55:30 +0000 (Sat, 29 Dec 2007) | 1 line
  
  Fix the badly marked up bullet points.
........
  r42349 | danieljames | 2007-12-29 20:57:53 +0000 (Sat, 29 Dec 2007) | 2 lines
  
  We now have cbegin and cend for local iterators.
........
[SVN r42403]
											
										 
											2008-01-01 20:21:04 +00:00
										 |  |  |         return static_cast<char>((rand() >> 1) % (128-32) + 32); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-07-17 23:17:21 +00:00
										 |  |  |     inline signed char generate(signed char const*) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         using namespace std; | 
					
						
							| 
									
										
										
										
											2007-08-14 09:55:30 +00:00
										 |  |  |         return static_cast<signed char>(rand()); | 
					
						
							| 
									
										
										
										
											2007-07-17 23:17:21 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     inline std::string generate(std::string const*) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         using namespace std; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |         char* char_ptr = 0; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         std::string result; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         int length = rand() % 10; | 
					
						
							|  |  |  |         for(int i = 0; i < length; ++i) | 
					
						
							| 
									
										
										
										
											2008-01-20 18:55:57 +00:00
										 |  |  |             result += generate(char_ptr); | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         return result; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     float generate(float const*) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-01-08 18:15:01 +00:00
										 |  |  |         using namespace std; | 
					
						
							| 
									
										
										
										
											2007-05-01 21:24:48 +00:00
										 |  |  |         return (float) rand() / (float) RAND_MAX; | 
					
						
							| 
									
										
										
										
											2006-05-17 17:19:16 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |