From 4adf3fcae4458de1ebb5cf2a143404a8632ccbfd Mon Sep 17 00:00:00 2001 From: alandefreitas Date: Mon, 11 Nov 2024 16:49:35 -0300 Subject: [PATCH] refactor(string_view_base): directly call boost::hash_range Since https://github.com/boostorg/core/commit/92f6cfb3ccf977b6a5c615ce174a9d94002b3b0d in Boost.Core, we have been getting "error: use of undeclared identifier 'hash_value'" because hash_value is not part of the interface of core::string_view. This commit implements the same strategy as previously used in Boost.Core to avoid breaking changes. --- include/boost/url/grammar/string_view_base.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/url/grammar/string_view_base.hpp b/include/boost/url/grammar/string_view_base.hpp index 9be943f3e..279cde7f1 100644 --- a/include/boost/url/grammar/string_view_base.hpp +++ b/include/boost/url/grammar/string_view_base.hpp @@ -20,6 +20,10 @@ #include namespace boost { + +// forward declaration of boost::hash_range from ContainerHash +template std::size_t hash_range( It, It ); + namespace urls { namespace grammar { @@ -864,7 +868,7 @@ class string_view_base hash_value( string_view_base const& s) noexcept { - return hash_value(s.s_); + return boost::hash_range( s.s_.begin(), s.s_.end() ); } /** Format a string to an output stream