]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/std/complex
Revert 20001.
[thirdparty/gcc.git] / libstdc++-v3 / include / std / complex
index 2e2c2c06560680b288cb2617ffce7a53e264ac81..54f2b9db898d91e66353cbb01e0798c560f5430e 100644 (file)
@@ -70,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   ///  Return phase angle of @a z.
   template<typename _Tp> _Tp arg(const complex<_Tp>&);
   ///  Return @a z magnitude squared.
-  template<typename _Tp> _Tp norm(const complex<_Tp>&);
+  template<typename _Tp> _Tp _GLIBCXX_CONSTEXPR norm(const complex<_Tp>&);
 
   ///  Return complex conjugate of @a z.
   template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
@@ -322,7 +322,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x plus @a y.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -331,7 +331,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator+(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -340,7 +340,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator+(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __y;
@@ -352,7 +352,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x minus @a y.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -361,7 +361,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator-(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -370,7 +370,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator-(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r(__x, -__y.imag());
@@ -382,7 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x times @a y.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -391,7 +391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    inline _GLIBCXX_CONSTEXPR complex<_Tp>
     operator*(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -400,7 +400,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator*(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __y;
@@ -412,7 +412,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x divided by @a y.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -421,7 +421,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator/(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -430,7 +430,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator/(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -441,30 +441,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   ///  Return @a x.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator+(const complex<_Tp>& __x)
     { return __x; }
 
   ///  Return complex negation of @a x.
   template<typename _Tp>
-    inline complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline complex<_Tp>
     operator-(const complex<_Tp>& __x)
     {  return complex<_Tp>(-__x.real(), -__x.imag()); }
 
   //@{
   ///  Return true if @a x is equal to @a y.
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
     { return __x.real() == __y.real() && __x.imag() == __y.imag(); }
 
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator==(const complex<_Tp>& __x, const _Tp& __y)
     { return __x.real() == __y && __x.imag() == _Tp(); }
 
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator==(const _Tp& __x, const complex<_Tp>& __y)
     { return __x == __y.real() && _Tp() == __y.imag(); }
   //@}
@@ -472,17 +472,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return false if @a x is equal to @a y.
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
     { return __x.real() != __y.real() || __x.imag() != __y.imag(); }
 
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator!=(const complex<_Tp>& __x, const _Tp& __y)
     { return __x.real() != __y || __x.imag() != _Tp(); }
 
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR bool
+    _GLIBCXX_CONSTEXPR inline bool
     operator!=(const _Tp& __x, const complex<_Tp>& __y)
     { return __x != __y.real() || _Tp() != __y.imag(); }
   //@}
@@ -658,7 +658,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct _Norm_helper
     {
       template<typename _Tp>
-        static inline _Tp _S_do_it(const complex<_Tp>& __z)
+        static _GLIBCXX_CONSTEXPR inline _Tp _S_do_it(const complex<_Tp>& __z)
         {
           const _Tp __x = __z.real();
           const _Tp __y = __z.imag();
@@ -670,7 +670,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct _Norm_helper<true>
     {
       template<typename _Tp>
-        static inline _Tp _S_do_it(const complex<_Tp>& __z)
+        static _GLIBCXX_CONSTEXPR inline _Tp _S_do_it(const complex<_Tp>& __z)
         {
           _Tp __res = std::abs(__z);
           return __res * __res;
@@ -678,7 +678,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   template<typename _Tp>
-    inline _Tp
+    _GLIBCXX_CONSTEXPR inline _Tp
     norm(const complex<_Tp>& __z)
     {
       return _Norm_helper<__is_floating<_Tp>::__value
@@ -1866,7 +1866,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return _Tp(); }
 
   template<typename _Tp>
-    inline typename __gnu_cxx::__promote<_Tp>::__type
+    _GLIBCXX_CONSTEXPR inline typename __gnu_cxx::__promote<_Tp>::__type
     norm(_Tp __x)
     {
       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
@@ -1905,10 +1905,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // Forward declarations.
   // DR 781.
-  template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
+  template<typename _Tp>
+    _GLIBCXX_CONSTEXPR std::complex<_Tp> proj(const std::complex<_Tp>&);
 
   template<typename _Tp>
-    std::complex<_Tp>
+    _GLIBCXX_CONSTEXPR std::complex<_Tp>
     __complex_proj(const std::complex<_Tp>& __z)
     {
       const _Tp __den = (__z.real() * __z.real()
@@ -1919,25 +1920,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
 #if _GLIBCXX_USE_C99_COMPLEX
-  inline __complex__ float
+  _GLIBCXX_CONSTEXPR inline __complex__ float
   __complex_proj(__complex__ float __z)
   { return __builtin_cprojf(__z); }
 
-  inline __complex__ double
+  _GLIBCXX_CONSTEXPR inline __complex__ double
   __complex_proj(__complex__ double __z)
   { return __builtin_cproj(__z); }
 
-  inline __complex__ long double
+  _GLIBCXX_CONSTEXPR inline __complex__ long double
   __complex_proj(const __complex__ long double& __z)
   { return __builtin_cprojl(__z); }
 
   template<typename _Tp>
-    inline std::complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline std::complex<_Tp>
     proj(const std::complex<_Tp>& __z)
     { return __complex_proj(__z.__rep()); }
 #else
   template<typename _Tp>
-    inline std::complex<_Tp>
+    _GLIBCXX_CONSTEXPR inline std::complex<_Tp>
     proj(const std::complex<_Tp>& __z)
     { return __complex_proj(__z); }
 #endif