[libcxx-commits] [PATCH] D152612: [libc++][spaceship] P1614R2: Removed global `operator!=` from `allocator`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 11 11:20:54 PDT 2023


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

Removed macro


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152612

Files:
  libcxx/docs/Status/SpaceshipProjects.csv
  libcxx/include/__memory/allocator.h
  libcxx/include/memory


Index: libcxx/include/memory
===================================================================
--- libcxx/include/memory
+++ libcxx/include/memory
@@ -160,7 +160,7 @@
 bool operator==(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
 
 template <class T, class U>
-bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
+bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // removed in C++20
 
 template <class OutputIterator, class T>
 class raw_storage_iterator // deprecated in C++17, removed in C++20
Index: libcxx/include/__memory/allocator.h
===================================================================
--- libcxx/include/__memory/allocator.h
+++ libcxx/include/__memory/allocator.h
@@ -262,10 +262,14 @@
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
 
+#if _LIBCPP_STD_VER <= 17
+
 template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_INLINE_VISIBILITY
 bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
 
+#endif
+
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___MEMORY_ALLOCATOR_H
Index: libcxx/docs/Status/SpaceshipProjects.csv
===================================================================
--- libcxx/docs/Status/SpaceshipProjects.csv
+++ libcxx/docs/Status/SpaceshipProjects.csv
@@ -52,7 +52,7 @@
 "| `[template.bitset] <https://wg21.link/template.bitset>`_
 | `[bitset.members] <https://wg21.link/bitset.members>`_","| remove ops `bitset <https://reviews.llvm.org/D152611>`_",None,Hristo Hristov,|In Progress|
 | `[memory.syn] <https://wg21.link/memory.syn>`_,|,None,Unassigned,|Not Started|
-| `[allocator.globals] <https://wg21.link/allocator.globals>`_,| remove ops `allocator <https://reviews.llvm.org/D152612>`_,None,Hristo Hristov,|In Progress|
+| `[allocator.globals] <https://wg21.link/allocator.globals>`_,| remove ops `allocator <https://reviews.llvm.org/D152612>`_,None,Hristo Hristov,|Complete|
 | `[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>`_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152612.530313.patch
Type: text/x-patch
Size: 2525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230611/4ca58c90/attachment-0001.bin>


More information about the libcxx-commits mailing list