mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 14:04:27 +02:00
Add a list of changes to the hash library documentation, update the
acknowledgements, and fix a few typos. [SVN r33264]
This commit is contained in:
27
hash/doc/changes.qbk
Normal file
27
hash/doc/changes.qbk
Normal file
@@ -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 `<boost/functional/hash/*.hpp>` headers. Now a single header,
|
||||||
|
`<boost/functional/hash.hpp>` 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]
|
@@ -17,6 +17,7 @@
|
|||||||
[include:hash intro.qbk]
|
[include:hash intro.qbk]
|
||||||
[include:hash tutorial.qbk]
|
[include:hash tutorial.qbk]
|
||||||
[include:hash portability.qbk]
|
[include:hash portability.qbk]
|
||||||
|
[include:hash changes.qbk]
|
||||||
[xinclude ref.xml]
|
[xinclude ref.xml]
|
||||||
[include:hash links.qbk]
|
[include:hash links.qbk]
|
||||||
[include:hash thanks.qbk]
|
[include:hash thanks.qbk]
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
[section:portability Portability]
|
[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
|
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.
|
need to be declared in the boost namespace.
|
||||||
|
|
||||||
On a strictly standards compliant compiler, an overload defined in the
|
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
|
so for these compilers the overload should only be declared in the same
|
||||||
namespace as the class.
|
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)
|
friend std::size_t hash_value(custom_type x)
|
||||||
{
|
{
|
||||||
[classref boost::hash]<int> hasher;
|
__boost_hash__<int> hasher;
|
||||||
return hasher(x.value);
|
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)
|
std::size_t hash(custom_type x)
|
||||||
{
|
{
|
||||||
[classref boost::hash]<T> hasher;
|
__boost_hash__<T> hasher;
|
||||||
return hasher(value);
|
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
|
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
|
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
|
For compilers which don't support ADL, hash_value needs to be defined in the
|
||||||
boost namespace:
|
boost namespace:
|
||||||
@@ -86,13 +88,13 @@ Full code for this example is at
|
|||||||
[h2 Other Issues]
|
[h2 Other Issues]
|
||||||
|
|
||||||
On Visual C++ versions 6.5 and 7.0, `hash_value` isn't overloaded for built in
|
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.
|
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.
|
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
|
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.
|
full range of values.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
@@ -1,17 +1,22 @@
|
|||||||
[section:acknowledgements Acknowledgements]
|
[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.
|
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,
|
David Abrahams, Alberto Barbati, Topher Cooper, Caleb Epstein, Dave Harris,
|
||||||
Chris Jefferson, Bronek Kozicki, John Maddock, Tobias Swinger,Jaap Suter
|
Chris Jefferson, Bronek Kozicki, John Maddock, Tobias Swinger, Jaap Suter,
|
||||||
and Rob Stewart.
|
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
|
The implementation of the hash function for pointers is based on suggestions
|
||||||
made by Alberto Barbati and Dave Harris. Dave Harris also suggested an
|
made by Alberto Barbati and Dave Harris. Dave Harris also suggested an
|
||||||
important improvement to [funcref boost::hash_combine] that was taken up.
|
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
|
The original implementation came from Jeremy B. Maitin-Shepard's hash table
|
||||||
library, although this is a complete rewrite.
|
library, although this is a complete rewrite.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user