util: turn max, min, and abs into const_expr

Ref #2092
This commit is contained in:
Stefan Kalkowski 2016-10-19 21:31:04 +02:00 committed by Christian Helmuth
parent 746f51393b
commit 7c8281f2d6

View File

@ -17,13 +17,13 @@
namespace Genode {
template <typename T1, typename T2>
T1 max(T1 v1, T2 v2) { return v1 > v2 ? v1 : v2; }
static constexpr T1 max(T1 v1, T2 v2) { return v1 > v2 ? v1 : v2; }
template <typename T1, typename T2>
T1 min(T1 v1, T2 v2) { return v1 < v2 ? v1 : v2; }
static constexpr T1 min(T1 v1, T2 v2) { return v1 < v2 ? v1 : v2; }
template <typename T>
T abs(T value) { return value >= 0 ? value : -value; }
static constexpr T abs(T value) { return value >= 0 ? value : -value; }
/**