Flutter Engine
The Flutter Engine
container.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FML_CONTAINER_H_
6#define FLUTTER_FML_CONTAINER_H_
7
8#include <functional>
9#include <map>
10
11namespace fml {
12
13template <
14 class Collection =
15 std::unordered_map<class Key, class Value, class Hash, class Equal>>
16void erase_if(Collection& container,
17 std::function<bool(typename Collection::iterator)> predicate) {
18 auto it = container.begin();
19 while (it != container.end()) {
20 if (predicate(it)) {
21 it = container.erase(it);
22 continue;
23 }
24 it++;
25 }
26}
27
28} // namespace fml
29
30#endif // FLUTTER_FML_CONTAINER_H_
Dart_NativeFunction function
Definition: fuchsia.cc:51
Definition: ascii_trie.cc:9
void erase_if(Collection &container, std::function< bool(typename Collection::iterator)> predicate)
Definition: container.h:16