From c8dad563009e55dfb59c6a0356353eb298eceb22 Mon Sep 17 00:00:00 2001 From: Mohammed Kabir Date: Sat, 22 Apr 2017 15:24:29 +0200 Subject: [PATCH] mathlib : switch min/max to constexpr to match std::min/max --- src/lib/mathlib/math/Limits.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/mathlib/math/Limits.hpp b/src/lib/mathlib/math/Limits.hpp index 6215b8f955..5d3415d69e 100644 --- a/src/lib/mathlib/math/Limits.hpp +++ b/src/lib/mathlib/math/Limits.hpp @@ -56,19 +56,19 @@ namespace math { template -inline const _Tp &min(const _Tp &a, const _Tp &b) +inline constexpr const _Tp &min(const _Tp &a, const _Tp &b) { return (a < b) ? a : b; } template -inline const _Tp &max(const _Tp &a, const _Tp &b) +inline constexpr const _Tp &max(const _Tp &a, const _Tp &b) { return (a > b) ? a : b; } template -inline const _Tp &constrain(const _Tp &val, const _Tp &min_val, const _Tp &max_val) +inline constexpr const _Tp &constrain(const _Tp &val, const _Tp &min_val, const _Tp &max_val) { return (val < min_val) ? min_val : ((val > max_val) ? max_val : val); }