Lines Matching refs:action
130 bool ContainIf(const key_type &key, const std::function<bool(const mapped_type &value)> &action) const noexcept
137 if (action) {
138 return action(it->second);
171 const std::function<bool(const key_type &key, mapped_type &value)> &action) noexcept
173 if (action == nullptr) {
178 if (it == entries_.end() || !action((*it).first, (*it).second)) {
202 // The action`s return true means meeting the erase condition
203 // The action`s return false means not meeting the erase condition
204 size_type EraseIf(const std::function<bool(const key_type &key, mapped_type &value)> &action) noexcept
206 if (action == nullptr) {
212 [&action](value_type &value) -> bool { return action(value.first, value.second); });
216 if (action((*it).first, (*it).second)) {
227 void ForEach(const std::function<bool(const key_type &, mapped_type &)> &action)
229 if (action == nullptr) {
234 if (action(key, value)) {
240 void ForEachCopies(const std::function<bool(const key_type &, mapped_type &)> &action)
242 if (action == nullptr) {
247 if (action(key, value)) {
253 // The action's return value means that the element is keep in map or not; true means keeping, false means removing.
254 bool Compute(const key_type &key, const std::function<bool(const key_type &, mapped_type &)> &action)
256 if (action == nullptr) {
268 if (!action(it->first, it->second)) {
274 // The action's return value means that the element is keep in map or not; true means keeping, false means removing.
275 bool ComputeIfPresent(const key_type &key, const std::function<bool(const key_type &, mapped_type &)> &action)
277 if (action == nullptr) {
285 if (!action(key, it->second)) {
291 bool ComputeIfAbsent(const key_type &key, const std::function<mapped_type(const key_type &)> &action)
293 if (action == nullptr) {
301 entries_.emplace(key, action(key));
305 void DoActionIfEmpty(const std::function<void(void)> &action)
307 if (action == nullptr) {
312 action();
317 void DoActionWhenClone(const std::function<void(const std::map<_Key, _Tp> &)> &action)
319 if (action == nullptr) {
324 action(tmp);