Increment, Decrement

This commit is contained in:
Glenn Maynard
2005-01-25 00:21:21 +00:00
parent 6416067514
commit 8e0aed664a
+6
View File
@@ -266,6 +266,12 @@ int FindIndex( T1 begin, T1 end, const T2 *p )
return iter - begin; return iter - begin;
} }
/* Useful for objects with no operator-, eg. map::iterator (more convenient than advance). */
template<class T>
T Increment( T a ) { ++a; return a; }
template<class T>
T Decrement( T a ) { --a; return a; }
void TrimLeft(CString &str, const char *s = "\r\n\t "); void TrimLeft(CString &str, const char *s = "\r\n\t ");
void TrimRight(CString &str, const char *s = "\r\n\t "); void TrimRight(CString &str, const char *s = "\r\n\t ");
void StripCrnl(CString &s); void StripCrnl(CString &s);