gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
string_keyed.h
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_STRING_KEYED_H
4#define GDK_GRAPHICS_STRING_KEYED_H
5
6#include <functional>
7#include <string>
8#include <string_view>
9#include <unordered_map>
10
11namespace gdk::graphics {
14 using is_transparent = void;
15
16 [[nodiscard]] std::size_t operator()(const std::string_view aName) const {
17 return std::hash<std::string_view>{}(aName);
18 }
19 };
20
22 template<typename value_type>
23 using string_keyed = std::unordered_map<std::string, value_type,
24 transparent_string_hash, std::equal_to<>>;
25}
26
27#endif
a hash that will take anything a string_view can be built from
Definition string_keyed.h:13