From 72e83df4876d799cc7b7993813533041a112e250 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 29 May 2018 16:32:28 -0400 Subject: dust kickup spreads outward instead of being instantaneous --- src/util.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/util.h (limited to 'src/util.h') 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 @@ +#ifndef UTIL_H_E9110D4C +#define UTIL_H_E9110D4C + +template +void erase_if(Container& items, const Predicate& predicate) +{ + for (auto it = std::begin(items); it != std::end(items);) + { + if (predicate(*it)) + { + it = items.erase(it); + } + else + { + ++it; + } + } +}; + +#endif /* end of include guard: UTIL_H_E9110D4C */ -- cgit 1.4.1