[libcxx-commits] [PATCH] D152615: [libc++][spaceship] P1614R2: Removed ops from `complex`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 10 02:45:04 PDT 2023


H-G-Hristov created this revision.
Herald added a subscriber: yaxunl.
Herald added a project: All.
H-G-Hristov requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Implements parts of P1614R2:

- Removed ops from `complex`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152615

Files:
  libcxx/include/complex


Index: libcxx/include/complex
===================================================================
--- libcxx/include/complex
+++ libcxx/include/complex
@@ -148,12 +148,12 @@
 template<class T> complex<T> operator/(const T&, const complex<T>&);          // constexpr in C++20
 template<class T> complex<T> operator+(const complex<T>&);                    // constexpr in C++20
 template<class T> complex<T> operator-(const complex<T>&);                    // constexpr in C++20
-template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
-template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14
-template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14
-template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14
+template<class T> bool operator==(const complex<T>&, const complex<T>&);      // constexpr in C++14
+template<class T> bool operator==(const complex<T>&, const T&);               // constexpr in C++14
+template<class T> bool operator==(const T&, const complex<T>&);               // removed in C++20
+template<class T> bool operator!=(const complex<T>&, const complex<T>&);      // removed in C++20
+template<class T> bool operator!=(const complex<T>&, const T&);               // removed in C++20
+template<class T> bool operator!=(const T&, const complex<T>&);               // removed in C++20
 
 template<class T, class charT, class traits>
   basic_istream<charT, traits>&
@@ -827,6 +827,8 @@
     return __x.real() == __y && __x.imag() == 0;
 }
 
+#if _LIBCPP_STD_VER <= 17
+
 template<class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
 bool
@@ -859,6 +861,8 @@
     return !(__x == __y);
 }
 
+#endif
+
 // 26.3.7 values:
 
 template <class _Tp, bool = is_integral<_Tp>::value,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152615.530189.patch
Type: text/x-patch
Size: 2028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230610/75907b0a/attachment.bin>


More information about the libcxx-commits mailing list