0
0
Fork 0
mirror of https://github.com/ZDoom/raze-gles.git synced 2025-01-15 04:00:53 +00:00
raze-gles/source/common/utility/templates.h

19 lines
401 B
C
Raw Normal View History

#pragma once
// we do not want C++17 just for this one function...
//==========================================================================
//
// clamp
//
// Clamps in to the range [min,max].
//==========================================================================
template<class T>
inline
T clamp (const T in, const T min, const T max)
{
return in <= min ? min : in >= max ? max : in;
}