From b30fbd10720959bf16835891a2a802b38a1717bf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 23 Aug 2016 13:27:19 +0200 Subject: compat/util: move typical "clamp" function here --- spline-widget/spline.hpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'spline-widget') diff --git a/spline-widget/spline.hpp b/spline-widget/spline.hpp index 0ffc4de9..75a9e95e 100644 --- a/spline-widget/spline.hpp +++ b/spline-widget/spline.hpp @@ -10,6 +10,7 @@ #include "compat/qcopyable-mutex.hpp" #include "options/options.hpp" +#include "compat/util.hpp" using namespace options; #include "export.hpp" @@ -48,16 +49,6 @@ class OPENTRACK_SPLINE_EXPORT spline final static QPointF ensure_in_bounds(const QList& points, int i); - template - static inline auto clamp(t val, u min, w max) -> decltype (val * min * max) - { - if (val > max) - return max; - if (val < min) - return min; - return val; - } - mem s; QMetaObject::Connection connection; -- cgit v1.2.3