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
This commit is contained in:
Howard Hinnant 2012-05-03 14:58:34 +00:00
parent 87073e4bfb
commit f07a529b77

View File

@ -648,10 +648,17 @@ using ::double_t;
// abs
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_floating_point<_A1>::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__