Remove superflous std::hash specialization
This commit is contained in:
parent
d06b23d819
commit
274dcc58a5
@ -73,7 +73,6 @@ template <typename StringView> 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)
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user