From 274dcc58a5fc6db5931cb990608a246d1e2deaf6 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sun, 30 Oct 2022 19:21:06 +0100 Subject: [PATCH] Remove superflous std::hash specialization --- include/util/guidance/name_announcements.hpp | 1 - include/util/string_view.hpp | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/include/util/guidance/name_announcements.hpp b/include/util/guidance/name_announcements.hpp index 112da7f8c..fceff6b03 100644 --- a/include/util/guidance/name_announcements.hpp +++ b/include/util/guidance/name_announcements.hpp @@ -73,7 +73,6 @@ template inline auto decompose(const StringView &lhs, cons std::string str(view); std::transform( str.begin(), str.end(), str.begin(), [](unsigned char c) { return std::tolower(c); }); - ); auto front = str.find_first_not_of(' '); if (front == std::string::npos) diff --git a/include/util/string_view.hpp b/include/util/string_view.hpp index d1cf4cb96..21f34ca5c 100644 --- a/include/util/string_view.hpp +++ b/include/util/string_view.hpp @@ -14,21 +14,4 @@ using StringView = std::string_view; } // namespace util } // namespace osrm -// Specializing hash<> for user-defined type in std namespace, this is standard conforming. -namespace std -{ -template <> struct hash<::osrm::util::StringView> final -{ - std::size_t operator()(::osrm::util::StringView v) const noexcept - { - // Bring into scope and call un-qualified for ADL: - // remember we want to be able to switch impl. above. - using std::begin; - using std::end; - - return boost::hash_range(begin(v), end(v)); - } -}; -} // namespace std - #endif /* OSRM_STRING_VIEW_HPP */