diff --git a/hash/doc/changes.qbk b/hash/doc/changes.qbk new file mode 100644 index 0000000..5ca422d --- /dev/null +++ b/hash/doc/changes.qbk @@ -0,0 +1,27 @@ +[section:changes Change Log] + +[h2 Boost 1.33.0] + +* Initial Release + +[h2 Changes in Boost 1.33.1] + +* Fixed the points example, as pointed out by 沈慧峰. + +[h2 Changes in Boost 1.34.0] + +* Use declarations for standard classes, so that the library + doesn't need to include all of their headers +* Deprecated the `` headers. Now a single header, + `` is used. +* Add support for the BOOST_HASH_NO_EXTENSIONS macro, which + disables the extensions to TR1 +* Minor improvements to the hash functions for floating point numbers. + +[h2 Future Developments] + +* A more portable hash function, as described by Daniel Krügler in + [@http://lists.boost.org/boost-users/2005/08/13418.php a post to the boost users list]. +* Implement `hash_value` for more classes, including `std::complex`. + +[endsect] diff --git a/hash/doc/hash.qbk b/hash/doc/hash.qbk index 04b86fa..611ba73 100644 --- a/hash/doc/hash.qbk +++ b/hash/doc/hash.qbk @@ -17,6 +17,7 @@ [include:hash intro.qbk] [include:hash tutorial.qbk] [include:hash portability.qbk] +[include:hash changes.qbk] [xinclude ref.xml] [include:hash links.qbk] [include:hash thanks.qbk] diff --git a/hash/doc/portability.qbk b/hash/doc/portability.qbk index f0eb333..ef3d977 100644 --- a/hash/doc/portability.qbk +++ b/hash/doc/portability.qbk @@ -1,12 +1,14 @@ [section:portability Portability] -[classref boost::hash] is written to be as portable as possible, but unfortunately, several +[def __boost_hash__ [classref boost::hash]] + +__boost_hash__ is written to be as portable as possible, but unfortunately, several older compilers don't support argument dependent lookup (ADL) - the mechanism -used for customization. On those compilers custom overloads for hash_value +used for customisation. On those compilers custom overloads for hash_value need to be declared in the boost namespace. On a strictly standards compliant compiler, an overload defined in the -boost namespace won't be found when [classref boost::hash] is instantiated, +boost namespace won't be found when __boost_hash__ is instantiated, so for these compilers the overload should only be declared in the same namespace as the class. @@ -23,7 +25,7 @@ Let's say we have a simple custom type: friend std::size_t hash_value(custom_type x) { - [classref boost::hash] hasher; + __boost_hash__ hasher; return hasher(x.value); } }; @@ -48,7 +50,7 @@ So first move the member function out of the class: std::size_t hash(custom_type x) { - [classref boost::hash] hasher; + __boost_hash__ hasher; return hasher(value); } }; @@ -62,7 +64,7 @@ So first move the member function out of the class: Unfortunately, I couldn't declare hash_value as a friend, as some compilers don't support template friends, so instead I declared a member function to -calculate the hash, can called it from hash_value. +calculate the hash, and called it from hash_value. For compilers which don't support ADL, hash_value needs to be defined in the boost namespace: @@ -86,13 +88,13 @@ Full code for this example is at [h2 Other Issues] On Visual C++ versions 6.5 and 7.0, `hash_value` isn't overloaded for built in -arrays. [classref boost::hash], [funcref boost::hash_combine] and [funcref boost::hash_range] all use a workaround to +arrays. __boost_hash__, [funcref boost::hash_combine] and [funcref boost::hash_range] all use a workaround to support built in arrays so this shouldn't be a problem in most cases. On Visual C++ versions 6.5 and 7.0, function pointers aren't currently supported. When using GCC on Solaris, `boost::hash_value(long double)` treats -`long double`s as doubles - so the hash function doesn't take into account the +`long double`s as `double`s - so the hash function doesn't take into account the full range of values. [endsect] diff --git a/hash/doc/thanks.qbk b/hash/doc/thanks.qbk index 603e66b..aa37aa7 100644 --- a/hash/doc/thanks.qbk +++ b/hash/doc/thanks.qbk @@ -1,17 +1,22 @@ [section:acknowledgements Acknowledgements] -This library is based on the design by Peter Dimov. During the inital development +This library is based on the design by Peter Dimov. During the initial +development Joaquín M López Muñoz made many useful suggestions and contributed fixes. -The review was managed by Thorsten Ottosen, and the library reviewed by: +The formal review was managed by Thorsten Ottosen, and the library reviewed by: David Abrahams, Alberto Barbati, Topher Cooper, Caleb Epstein, Dave Harris, -Chris Jefferson, Bronek Kozicki, John Maddock, Tobias Swinger,Jaap Suter -and Rob Stewart. +Chris Jefferson, Bronek Kozicki, John Maddock, Tobias Swinger, Jaap Suter, +Rob Stewart and Pavel Vozenilek. Since then, further constructive criticism has +been made by Daniel Krügler, Alexander Nasonov and 沈慧峰. The implementation of the hash function for pointers is based on suggestions made by Alberto Barbati and Dave Harris. Dave Harris also suggested an important improvement to [funcref boost::hash_combine] that was taken up. +Some useful improvements to the floating point hash algorithm were suggested +by Daniel Krügler. + The original implementation came from Jeremy B. Maitin-Shepard's hash table library, although this is a complete rewrite.