add FindIndex
This commit is contained in:
@@ -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<class T1, class T2>
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user