Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
string_hash.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstddef>
9#include <functional>
10#include <string_view>
11
12namespace util {
17 using is_transparent = void;
18
25 std::size_t operator()(std::string_view value) const noexcept {
26 return std::hash<std::string_view> {}(value);
27 }
28 };
29} // namespace util
Hash strings, string views, and C strings without temporary allocations.
Definition string_hash.h:16
void is_transparent
Enable heterogeneous unordered-container lookup.
Definition string_hash.h:17
std::size_t operator()(std::string_view value) const noexcept
Hash all characters in a string-like key, including embedded nulls in views.
Definition string_hash.h:25