From faf8d3f1b6074810705e2ddfdad67b6d2a74ffa8 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 26 May 2025 19:03:12 +0200 Subject: [PATCH 01/11] added hash_is_avalanching --- doc/hash/changes.adoc | 3 + doc/hash/reference.adoc | 58 +++++++++++++++++- include/boost/container_hash/hash.hpp | 10 +-- include/boost/container_hash/hash_fwd.hpp | 3 +- .../container_hash/hash_is_avalanching.hpp | 61 +++++++++++++++++++ test/hash_is_avalanching_test.cpp | 28 ++++++++- test/hash_is_avalanching_test2.cpp | 5 +- 7 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 include/boost/container_hash/hash_is_avalanching.hpp diff --git a/doc/hash/changes.adoc b/doc/hash/changes.adoc index 1f8109da..da755da6 100644 --- a/doc/hash/changes.adoc +++ b/doc/hash/changes.adoc @@ -12,6 +12,9 @@ https://www.boost.org/LICENSE_1_0.txt :int128: __int128 +== Boost 1.89.0 +* Added the `hash_is_avalanching` trait class. + == Boost 1.67.0 * Moved library into its own module, `container_hash`. * Moved headers for new module name, now at: ``, ``, ``. diff --git a/doc/hash/reference.adoc b/doc/hash/reference.adoc index a8d2889b..97219555 100644 --- a/doc/hash/reference.adoc +++ b/doc/hash/reference.adoc @@ -1,7 +1,7 @@ //// Copyright 2005-2008 Daniel James Copyright 2022 Christian Mazakas -Copyright 2022 Peter Dimov +Copyright 2022, 2025 Peter Dimov Distributed under the Boost Software License, Version 1.0. https://www.boost.org/LICENSE_1_0.txt //// @@ -26,6 +26,7 @@ namespace boost namespace container_hash { +template struct hash_is_avalanching; template struct is_range; template struct is_contiguous_range; template struct is_unordered_range; @@ -572,6 +573,61 @@ where `x` is the currently contained value in `v`. Throws: :: `std::bad_variant_access` when `v.valueless_by_exception()` is `true`. +== + +Defines the trait `boost::container_hash::hash_is_avalanching`. + +[source] +---- +namespace boost +{ + +namespace container_hash +{ + +template struct hash_is_avalanching; + +} // namespace container_hash + +} // namespace boost +---- + +=== hash_is_avalanching + +[source] +---- +template struct hash_is_avalanching +{ + static constexpr bool value = /* see below */; +}; +---- + +`hash_is_avalanching::value` is: + +* `false` if `Hash::is_avalanching` is not present, +* `Hash::is_avalanching::value` if this is present and convertible at compile time to a `bool`, +* `true` if `Hash::is_avalanching` is `void` (this usage is deprecated), +* ill-formed otherwise. + +A hash function is said to have the _avalanching property_ if small changes +in the input translate to large changes in the returned hash code +—ideally, flipping one bit in the representation of the input value results +in each bit of the hash code flipping with probability 50%. Libraries +such as link:../../../unordered/index.html[Boost.Unordered] consult this trait +to determine if the supplied hash function is of high quality. +`boost::hash` for `std::basic_string` and `std::basic_string_view` +has this trait set to `true` when `Ch` is an integral type (this includes +`std::string` and `std::string_view`, among others). +Users can set this this trait for a particular `Hash` type by: + +* Inserting the nested `is_avalanching` typedef in the class definition +if they have access to its source code. +* Writing a specialization of `boost::container_hash::hash_is_avalanching` +for `Hash`. + +Note that usage of this trait is not restricted to hash functions produced +with Boost.ContainerHash. + == Defines the trait `boost::container_hash::is_range`. diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index 8305a22c..e8dc1542 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -1,5 +1,5 @@ // Copyright 2005-2014 Daniel James. -// Copyright 2021, 2022 Peter Dimov. +// Copyright 2021, 2022, 2025 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt @@ -11,6 +11,7 @@ #define BOOST_FUNCTIONAL_HASH_HASH_HPP #include +#include #include #include #include @@ -557,11 +558,10 @@ namespace boost #endif - // boost::unordered::hash_is_avalanching + // hash_is_avalanching - namespace unordered + namespace container_hash { - template struct hash_is_avalanching; template struct hash_is_avalanching< boost::hash< std::basic_string > >: std::is_integral {}; #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) @@ -569,7 +569,7 @@ namespace boost template struct hash_is_avalanching< boost::hash< std::basic_string_view > >: std::is_integral {}; #endif - } // namespace unordered + } // namespace container_hash } // namespace boost diff --git a/include/boost/container_hash/hash_fwd.hpp b/include/boost/container_hash/hash_fwd.hpp index 32388ac5..f0ff68dd 100644 --- a/include/boost/container_hash/hash_fwd.hpp +++ b/include/boost/container_hash/hash_fwd.hpp @@ -1,5 +1,5 @@ // Copyright 2005-2009 Daniel James. -// Copyright 2021, 2022 Peter Dimov. +// Copyright 2021, 2022, 2025 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt @@ -14,6 +14,7 @@ namespace boost namespace container_hash { +template struct hash_is_avalanching; template struct is_range; template struct is_contiguous_range; template struct is_unordered_range; diff --git a/include/boost/container_hash/hash_is_avalanching.hpp b/include/boost/container_hash/hash_is_avalanching.hpp new file mode 100644 index 00000000..8e1af8b0 --- /dev/null +++ b/include/boost/container_hash/hash_is_avalanching.hpp @@ -0,0 +1,61 @@ +// Copyright 2025 Joaquin M Lopez Munoz. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED +#define BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED + +#include + +namespace boost +{ +namespace hash_detail +{ + +template struct make_void +{ + using type = void; +}; + +template using void_t = typename make_void::type; + +template struct avalanching_value +{ + static constexpr bool value = IsAvalanching::value; +}; + +// may be explicitly marked as BOOST_DEPRECATED in the future +template<> struct avalanching_value +{ + static constexpr bool value = true; +}; + +template struct hash_is_avalanching_impl: std::false_type +{ +}; + +template struct hash_is_avalanching_impl >: + std::integral_constant::value> +{ +}; + +template +struct hash_is_avalanching_impl::type> +{ + // Hash::is_avalanching is not a type: we don't define value to produce + // compile error downstream +}; + +} // namespace hash_detail + +namespace container_hash +{ + +template struct hash_is_avalanching: hash_detail::hash_is_avalanching_impl::type +{ +}; + +} // namespace container_hash +} // namespace boost + +#endif // #ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED diff --git a/test/hash_is_avalanching_test.cpp b/test/hash_is_avalanching_test.cpp index c31c56b8..ffc8d950 100644 --- a/test/hash_is_avalanching_test.cpp +++ b/test/hash_is_avalanching_test.cpp @@ -1,18 +1,35 @@ -// Copyright 2022 Peter Dimov. +// Copyright 2022, 2025 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include +#include #include -#include #include +#include #include +#include enum my_char { min = 0, max = 255 }; +struct X +{ + using is_avalanching = void; +}; + +struct Y +{ + using is_avalanching = std::true_type; +}; + +struct Z +{ + using is_avalanching = std::false_type; +}; + int main() { - using boost::unordered::hash_is_avalanching; + using boost::container_hash::hash_is_avalanching; BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); @@ -41,5 +58,10 @@ int main() BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< boost::hash > > )); #endif + BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< std::hash > )); + BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > )); + BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > )); + BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< Z > )); + return boost::report_errors(); } diff --git a/test/hash_is_avalanching_test2.cpp b/test/hash_is_avalanching_test2.cpp index 8d478345..77eabfb5 100644 --- a/test/hash_is_avalanching_test2.cpp +++ b/test/hash_is_avalanching_test2.cpp @@ -1,8 +1,9 @@ -// Copyright 2022 Peter Dimov. +// Copyright 2022, 2025 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include +#include #include #include #include @@ -21,7 +22,7 @@ enum my_char { min = 0, max = 255 }; int main() { - using boost::unordered::hash_is_avalanching; + using boost::container_hash::hash_is_avalanching; BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); From 1edce2b01cba457dc9393a30f80c109538b9823d Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 26 May 2025 19:04:14 +0200 Subject: [PATCH 02/11] launched CI after enabling GHA From 9534e52d1a9345bddc4c33a59db6d81bba598b24 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 26 May 2025 19:20:09 +0200 Subject: [PATCH 03/11] moved 1.89 entry from Change Log to Recent Changes --- doc/hash/changes.adoc | 3 --- doc/hash/recent.adoc | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/hash/changes.adoc b/doc/hash/changes.adoc index da755da6..1f8109da 100644 --- a/doc/hash/changes.adoc +++ b/doc/hash/changes.adoc @@ -12,9 +12,6 @@ https://www.boost.org/LICENSE_1_0.txt :int128: __int128 -== Boost 1.89.0 -* Added the `hash_is_avalanching` trait class. - == Boost 1.67.0 * Moved library into its own module, `container_hash`. * Moved headers for new module name, now at: ``, ``, ``. diff --git a/doc/hash/recent.adoc b/doc/hash/recent.adoc index ef3a2e3a..7c18492b 100644 --- a/doc/hash/recent.adoc +++ b/doc/hash/recent.adoc @@ -8,6 +8,10 @@ https://www.boost.org/LICENSE_1_0.txt = Recent Changes :idprefix: recent_ +== Boost 1.89.0 + +* Added the `hash_is_avalanching` trait class. + == Boost 1.84.0 * {cpp}03 is no longer supported. From 0102ea6b50efcb73f5e327adac80c504554b10af Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 09:09:08 +0200 Subject: [PATCH 04/11] segregated some tests into hash_is_avalanching_test3.cpp and gotten rid of Unordered dependency --- test/CMakeLists.txt | 4 ++-- test/Jamfile.v2 | 9 ++++---- test/hash_is_avalanching_test.cpp | 21 ----------------- test/hash_is_avalanching_test3.cpp | 36 ++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 test/hash_is_avalanching_test3.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 30b3ec75..8f2b9785 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2018, 2019, 2021, 2022 Peter Dimov +# Copyright 2018, 2019, 2021, 2022, 2025 Peter Dimov # 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 @@ -7,6 +7,6 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) if(HAVE_BOOST_TEST) boost_test_jamfile(FILE Jamfile.v2 - LINK_LIBRARIES Boost::container_hash Boost::core Boost::utility Boost::unordered) + LINK_LIBRARIES Boost::container_hash Boost::core Boost::utility) endif() diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c415e9d6..596c478b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,5 +1,5 @@ # Copyright 2005-2012 Daniel James. -# Copyright 2022 Peter Dimov +# Copyright 2022, 2025 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt @@ -119,10 +119,9 @@ run is_described_class_test3.cpp run described_class_test.cpp : : : extra ; -run hash_is_avalanching_test.cpp - /boost/unordered//boost_unordered ; -run hash_is_avalanching_test2.cpp - /boost/unordered//boost_unordered ; +run hash_is_avalanching_test.cpp ; +run hash_is_avalanching_test2.cpp ; +run hash_is_avalanching_test3.cpp ; run hash_integral_test2.cpp ; diff --git a/test/hash_is_avalanching_test.cpp b/test/hash_is_avalanching_test.cpp index ffc8d950..7ad60b93 100644 --- a/test/hash_is_avalanching_test.cpp +++ b/test/hash_is_avalanching_test.cpp @@ -6,27 +6,11 @@ #include #include #include -#include #include #include enum my_char { min = 0, max = 255 }; -struct X -{ - using is_avalanching = void; -}; - -struct Y -{ - using is_avalanching = std::true_type; -}; - -struct Z -{ - using is_avalanching = std::false_type; -}; - int main() { using boost::container_hash::hash_is_avalanching; @@ -58,10 +42,5 @@ int main() BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< boost::hash > > )); #endif - BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< std::hash > )); - BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > )); - BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > )); - BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< Z > )); - return boost::report_errors(); } diff --git a/test/hash_is_avalanching_test3.cpp b/test/hash_is_avalanching_test3.cpp new file mode 100644 index 00000000..5ca607e1 --- /dev/null +++ b/test/hash_is_avalanching_test3.cpp @@ -0,0 +1,36 @@ +// Copyright 2025 Joaquin M Lopez Munoz. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include +#include +#include + +struct X +{ + using is_avalanching = void; +}; + +struct Y +{ + using is_avalanching = std::true_type; +}; + +struct Z +{ + using is_avalanching = std::false_type; +}; + +int main() +{ + using boost::container_hash::hash_is_avalanching; + + BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< std::hash > )); + BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > )); + BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > )); + BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< Z > )); + + return boost::report_errors(); +} From d5ff30a6049dc0548806343140e2678318ab3bf5 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 09:10:39 +0200 Subject: [PATCH 05/11] removed unneeded include --- test/hash_is_avalanching_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/hash_is_avalanching_test.cpp b/test/hash_is_avalanching_test.cpp index 7ad60b93..316f8c56 100644 --- a/test/hash_is_avalanching_test.cpp +++ b/test/hash_is_avalanching_test.cpp @@ -7,7 +7,6 @@ #include #include #include -#include enum my_char { min = 0, max = 255 }; From aceb3aed65af7eaf4abdeb2ab7313d79d0a7a357 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 10:38:36 +0200 Subject: [PATCH 06/11] stopped using external std::hash for testing --- test/hash_is_avalanching_test3.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hash_is_avalanching_test3.cpp b/test/hash_is_avalanching_test3.cpp index 5ca607e1..b58fad24 100644 --- a/test/hash_is_avalanching_test3.cpp +++ b/test/hash_is_avalanching_test3.cpp @@ -4,8 +4,6 @@ #include #include -#include -#include #include struct X @@ -23,14 +21,18 @@ struct Z using is_avalanching = std::false_type; }; +struct W +{ +}; + int main() { using boost::container_hash::hash_is_avalanching; - BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< std::hash > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > )); BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< Z > )); + BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< W > )); return boost::report_errors(); } From fdf6ad98c95dcf4a8affb7e46ea013c2128e6df0 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 10:52:07 +0200 Subject: [PATCH 07/11] typo --- doc/hash/reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/hash/reference.adoc b/doc/hash/reference.adoc index 97219555..2e2a165f 100644 --- a/doc/hash/reference.adoc +++ b/doc/hash/reference.adoc @@ -618,7 +618,7 @@ to determine if the supplied hash function is of high quality. `boost::hash` for `std::basic_string` and `std::basic_string_view` has this trait set to `true` when `Ch` is an integral type (this includes `std::string` and `std::string_view`, among others). -Users can set this this trait for a particular `Hash` type by: +Users can set this trait for a particular `Hash` type by: * Inserting the nested `is_avalanching` typedef in the class definition if they have access to its source code. From 8286891ff3dc55d245001a5f5f84c6740f68b034 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 11:20:15 +0200 Subject: [PATCH 08/11] removed left over include --- test/hash_is_avalanching_test2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/hash_is_avalanching_test2.cpp b/test/hash_is_avalanching_test2.cpp index 77eabfb5..f5b74da1 100644 --- a/test/hash_is_avalanching_test2.cpp +++ b/test/hash_is_avalanching_test2.cpp @@ -15,7 +15,6 @@ int main() {} #else -#include #include enum my_char { min = 0, max = 255 }; From 3cfa6cfe6404ce361feee03ba670eb74635ecc67 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 11:27:26 +0200 Subject: [PATCH 09/11] typo --- include/boost/container_hash/hash_is_avalanching.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/container_hash/hash_is_avalanching.hpp b/include/boost/container_hash/hash_is_avalanching.hpp index 8e1af8b0..e5babb67 100644 --- a/include/boost/container_hash/hash_is_avalanching.hpp +++ b/include/boost/container_hash/hash_is_avalanching.hpp @@ -43,7 +43,7 @@ template struct hash_is_avalanching_impl::type> { // Hash::is_avalanching is not a type: we don't define value to produce - // compile error downstream + // a compile error downstream }; } // namespace hash_detail From 3d3ff1edbf2ef03c9ccd43c56c913f068c0b1d08 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 16:19:10 +0200 Subject: [PATCH 10/11] moved hash_is_avalanching from boost::container_hash to boost --- doc/hash/reference.adoc | 12 ++++-------- include/boost/container_hash/hash_fwd.hpp | 3 ++- include/boost/container_hash/hash_is_avalanching.hpp | 4 ---- test/hash_is_avalanching_test.cpp | 2 +- test/hash_is_avalanching_test2.cpp | 2 +- test/hash_is_avalanching_test3.cpp | 2 +- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/doc/hash/reference.adoc b/doc/hash/reference.adoc index 2e2a165f..b5afe0d8 100644 --- a/doc/hash/reference.adoc +++ b/doc/hash/reference.adoc @@ -26,7 +26,6 @@ namespace boost namespace container_hash { -template struct hash_is_avalanching; template struct is_range; template struct is_contiguous_range; template struct is_unordered_range; @@ -45,6 +44,8 @@ template std::size_t hash_range( It first, It last ); template void hash_unordered_range( std::size_t& seed, It first, It last ); template std::size_t hash_unordered_range( It first, It last ); +template struct hash_is_avalanching; + } // namespace boost ---- @@ -575,20 +576,15 @@ Throws: :: == -Defines the trait `boost::container_hash::hash_is_avalanching`. +Defines the trait `boost::hash_is_avalanching`. [source] ---- namespace boost { -namespace container_hash -{ - template struct hash_is_avalanching; -} // namespace container_hash - } // namespace boost ---- @@ -622,7 +618,7 @@ Users can set this trait for a particular `Hash` type by: * Inserting the nested `is_avalanching` typedef in the class definition if they have access to its source code. -* Writing a specialization of `boost::container_hash::hash_is_avalanching` +* Writing a specialization of `boost::hash_is_avalanching` for `Hash`. Note that usage of this trait is not restricted to hash functions produced diff --git a/include/boost/container_hash/hash_fwd.hpp b/include/boost/container_hash/hash_fwd.hpp index f0ff68dd..1f2a37a7 100644 --- a/include/boost/container_hash/hash_fwd.hpp +++ b/include/boost/container_hash/hash_fwd.hpp @@ -14,7 +14,6 @@ namespace boost namespace container_hash { -template struct hash_is_avalanching; template struct is_range; template struct is_contiguous_range; template struct is_unordered_range; @@ -33,6 +32,8 @@ template std::size_t hash_range( It, It ); template void hash_unordered_range( std::size_t&, It, It ); template std::size_t hash_unordered_range( It, It ); +template struct hash_is_avalanching; + } // namespace boost #endif // #ifndef BOOST_FUNCTIONAL_HASH_FWD_HPP diff --git a/include/boost/container_hash/hash_is_avalanching.hpp b/include/boost/container_hash/hash_is_avalanching.hpp index e5babb67..65c70590 100644 --- a/include/boost/container_hash/hash_is_avalanching.hpp +++ b/include/boost/container_hash/hash_is_avalanching.hpp @@ -48,14 +48,10 @@ struct hash_is_avalanching_impl struct hash_is_avalanching: hash_detail::hash_is_avalanching_impl::type { }; -} // namespace container_hash } // namespace boost #endif // #ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED diff --git a/test/hash_is_avalanching_test.cpp b/test/hash_is_avalanching_test.cpp index 316f8c56..d3024ac3 100644 --- a/test/hash_is_avalanching_test.cpp +++ b/test/hash_is_avalanching_test.cpp @@ -12,7 +12,7 @@ enum my_char { min = 0, max = 255 }; int main() { - using boost::container_hash::hash_is_avalanching; + using boost::hash_is_avalanching; BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); diff --git a/test/hash_is_avalanching_test2.cpp b/test/hash_is_avalanching_test2.cpp index f5b74da1..66230d07 100644 --- a/test/hash_is_avalanching_test2.cpp +++ b/test/hash_is_avalanching_test2.cpp @@ -21,7 +21,7 @@ enum my_char { min = 0, max = 255 }; int main() { - using boost::container_hash::hash_is_avalanching; + using boost::hash_is_avalanching; BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash > )); diff --git a/test/hash_is_avalanching_test3.cpp b/test/hash_is_avalanching_test3.cpp index b58fad24..f0dda80e 100644 --- a/test/hash_is_avalanching_test3.cpp +++ b/test/hash_is_avalanching_test3.cpp @@ -27,7 +27,7 @@ struct W int main() { - using boost::container_hash::hash_is_avalanching; + using boost::hash_is_avalanching; BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > )); From 8b45f18cc9ca58df92b8e773962e751cd53c6b72 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 27 May 2025 16:25:29 +0200 Subject: [PATCH 11/11] fixed specializations of boost::hash_is_avalanching --- include/boost/container_hash/hash.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index e8dc1542..1fe3f2f9 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -560,16 +560,13 @@ namespace boost // hash_is_avalanching - namespace container_hash - { - template struct hash_is_avalanching< boost::hash< std::basic_string > >: std::is_integral {}; + template struct hash_is_avalanching< boost::hash< std::basic_string > >: std::is_integral {}; #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) - template struct hash_is_avalanching< boost::hash< std::basic_string_view > >: std::is_integral {}; + template struct hash_is_avalanching< boost::hash< std::basic_string_view > >: std::is_integral {}; #endif - } // namespace container_hash } // namespace boost