From 55c8a14a7e2b2dadf0def3e09f970818164366f5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 18 Jun 2015 12:14:05 -0400 Subject: Now displaying player character --- src/algorithms.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/algorithms.h (limited to 'src/algorithms.h') diff --git a/src/algorithms.h b/src/algorithms.h new file mode 100644 index 0000000..80e3e27 --- /dev/null +++ b/src/algorithms.h @@ -0,0 +1,12 @@ +#ifndef ALGORITHMS_H_1DDC517E +#define ALGORITHMS_H_1DDC517E + +template< typename ContainerT, typename PredicateT > +void erase_if( ContainerT& items, const PredicateT& predicate ) { + for( auto it = items.begin(); it != items.end(); ) { + if( predicate(*it) ) it = items.erase(it); + else ++it; + } +}; + +#endif /* end of include guard: ALGORITHMS_H_1DDC517E */ -- cgit 1.4.1