[libcxx-commits] [PATCH] D152704: [libc++][spaceship] P1614R2: Removed `operator!=` from `functional`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 12 09:48:59 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9a6ca67397eb: [libc++][spaceship] P1614R2: Removed `operator!=` from `functional` (authored by Zingam).

Changed prior to commit:
  https://reviews.llvm.org/D152704?vs=530468&id=530557#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152704/new/

https://reviews.llvm.org/D152704

Files:
  libcxx/docs/Status/SpaceshipProjects.csv
  libcxx/include/__functional/function.h
  libcxx/include/functional


Index: libcxx/include/functional
===================================================================
--- libcxx/include/functional
+++ libcxx/include/functional
@@ -456,13 +456,13 @@
   bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
 
 template <class R, class ... ArgTypes>
-  bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+  bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept; // removed in C++20
 
 template <class R, class ... ArgTypes>
-  bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
+  bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept; // removed in C++20
 
 template <class  R, class ... ArgTypes>
-  bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+  bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept; // removed in C++20
 
 // specialized algorithms:
 template <class  R, class ... ArgTypes>
Index: libcxx/include/__functional/function.h
===================================================================
--- libcxx/include/__functional/function.h
+++ libcxx/include/__functional/function.h
@@ -1058,8 +1058,10 @@
     // deleted overloads close possible hole in the type system
     template<class _R2, class... _ArgTypes2>
       bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
+#if _LIBCPP_STD_VER <= 17
     template<class _R2, class... _ArgTypes2>
       bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
+#endif
 public:
     // function invocation:
     _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
@@ -1198,6 +1200,8 @@
 bool
 operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
 
+#if _LIBCPP_STD_VER <= 17
+
 template <class _Rp, class... _ArgTypes>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
@@ -1213,6 +1217,8 @@
 bool
 operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
 
+#endif // _LIBCPP_STD_VER <= 17
+
 template <class _Rp, class... _ArgTypes>
 inline _LIBCPP_INLINE_VISIBILITY
 void
Index: libcxx/docs/Status/SpaceshipProjects.csv
===================================================================
--- libcxx/docs/Status/SpaceshipProjects.csv
+++ libcxx/docs/Status/SpaceshipProjects.csv
@@ -65,7 +65,7 @@
 "| `[functional.syn] <https://wg21.link/functional.syn>`_
 | `[range.cmp] <https://wg21.link/range.cmp>`_
 | `[func.wrap.func] <https://wg21.link/func.wrap.func>`_
-| `[func.wrap.func.nullptr] <https://wg21.link/func.wrap.func.nullptr>`_",| remove ops `function`,None,Unassigned,|Not Started|
+| `[func.wrap.func.nullptr] <https://wg21.link/func.wrap.func.nullptr>`_",| remove ops `function <https://reviews.llvm.org/D152704>`_,None,Hristo Hristov,|Complete|
 | `[meta.unary.prop] <https://wg21.link/meta.unary.prop>`_,| replaced by `issue LWG3354 <https://wg21.link/LWG3354>`_,None,Unassigned,|Nothing To Do|
 | `[meta.trans.other] <https://wg21.link/meta.trans.other>`_,|,None,Unassigned,|Not Started|
 "| `[type.index.overview] <https://wg21.link/type.index.overview>`_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152704.530557.patch
Type: text/x-patch
Size: 3087 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230612/a6df8175/attachment-0001.bin>


More information about the libcxx-commits mailing list