[libcxx-commits] [libcxx] 8cf3c29 - [libc++][spaceship] P1614R2: Removed `operator!=` from `scoped_allocator_adaptor`

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 12 09:51:34 PDT 2023


Author: Hristo Hristov
Date: 2023-06-12T19:51:27+03:00
New Revision: 8cf3c2920d03b750124eae44f036afe702945179

URL: https://github.com/llvm/llvm-project/commit/8cf3c2920d03b750124eae44f036afe702945179
DIFF: https://github.com/llvm/llvm-project/commit/8cf3c2920d03b750124eae44f036afe702945179.diff

LOG: [libc++][spaceship] P1614R2: Removed `operator!=` from `scoped_allocator_adaptor`

Implements parts of P1614R2
- Removed `operator!=` from `scoped_allocator_adaptor`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152678

Added: 
    

Modified: 
    libcxx/docs/Status/SpaceshipProjects.csv
    libcxx/include/scoped_allocator

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/Status/SpaceshipProjects.csv b/libcxx/docs/Status/SpaceshipProjects.csv
index 3d02691127c16..9e40bac7a62c7 100644
--- a/libcxx/docs/Status/SpaceshipProjects.csv
+++ b/libcxx/docs/Status/SpaceshipProjects.csv
@@ -61,7 +61,7 @@ Section,Description,Dependencies,Assignee,Complete
 | 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|
+| `[scoped.adaptor.operators] <https://wg21.link/scoped.adaptor.operators>`_",| remove ops `scoped_allocator_adaptor <https://reviews.llvm.org/D152678>`_,None,Hristo Hristov,|Complete|
 "| `[functional.syn] <https://wg21.link/functional.syn>`_
 | `[range.cmp] <https://wg21.link/range.cmp>`_
 | `[func.wrap.func] <https://wg21.link/func.wrap.func>`_

diff  --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator
index bb61a7cd1b086..30e0310cda6a5 100644
--- a/libcxx/include/scoped_allocator
+++ b/libcxx/include/scoped_allocator
@@ -103,7 +103,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
 template <class OuterA1, class OuterA2, class... InnerAllocs>
     bool
     operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
-               const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
+               const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept; // removed in C++20
 
 }  // std
 
@@ -703,6 +703,8 @@ operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>&
            __a.inner_allocator() == __b.inner_allocator();
 }
 
+#if _LIBCPP_STD_VER <= 17
+
 template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
@@ -712,6 +714,8 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
     return !(__a == __b);
 }
 
+#endif // _LIBCPP_STD_VER <= 17
+
 #endif // !defined(_LIBCPP_CXX03_LANG)
 
 _LIBCPP_END_NAMESPACE_STD


        


More information about the libcxx-commits mailing list