convenience
This commit is contained in:
@@ -32,6 +32,13 @@ static inline void enum_add( T &val, int iAmt )
|
|||||||
val = c.value;
|
val = c.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline T enum_add2( T val, int iAmt )
|
||||||
|
{
|
||||||
|
enum_add( val, iAmt );
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
#define FOREACH_ENUM( e, max, var ) for( e var=(e)0; var<max; enum_add<e>( var, +1 ) )
|
#define FOREACH_ENUM( e, max, var ) for( e var=(e)0; var<max; enum_add<e>( var, +1 ) )
|
||||||
#define FOREACH_ENUM2( e, var ) for( e var=(e)0; var<NUM_##e; enum_add<e>( var, +1 ) )
|
#define FOREACH_ENUM2( e, var ) for( e var=(e)0; var<NUM_##e; enum_add<e>( var, +1 ) )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user