diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-18 12:14:05 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-18 12:14:05 -0400 |
| commit | 55c8a14a7e2b2dadf0def3e09f970818164366f5 (patch) | |
| tree | e05795e83aa61dc5b951a70328b8499d3c583ea6 /src/algorithms.h | |
| parent | 879c2c04d9c3879f871cfe79f9b25fd23c5184b4 (diff) | |
| download | therapy-55c8a14a7e2b2dadf0def3e09f970818164366f5.tar.gz therapy-55c8a14a7e2b2dadf0def3e09f970818164366f5.tar.bz2 therapy-55c8a14a7e2b2dadf0def3e09f970818164366f5.zip | |
Now displaying player character
Diffstat (limited to 'src/algorithms.h')
| -rw-r--r-- | src/algorithms.h | 12 |
1 files changed, 12 insertions, 0 deletions
| 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 @@ | |||
| 1 | #ifndef ALGORITHMS_H_1DDC517E | ||
| 2 | #define ALGORITHMS_H_1DDC517E | ||
| 3 | |||
| 4 | template< typename ContainerT, typename PredicateT > | ||
| 5 | void erase_if( ContainerT& items, const PredicateT& predicate ) { | ||
| 6 | for( auto it = items.begin(); it != items.end(); ) { | ||
| 7 | if( predicate(*it) ) it = items.erase(it); | ||
| 8 | else ++it; | ||
| 9 | } | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif /* end of include guard: ALGORITHMS_H_1DDC517E */ | ||
