From bbfb6fd32c405b18527f615be6c7d6c455ce5780 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 10 Jul 2010 13:47:47 +0000 Subject: [PATCH] Release notes for hash. [SVN r63810] --- doc/changes.qbk | 8 ++++++++ include/boost/functional/hash/hash.hpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/doc/changes.qbk b/doc/changes.qbk index 4e0d0a9..bc6f4ca 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -106,4 +106,12 @@ Avoid hashing 0.5 and 0 to the same number. * Stop using deprecated `BOOST_HAS_*` macros. +[h2 Boost 1.44.0] + +* Prevent implicit conversions when calling `hash_value`. If you find + that the new version breaks your code, you can enable the old + behaviour by defining `BOOST_HASH_ALLOW_IMPLICIT_CASTS` - although + I would recommend that you update your code to work with the new + version. + [endsect] diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index bd8d37f..54407d6 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -30,6 +30,8 @@ namespace boost { +#if !defined(BOOST_HASH_ALLOW_IMPLICIT_CASTS) + // If you get a static assertion here, it's because hash_value // isn't declared for your type. template @@ -38,6 +40,8 @@ namespace boost return 0; } +#endif + std::size_t hash_value(bool); std::size_t hash_value(char); std::size_t hash_value(unsigned char);