2 #include <samchon/API.hpp> 4 #include <unordered_map> 102 template <
typename Key,
typename T,
103 typename Hash = std::hash<Key>,
typename Pred = std::equal_to<Key>,
104 typename Alloc = std::allocator<std::pair<const Key, T>>>
106 :
public std::unordered_map<Key, T, Hash, Pred, Alloc>
109 typedef std::unordered_map<Key, T, Hash, Pred, Alloc> super;
112 auto at(
const Key &) -> T& =
delete;
113 auto at(
const Key &)
const ->
const T& =
delete;
127 auto has(
const Key &key)
const ->
bool 129 return count(key) != 0;
146 auto get(
const Key &key) -> T&
148 return find(key)->second;
150 auto get(
const Key &key)
const ->
const T&
152 return find(key)->second;
167 void set(
const Key &key,
const T &val)
169 iterator it = find(key);
173 insert({ key, val });
175 void set(
const Key &key,
const T &&val)
177 iterator it = find(key);
181 insert({ key, val });
190 auto pop(
const Key &key) -> T
192 iterator it = find(key);
197 return std::move(val);
auto has(const Key &key) const -> bool
Whether have the item or not.
auto pop(const Key &key) -> T
Pop item.
Top level namespace of products built from samchon.
Customized std::unordered_map.