87 template <
typename _Kty,
typename _Ty,
typename _Pr = std::less<_Kty>,
typename _Alloc = std::allocator<std::pair<const _Kty, _Ty>>>
89 :
public std::map<_Kty, _Ty, _Pr, _Alloc>
92 typedef std::map<_Kty, _Ty, _Pr, _Alloc> super;
95 auto at(
const _Kty &) -> _Ty& =
delete;
96 auto at(
const _Kty &)
const ->
const _Ty& =
delete;
110 auto has(
const _Kty &key)
const ->
bool 112 return count(key) != 0;
129 auto get(
const _Kty &key) -> _Ty&
131 return find(key)->second;
133 auto get(
const _Kty &key)
const ->
const _Ty&
135 return find(key)->second;
150 void set(
const _Kty &key,
const _Ty &val)
152 iterator it = find(key);
156 insert({ key, val });
158 void set(
const _Kty &key,
const _Ty &&val)
160 iterator it = find(key);
164 insert({ key, val });
173 auto pop(
const _Kty &key) -> _Ty
175 iterator it = find(key);
176 _Ty val = it->second;
180 return std::move(val);
auto has(const _Kty &key) const -> bool
Whether have the item or not.
auto pop(const _Kty &key) -> _Ty
Pop item.
Top level namespace of products built from samchon.