utils: add is_in_range function
This commit is contained in:
parent
6913510e67
commit
ef07b98215
|
@ -228,6 +228,12 @@ const T& clamp(const T& val, const T& min, const T& max)
|
|||
return (val < min ? min : (val > max ? max : val));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool is_in_range(const T& val, const T& min, const T& max)
|
||||
{
|
||||
return min <= val and val <= max;
|
||||
}
|
||||
|
||||
// *** AutoRegister: RAII handling of value semantics registering classes ***
|
||||
|
||||
template<typename EffectiveType, typename RegisterFuncs, typename Registry>
|
||||
|
|
Loading…
Reference in New Issue
Block a user