diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 6cafcf28d5..4af407c50f 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -191,6 +191,15 @@ void SortCStringArray( CStringArray &AddTo, const bool bSortAcsending = true ); float calc_mean(const float *start, const float *end); float calc_stddev(const float *start, const float *end); +template +int FindIndex( const T1 &array, const T2 *p ) +{ + T1::const_iterator it = find( array.begin(), array.end(), p ); + if( it == array.end() ) + return -1; + return it - array.begin(); +} + void TrimLeft(CString &str, const char *s = "\r\n\t "); void TrimRight(CString &str, const char *s = "\r\n\t "); void StripCrnl(CString &s);