From f2761964bd3b871793cada445392f6d17b2b4723 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 27 Jul 2014 18:00:14 +0100 Subject: [PATCH 1/2] The correct release notes. The ones I checked in were for unordered. --- doc/changes.qbk | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/changes.qbk b/doc/changes.qbk index b9d202b..5dc691f 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -170,11 +170,7 @@ [h2 Boost 1.56.0] -* Fix some shadowed variable warnings ([ticket 9377]). -* Fix allocator use in documentation ([ticket 9719]). -* Always use prime number of buckets for integers. Fixes performance - regression when inserting consecutive integers, although makes other - uses slower ([ticket 9282]). -* Only construct elements using allocators, as specified in C++11 standard. +* Removed some Visual C++ 6 workarounds. +* Ongoing work on improving `hash_combine`. [endsect] From 549196ca7df892653857872215076d4cf7ed3c16 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 28 Jul 2014 23:30:47 +0100 Subject: [PATCH 2/2] Update documentation for hash_combine. Also added some disclaimers for anyone who didn't notice the note in the introduction. --- doc/changes.qbk | 3 ++- doc/ref.xml | 30 +++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/changes.qbk b/doc/changes.qbk index 5dc691f..aadeb97 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -171,6 +171,7 @@ [h2 Boost 1.56.0] * Removed some Visual C++ 6 workarounds. -* Ongoing work on improving `hash_combine`. +* Ongoing work on improving `hash_combine`. This changes the combine function + which was previously defined in the reference documentation. [endsect] diff --git a/doc/ref.xml b/doc/ref.xml index d7c427c..5fcd43b 100644 --- a/doc/ref.xml +++ b/doc/ref.xml @@ -59,6 +59,11 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Forward declared in <boost/functional/hash_fwd.hpp> + + This hash function is not intended for general use, and isn't + guaranteed to be equal during separate runs of a program - so + please don't use it for any persistent storage or communication. + Only throws if @@ -450,7 +455,15 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Called repeatedly to incrementally create a hash value from several variables. - seed ^= hash_value(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + + Updates seed with a new hash value generated by + combining it with the result of + hash_value(v). Will + always produce the same result for the same combination of + seed and + hash_value(v) during + the single run of a program. + hash_value is called without qualification, so that overloads can be found via ADL. @@ -459,6 +472,11 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Forward declared in <boost/functional/hash_fwd.hpp> + + This hash function is not intended for general use, and isn't + guaranteed to be equal during separate runs of a program - so + please don't use it for any persistent storage or communication. + Only throws if hash_value(T) throws. @@ -527,6 +545,11 @@ for(; first != last; ++first) Forward declared in <boost/functional/hash_fwd.hpp> + + This hash function is not intended for general use, and isn't + guaranteed to be equal during separate runs of a program - so + please don't use it for any persistent storage or communication. + Only throws if hash_value(std::iterator_traits<It>::value_type) @@ -784,6 +807,11 @@ for(; first != last; ++first) This is an extension to TR1 + + This hash function is not intended for general use, and isn't + guaranteed to be equal during separate runs of a program - so + please don't use it for any persistent storage or communication. +