Blaze/MathUtil.h

9 lines
173 B
C++

#pragma once
#include <utility>
template <std::totally_ordered T>
T Clamp(T const val, T const minVal, T const maxVal)
{
return std::min(maxVal, std::max(val, minVal));
}