From 411d867eb613da96b19334e807c3fb24c6844b5d Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 19 Mar 2011 02:51:38 +0000 Subject: [PATCH] Fixed build error detected by clang --- base/math.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base/math.hpp b/base/math.hpp index f6c95b88da..2a620cda0e 100644 --- a/base/math.hpp +++ b/base/math.hpp @@ -11,6 +11,11 @@ namespace my { +template inline T Abs(T x) +{ + return (x < 0 ? -x : x); +} + // Compare floats or doubles for almost equality. // maxULPs - number of closest floating point values that are considered equal. // Infinity is treated as almost equal to the largest possible floating point values. @@ -76,11 +81,6 @@ inline T clamp(T x, TMin xmin, TMax xmax) return x; } -template inline T Abs(T x) -{ - return (x < 0 ? -x : x); -} - template inline bool between_s(T a, T b, T x) { return (a <= x && x <= b);