mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-19 03:33:56 +00:00
26 lines
595 B
C++
26 lines
595 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <unordered_set>
|
|
#include <unordered_map>
|
|
|
|
namespace utils
|
|
{
|
|
struct string_hash
|
|
{
|
|
using is_transparent = void;
|
|
|
|
size_t operator()(const std::string_view str) const
|
|
{
|
|
constexpr std::hash<std::string_view> hasher{};
|
|
return hasher(str);
|
|
}
|
|
};
|
|
|
|
template <typename T>
|
|
using unordered_string_map = std::unordered_map<std::string, T, string_hash, std::equal_to<>>;
|
|
|
|
using unordered_string_set = std::unordered_set<std::string, string_hash, std::equal_to<>>;
|
|
}
|