86 template <
typename _Kty,
typename _Ty,
typename _Pr = std::less<_Kty>,
typename _Alloc = std::allocator<std::pair<const _Kty, _Ty>>>
88 :
public std::map<_Kty, _Ty, _Pr, _Alloc>
91 typedef std::map<_Kty, _Ty, _Pr, _Alloc> super;
94 auto at(
const _Kty &) -> _Ty& =
delete;
95 auto at(
const _Kty &)
const ->
const _Ty& =
delete;
109 auto has(
const _Kty &key)
const ->
bool 111 return count(key) != 0;
128 auto get(
const _Kty &key) -> _Ty&
130 return find(key)->second;
132 auto get(
const _Kty &key)
const ->
const _Ty&
134 return find(key)->second;
149 void set(
const _Kty &key,
const _Ty &val)
151 iterator it = find(key);
155 insert({ key, val });
157 void set(
const _Kty &key,
const _Ty &&val)
159 iterator it = find(key);
163 insert({ key, val });
172 auto pop(
const _Kty &key) -> _Ty
174 iterator it = find(key);
175 _Ty val = it->second;
auto pop(const _Kty &key) -> _Ty
Pop item.
auto has(const _Kty &key) const -> bool
Whether have the item or not.