/// 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>&);
//@{
/// 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;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator+(const complex<_Tp>& __x, const _Tp& __y)
{
complex<_Tp> __r = __x;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator+(const _Tp& __x, const complex<_Tp>& __y)
{
complex<_Tp> __r = __y;
//@{
/// 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;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator-(const complex<_Tp>& __x, const _Tp& __y)
{
complex<_Tp> __r = __x;
}
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());
//@{
/// 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;
}
template<typename _Tp>
- inline complex<_Tp>
+ inline _GLIBCXX_CONSTEXPR complex<_Tp>
operator*(const complex<_Tp>& __x, const _Tp& __y)
{
complex<_Tp> __r = __x;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator*(const _Tp& __x, const complex<_Tp>& __y)
{
complex<_Tp> __r = __y;
//@{
/// 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;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator/(const complex<_Tp>& __x, const _Tp& __y)
{
complex<_Tp> __r = __x;
}
template<typename _Tp>
- inline complex<_Tp>
+ _GLIBCXX_CONSTEXPR inline complex<_Tp>
operator/(const _Tp& __x, const complex<_Tp>& __y)
{
complex<_Tp> __r = __x;
/// 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(); }
//@}
//@{
/// 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(); }
//@}
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();
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;
};
template<typename _Tp>
- inline _Tp
+ _GLIBCXX_CONSTEXPR inline _Tp
norm(const complex<_Tp>& __z)
{
return _Norm_helper<__is_floating<_Tp>::__value
{ 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;
// 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()
}
#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