Use of clamp

This commit is contained in:
conde2
2013-12-01 00:48:36 -02:00
parent 7ff73d1064
commit 4dcb30110f
9 changed files with 13 additions and 10 deletions

View File

@@ -45,6 +45,9 @@ float random_range(float min, float max);
double round(double r);
template<typename T>
T clamp(T x, T min, T max) { return std::max<T>(min, std::min<T>(x, max)); }
}
#endif