From f07a529b7768f56f45503a3f54a58d01f2def52c Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 3 May 2012 14:58:34 +0000 Subject: [PATCH] Change std::abs from a template function to three overloads for float, double and long double. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@156064 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cmath | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/cmath b/include/cmath index 026889f81..76d7a821a 100644 --- a/include/cmath +++ b/include/cmath @@ -648,10 +648,17 @@ using ::double_t; // abs -template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, _A1>::type -abs(_A1 __x) {return fabs(__x);} +float +abs(float __x) {return fabsf(__x);} + +inline _LIBCPP_INLINE_VISIBILITY +double +abs(double __x) {return fabs(__x);} + +inline _LIBCPP_INLINE_VISIBILITY +long double +abs(long double __x) {return fabsl(__x);} #ifndef __sun__