Lines Matching refs:action
159 // The action`s return true means meeting the erase condition
160 // The action`s return false means not meeting the erase condition
161 size_type EraseIf(const std::function<bool(const key_type &key, mapped_type &value)> &action) noexcept
163 if (action == nullptr) {
169 [&action](value_type &value) -> bool { return action(value.first, value.second); });
173 if (action((*it).first, (*it).second)) {
184 void ForEach(const std::function<bool(const key_type &, mapped_type &)> &action)
186 if (action == nullptr) {
191 if (action(key, value)) {
197 void ForEachCopies(const std::function<bool(const key_type &, mapped_type &)> &action)
199 if (action == nullptr) {
204 if (action(key, value)) {
210 // The action's return value means that the element is keep in map or not; true means keeping, false means removing.
211 bool Compute(const key_type &key, const std::function<bool(const key_type &, mapped_type &)> &action)
213 if (action == nullptr) {
225 if (!action(it->first, it->second)) {
231 // The action's return value means that the element is keep in map or not; true means keeping, false means removing.
232 bool ComputeIfPresent(const key_type &key, const std::function<bool(const key_type &, mapped_type &)> &action)
234 if (action == nullptr) {
242 if (!action(key, it->second)) {
248 bool ComputeIfAbsent(const key_type &key, const std::function<mapped_type(const key_type &)> &action)
250 if (action == nullptr) {
258 entries_.emplace(key, action(key));