mirror of https://github.com/stella-emu/stella.git
Use std::clamp.
This commit is contained in:
parent
69b300b6f9
commit
56e6bd69bc
|
@ -167,7 +167,7 @@ namespace BSPF
|
|||
// if it is outside the specified range
|
||||
template<typename T> inline constexpr T clamp(T val, T lower, T upper)
|
||||
{
|
||||
return (val < lower) ? lower : (val > upper) ? upper : val;
|
||||
return std::clamp<T>(val, lower, upper);
|
||||
}
|
||||
template<typename T> inline constexpr void clamp(T& val, T lower, T upper, T setVal)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue