From 995676a98e8029e729543130b0bba7ca00955652 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 18 Nov 2010 17:34:48 +0000 Subject: [PATCH] LWG 1522 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119710 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/complex | 52 +++++++++---------- include/random | 8 +-- .../complex.number/cmplx.over/conj.pass.cpp | 14 ++--- .../complex.number/cmplx.over/proj.pass.cpp | 14 ++--- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/include/complex b/include/complex index fd3375b1..273a8075 100644 --- a/include/complex +++ b/include/complex @@ -191,17 +191,17 @@ template T norm(const complex&); template double norm(T); float norm(float); -template complex conj(const complex&); - long double conj(long double); - double conj(double); -template double conj(T); - float conj(float); +template complex conj(const complex&); + complex conj(long double); + complex conj(double); +template complex conj(T); + complex conj(float); -template complex proj(const complex&); - long double proj(long double); - double proj(double); -template double proj(T); - float proj(float); +template complex proj(const complex&); + complex proj(long double); + complex proj(double); +template complex proj(T); + complex proj(float); template complex polar(const T&, const T& = 0); @@ -980,17 +980,17 @@ conj(const complex<_Tp>& __c) } inline _LIBCPP_INLINE_VISIBILITY -long double +complex conj(long double __re) { - return __re; + return complex(__re); } inline _LIBCPP_INLINE_VISIBILITY -double +complex conj(double __re) { - return __re; + return complex(__re); } template @@ -998,18 +998,18 @@ inline _LIBCPP_INLINE_VISIBILITY typename enable_if < is_integral<_Tp>::value, - double + complex >::type conj(_Tp __re) { - return __re; + return complex(__re); } inline _LIBCPP_INLINE_VISIBILITY -float +complex conj(float __re) { - return __re; + return complex(__re); } // proj @@ -1026,21 +1026,21 @@ proj(const complex<_Tp>& __c) } inline _LIBCPP_INLINE_VISIBILITY -long double +complex proj(long double __re) { if (isinf(__re)) __re = abs(__re); - return __re; + return complex(__re); } inline _LIBCPP_INLINE_VISIBILITY -double +complex proj(double __re) { if (isinf(__re)) __re = abs(__re); - return __re; + return complex(__re); } template @@ -1048,20 +1048,20 @@ inline _LIBCPP_INLINE_VISIBILITY typename enable_if < is_integral<_Tp>::value, - double + complex >::type proj(_Tp __re) { - return __re; + return complex(__re); } inline _LIBCPP_INLINE_VISIBILITY -float +complex proj(float __re) { if (isinf(__re)) __re = abs(__re); - return __re; + return complex(__re); } // polar diff --git a/include/random b/include/random index 3dbf808e..c40baa94 100644 --- a/include/random +++ b/include/random @@ -1498,7 +1498,7 @@ class piecewise_constant_distribution UnaryOperation fw); vector intervals() const; - vector densities() const; + vector densities() const; friend bool operator==(const param_type& x, const param_type& y); friend bool operator!=(const param_type& x, const param_type& y); @@ -1525,7 +1525,7 @@ class piecewise_constant_distribution // property functions vector intervals() const; - vector densities() const; + vector densities() const; param_type param() const; void param(const param_type& parm); @@ -1573,7 +1573,7 @@ class piecewise_linear_distribution UnaryOperation fw); vector intervals() const; - vector densities() const; + vector densities() const; friend bool operator==(const param_type& x, const param_type& y); friend bool operator!=(const param_type& x, const param_type& y); @@ -1603,7 +1603,7 @@ class piecewise_linear_distribution // property functions vector intervals() const; - vector densities() const; + vector densities() const; param_type param() const; void param(const param_type& parm); diff --git a/test/numerics/complex.number/cmplx.over/conj.pass.cpp b/test/numerics/complex.number/cmplx.over/conj.pass.cpp index 26735a1c..6adbf21e 100644 --- a/test/numerics/complex.number/cmplx.over/conj.pass.cpp +++ b/test/numerics/complex.number/cmplx.over/conj.pass.cpp @@ -9,11 +9,11 @@ // -// template complex conj(const complex&); -// long double conj(long double); -// double conj(double); -// template double conj(T); -// float conj(float); +// template complex conj(const complex&); +// complex conj(long double); +// complex conj(double); +// template complex conj(T); +// complex conj(float); #include #include @@ -25,7 +25,7 @@ template void test(T x, typename std::enable_if::value>::type* = 0) { - static_assert((std::is_same::value), ""); + static_assert((std::is_same >::value), ""); assert(std::conj(x) == conj(std::complex(x, 0))); } @@ -33,7 +33,7 @@ template void test(T x, typename std::enable_if::value>::type* = 0) { - static_assert((std::is_same::value), ""); + static_assert((std::is_same >::value), ""); assert(std::conj(x) == conj(std::complex(x, 0))); } diff --git a/test/numerics/complex.number/cmplx.over/proj.pass.cpp b/test/numerics/complex.number/cmplx.over/proj.pass.cpp index 6a5cff55..60d6e722 100644 --- a/test/numerics/complex.number/cmplx.over/proj.pass.cpp +++ b/test/numerics/complex.number/cmplx.over/proj.pass.cpp @@ -9,11 +9,11 @@ // -// template complex proj(const complex&); -// long double proj(long double); -// double proj(double); -// template double proj(T); -// float proj(float); +// template complex proj(const complex&); +// complex proj(long double); +// complex proj(double); +// template complex proj(T); +// complex proj(float); #include #include @@ -25,7 +25,7 @@ template void test(T x, typename std::enable_if::value>::type* = 0) { - static_assert((std::is_same::value), ""); + static_assert((std::is_same >::value), ""); assert(std::proj(x) == proj(std::complex(x, 0))); } @@ -33,7 +33,7 @@ template void test(T x, typename std::enable_if::value>::type* = 0) { - static_assert((std::is_same::value), ""); + static_assert((std::is_same >::value), ""); assert(std::proj(x) == proj(std::complex(x, 0))); }