Lines Matching refs:k
73 size_type erase(const K& k) { return map_.erase(k); } in erase() argument
75 iterator find(const K& k) { return map_.find(k); } in find() argument
76 const_iterator find(const K& k) const { return map_.find(k); } in find() argument
78 iterator lower_bound(const K& k) { return map_.lower_bound(k); } in lower_bound() argument
79 const_iterator lower_bound(const K& k) const { return map_.lower_bound(k); } in lower_bound() argument
81 iterator upper_bound(const K& k) { return map_.upper_bound(k); } in upper_bound() argument
82 const_iterator upper_bound(const K& k) const { return map_.upper_bound(k); } in upper_bound() argument
84 size_type count(const K& k) const { return map_.count(k); } in count() argument
87 V Get(const K& k) const { in Get() argument
88 const_iterator it = map_.find(k); in Get()
94 iterator Put(const K& k, const V& v) { in Put() argument
95 std::pair<iterator, bool> result = map_.emplace(k, v); in Put()
99 iterator Put(const K& k, V&& v) { in Put() argument
100 std::pair<iterator, bool> result = map_.emplace(k, std::move(v)); in Put()
106 iterator PutBefore(const_iterator pos, const K& k, const V& v) { in PutBefore() argument
108 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
109 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
110 return map_.emplace_hint(pos, k, v); in PutBefore()
112 iterator PutBefore(const_iterator pos, const K& k, V&& v) { in PutBefore() argument
114 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
115 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
116 return map_.emplace_hint(pos, k, std::move(v)); in PutBefore()
122 iterator Overwrite(const K& k, const V& v) { in Overwrite() argument
123 std::pair<iterator, bool> result = map_.insert(std::make_pair(k, v)); in Overwrite()
132 V& GetOrCreate(const K& k, CreateFn create) { in GetOrCreate() argument
135 auto lb = lower_bound(k); in GetOrCreate()
136 if (lb != end() && !key_comp()(k, lb->first)) { in GetOrCreate()
139 auto it = PutBefore(lb, k, create()); in GetOrCreate()
143 iterator FindOrAdd(const K& k, const V& v) { in FindOrAdd() argument
144 iterator it = find(k); in FindOrAdd()
145 return it == end() ? Put(k, v) : it; in FindOrAdd()
148 iterator FindOrAdd(const K& k) { in FindOrAdd() argument
149 iterator it = find(k); in FindOrAdd()
150 return it == end() ? Put(k, V()) : it; in FindOrAdd()