10 #include <unordered_map>
12 template <
typename ValueT>
15 using MapT =
typename std::unordered_map<std::string, ValueT>;
17 auto find(std::string_view key)
const {
19 tmp_key_.assign(key.data(), key.size());
23 auto find(
const std::string& key)
const {
return MapT::find(key); }
25 auto find(
const char* key)
const {
30 template <
typename... ArgsT>
33 tmp_key_.assign(key.data(), key.size());
34 return MapT::try_emplace(
tmp_key_, std::forward<ArgsT>(
args)...);
37 template <
typename... ArgsT>
39 return MapT::try_emplace(key, std::forward<ArgsT>(
args)...);
42 template <
typename... ArgsT>
45 return MapT::try_emplace(
tmp_key_, std::forward<ArgsT>(
args)...);
52 template <
typename ValueT>
auto find(std::string_view key) const
typename std::unordered_map< std::string, ValueT > MapT
auto try_emplace(const char *key, ArgsT &&...args)
auto try_emplace(const std::string &key, ArgsT &&...args)
auto find(const std::string &key) const
static thread_local std::string tmp_key_
auto try_emplace(std::string_view key, ArgsT &&...args)
auto find(const char *key) const