diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-04-08 16:51:59 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-04-08 16:51:59 +0100 |
commit | ef389dadd4f082e13b076f14a123bf506e158da4 (patch) | |
tree | aff0c327563eda85858e55d215e4e761b5349e9a /libstdc++-v3/include/std/complex | |
parent | e4b84abcc46fb4270172584ac5a4b46d70e93259 (diff) | |
download | gcc-ef389dadd4f082e13b076f14a123bf506e158da4.zip gcc-ef389dadd4f082e13b076f14a123bf506e158da4.tar.gz gcc-ef389dadd4f082e13b076f14a123bf506e158da4.tar.bz2 |
libstdc++: Add comparison operators to types from Numerics clause
Some more C++20 changes from P1614R2, "The Mothership has Landed".
* include/bits/slice_array.h (operator==(const slice&, const slice&)):
Define for C++20.
* include/std/complex (operator==(const T&, const complex<T>&))
(operator!=(const complex<T>&, const complex<T>&))
(operator!=(const complex<T>&, const T&))
(operator!=(const T&, const complex<T>&)): Do not declare for C++20.
* testsuite/26_numerics/slice/compare.cc: New test.
Diffstat (limited to 'libstdc++-v3/include/std/complex')
-rw-r--r-- | libstdc++-v3/include/std/complex | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index 4f170dc..f2917b8 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -468,6 +468,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const complex<_Tp>& __x, const _Tp& __y) { return __x.real() == __y && __x.imag() == _Tp(); } +#if !(__cpp_impl_three_way_comparison >= 201907L) template<typename _Tp> inline _GLIBCXX_CONSTEXPR bool operator==(const _Tp& __x, const complex<_Tp>& __y) @@ -490,6 +491,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline _GLIBCXX_CONSTEXPR bool operator!=(const _Tp& __x, const complex<_Tp>& __y) { return __x != __y.real() || _Tp() != __y.imag(); } +#endif //@} /// Extraction operator for complex values. |