mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-19 17:31:44 +03:00
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));
|
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 ***
|
// *** AutoRegister: RAII handling of value semantics registering classes ***
|
||||||
|
|
||||||
template<typename EffectiveType, typename RegisterFuncs, typename Registry>
|
template<typename EffectiveType, typename RegisterFuncs, typename Registry>
|
||||||
|
Loading…
Reference in New Issue
Block a user