--- a/sources/basics.h Sun Dec 14 18:15:28 2014 +0200 +++ b/sources/basics.h Sun Dec 14 19:38:47 2014 +0200 @@ -63,3 +63,9 @@ using Function = std::function<Signature>; FUNCTION print_to_console (const String& a) -> void; + +template<typename T> inline FUNCTION +clamp (T a, T b, T c) -> T +{ + return (a < b) ? b : (a > c) ? c : a; +}