From 8e0aed664a16a2ef0833a39d24fcb463cdd0b610 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 25 Jan 2005 00:21:21 +0000 Subject: [PATCH] Increment, Decrement --- stepmania/src/RageUtil.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index a0e601e5be..8a4617deac 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -266,6 +266,12 @@ int FindIndex( T1 begin, T1 end, const T2 *p ) return iter - begin; } +/* Useful for objects with no operator-, eg. map::iterator (more convenient than advance). */ +template +T Increment( T a ) { ++a; return a; } +template +T Decrement( T a ) { --a; return a; } + void TrimLeft(CString &str, const char *s = "\r\n\t "); void TrimRight(CString &str, const char *s = "\r\n\t "); void StripCrnl(CString &s);