Lines Matching refs:k
73 template<typename Kv> size_type erase(const Kv& k) { return map_.erase(k); } in erase() argument
75 template<typename Kv> iterator find(const Kv& k) { return map_.find(k); } in find() argument
76 template<typename Kv> const_iterator find(const Kv& k) const { return map_.find(k); } in find() argument
78 template<typename Kv> iterator lower_bound(const Kv& k) { return map_.lower_bound(k); } in lower_bound() argument
79 template<typename Kv> const_iterator lower_bound(const Kv& k) const { in lower_bound() argument
80 return map_.lower_bound(k); in lower_bound()
83 template<typename Kv> iterator upper_bound(const Kv& k) { return map_.upper_bound(k); } in upper_bound() argument
84 template<typename Kv> const_iterator upper_bound(const Kv& k) const { in upper_bound() argument
85 return map_.upper_bound(k); in upper_bound()
88 template<typename Kv> size_type count(const Kv& k) const { return map_.count(k); } in count() argument
91 V Get(const K& k) const { in Get() argument
92 const_iterator it = map_.find(k); in Get()
98 iterator Put(const K& k, const V& v) { in Put() argument
99 std::pair<iterator, bool> result = map_.emplace(k, v); in Put()
103 iterator Put(const K& k, V&& v) { in Put() argument
104 std::pair<iterator, bool> result = map_.emplace(k, std::move(v)); in Put()
110 iterator PutBefore(const_iterator pos, const K& k, const V& v) { in PutBefore() argument
112 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
113 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
114 return map_.emplace_hint(pos, k, v); in PutBefore()
116 iterator PutBefore(const_iterator pos, const K& k, V&& v) { in PutBefore() argument
118 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
119 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
120 return map_.emplace_hint(pos, k, std::move(v)); in PutBefore()
126 iterator Overwrite(const K& k, const V& v) { in Overwrite() argument
127 std::pair<iterator, bool> result = map_.insert(std::make_pair(k, v)); in Overwrite()
136 V& GetOrCreate(const K& k, CreateFn create) { in GetOrCreate() argument
139 auto lb = lower_bound(k); in GetOrCreate()
140 if (lb != end() && !key_comp()(k, lb->first)) { in GetOrCreate()
143 auto it = PutBefore(lb, k, create()); in GetOrCreate()
147 iterator FindOrAdd(const K& k, const V& v) { in FindOrAdd() argument
148 iterator it = find(k); in FindOrAdd()
149 return it == end() ? Put(k, v) : it; in FindOrAdd()
152 iterator FindOrAdd(const K& k) { in FindOrAdd() argument
153 iterator it = find(k); in FindOrAdd()
154 return it == end() ? Put(k, V()) : it; in FindOrAdd()