• Home
  • Raw
  • Download

Lines Matching refs:k

80   size_type erase(const key_type& k) { return map_.erase(k); }  in erase()  argument
83 node_type extract(const key_type& k) { return map_.extract(k); } in extract() argument
91 template<typename Kv> iterator find(const Kv& k) { return map_.find(k); } in find() argument
92 template<typename Kv> const_iterator find(const Kv& k) const { return map_.find(k); } in find() argument
94 template<typename Kv> iterator lower_bound(const Kv& k) { return map_.lower_bound(k); } in lower_bound() argument
95 template<typename Kv> const_iterator lower_bound(const Kv& k) const { in lower_bound() argument
96 return map_.lower_bound(k); in lower_bound()
99 template<typename Kv> iterator upper_bound(const Kv& k) { return map_.upper_bound(k); } in upper_bound() argument
100 template<typename Kv> const_iterator upper_bound(const Kv& k) const { in upper_bound() argument
101 return map_.upper_bound(k); in upper_bound()
104 template<typename Kv> size_type count(const Kv& k) const { return map_.count(k); } in count() argument
107 V Get(const K& k) const { in Get() argument
108 const_iterator it = map_.find(k); in Get()
114 iterator Put(const K& k, const V& v) { in Put() argument
115 std::pair<iterator, bool> result = map_.emplace(k, v); in Put()
119 iterator Put(const K& k, V&& v) { in Put() argument
120 std::pair<iterator, bool> result = map_.emplace(k, std::move(v)); in Put()
126 iterator PutBefore(const_iterator pos, const K& k, const V& v) { in PutBefore() argument
128 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
129 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
130 return map_.emplace_hint(pos, k, v); in PutBefore()
132 iterator PutBefore(const_iterator pos, const K& k, V&& v) { in PutBefore() argument
134 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first)); in PutBefore()
135 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k)); in PutBefore()
136 return map_.emplace_hint(pos, k, std::move(v)); in PutBefore()
142 iterator Overwrite(const K& k, const V& v) { in Overwrite() argument
143 std::pair<iterator, bool> result = map_.insert(std::make_pair(k, v)); in Overwrite()
152 V& GetOrCreate(const K& k, CreateFn&& create) { in GetOrCreate() argument
155 auto lb = lower_bound(k); in GetOrCreate()
156 if (lb != end() && !key_comp()(k, lb->first)) { in GetOrCreate()
159 auto it = PutBefore(lb, k, create()); in GetOrCreate()
163 iterator FindOrAdd(const K& k, const V& v) { in FindOrAdd() argument
164 iterator it = find(k); in FindOrAdd()
165 return it == end() ? Put(k, v) : it; in FindOrAdd()
168 iterator FindOrAdd(const K& k) { in FindOrAdd() argument
169 iterator it = find(k); in FindOrAdd()
170 return it == end() ? Put(k, V()) : it; in FindOrAdd()