[libcxx-commits] [PATCH] D152629: [libc++][spaceship] P1614R2: Removed ops from `memory_resource`, `polymorphic_allocator`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 10 13:38:12 PDT 2023


H-G-Hristov updated this revision to Diff 530246.
H-G-Hristov added a comment.

Rebased


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152629

Files:
  libcxx/docs/Status/SpaceshipProjects.csv
  libcxx/include/__memory_resource/memory_resource.h
  libcxx/include/__memory_resource/polymorphic_allocator.h
  libcxx/include/memory_resource


Index: libcxx/include/memory_resource
===================================================================
--- libcxx/include/memory_resource
+++ libcxx/include/memory_resource
@@ -22,7 +22,7 @@
   bool operator==(const memory_resource& a,
                   const memory_resource& b) noexcept;
   bool operator!=(const memory_resource& a,
-                  const memory_resource& b) noexcept;
+                  const memory_resource& b) noexcept;           // removed in C++20
 
   template <class Tp> class polymorphic_allocator;
 
@@ -31,7 +31,7 @@
                   const polymorphic_allocator<T2>& b) noexcept;
   template <class T1, class T2>
   bool operator!=(const polymorphic_allocator<T1>& a,
-                  const polymorphic_allocator<T2>& b) noexcept;
+                  const polymorphic_allocator<T2>& b) noexcept; // removed in C++20
 
   // Global memory resources
   memory_resource* set_default_resource(memory_resource* r) noexcept;
Index: libcxx/include/__memory_resource/polymorphic_allocator.h
===================================================================
--- libcxx/include/__memory_resource/polymorphic_allocator.h
+++ libcxx/include/__memory_resource/polymorphic_allocator.h
@@ -207,12 +207,16 @@
   return *__lhs.resource() == *__rhs.resource();
 }
 
+#  if _LIBCPP_STD_VER <= 17
+
 template <class _Tp, class _Up>
 inline _LIBCPP_HIDE_FROM_ABI bool
 operator!=(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<_Up>& __rhs) noexcept {
   return !(__lhs == __rhs);
 }
 
+#  endif
+
 } // namespace pmr
 
 _LIBCPP_END_NAMESPACE_STD
Index: libcxx/include/__memory_resource/memory_resource.h
===================================================================
--- libcxx/include/__memory_resource/memory_resource.h
+++ libcxx/include/__memory_resource/memory_resource.h
@@ -55,10 +55,14 @@
   return &__lhs == &__rhs || __lhs.is_equal(__rhs);
 }
 
+#  if _LIBCPP_STD_VER <= 17
+
 inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
   return !(__lhs == __rhs);
 }
 
+#  endif
+
 // [mem.res.global]
 
 [[__gnu__::__returns_nonnull__]] _LIBCPP_FUNC_VIS memory_resource* get_default_resource() noexcept;
Index: libcxx/docs/Status/SpaceshipProjects.csv
===================================================================
--- libcxx/docs/Status/SpaceshipProjects.csv
+++ libcxx/docs/Status/SpaceshipProjects.csv
@@ -56,8 +56,9 @@
 | `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_,| `unique_ptr <https://reviews.llvm.org/D130838>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
 | `[util.smartptr.shared.cmp] <https://wg21.link/util.smartptr.shared.cmp>`_,| `shared_ptr <https://reviews.llvm.org/D130852>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
 | `[mem.res.syn] <https://wg21.link/mem.res.syn>`_,|,None,Unassigned,|Not Started|
-| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_,| remove ops `memory_resource`,None,Unassigned,|Not Started|
-| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_,| remove ops `polymorphic_allocator`,None,Unassigned,|Not Started|
+"| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_
+| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_","| remove ops `memory_resource <https://reviews.llvm.org/D152629>`_
+| remove ops `polymorphic_allocator <https://reviews.llvm.org/D152629>`_",None,Hristo Hristov,|Complete|
 "| `[allocator.adaptor.syn] <https://wg21.link/allocator.adaptor.syn>`_
 | `[scoped.adaptor.operators] <https://wg21.link/scoped.adaptor.operators>`_",| remove ops `scoped_allocator_adaptor`,None,Unassigned,|Not Started|
 "| `[functional.syn] <https://wg21.link/functional.syn>`_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152629.530246.patch
Type: text/x-patch
Size: 3714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230610/afd954bf/attachment.bin>


More information about the libcxx-commits mailing list