summary refs log tree commit diff stats
path: root/src/util.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-06-05 18:18:17 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-06-05 18:18:17 -0400
commitf838a08ef531ad643e28ced2c9b1ae5bd9d57765 (patch)
tree3c2527f673118014da72c1703000c8dec3e24e06 /src/util.h
parent8c9d046123f0978ea3f770838a2321d85ffda977 (diff)
parent47c584d8a583bab3a71333e9993b72cf481bca2f (diff)
downloadether-f838a08ef531ad643e28ced2c9b1ae5bd9d57765.tar.gz
ether-f838a08ef531ad643e28ced2c9b1ae5bd9d57765.tar.bz2
ether-f838a08ef531ad643e28ced2c9b1ae5bd9d57765.zip
merge master into colorfade and improved it
overlapping colors look weird though
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..150a6a5 --- /dev/null +++ b/src/util.h
@@ -0,0 +1,20 @@
1#ifndef UTIL_H_E9110D4C
2#define UTIL_H_E9110D4C
3
4template <typename Container, typename Predicate>
5void erase_if(Container& items, const Predicate& predicate)
6{
7 for (auto it = std::begin(items); it != std::end(items);)
8 {
9 if (predicate(*it))
10 {
11 it = items.erase(it);
12 }
13 else
14 {
15 ++it;
16 }
17 }
18};
19
20#endif /* end of include guard: UTIL_H_E9110D4C */