[libcxx-commits] [libcxx] 7c96cd3 - [libc++][spaceship] P1612R2: Removed `operator!=` from `bitset`
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jun 11 23:26:57 PDT 2023
Author: Hristo Hristov
Date: 2023-06-12T09:26:51+03:00
New Revision: 7c96cd35bf5df1ffa0b268a11e99a291ab4883c2
URL: https://github.com/llvm/llvm-project/commit/7c96cd35bf5df1ffa0b268a11e99a291ab4883c2
DIFF: https://github.com/llvm/llvm-project/commit/7c96cd35bf5df1ffa0b268a11e99a291ab4883c2.diff
LOG: [libc++][spaceship] P1612R2: Removed `operator!=` from `bitset`
Implements parts of P1612R2:
- Removed `operator!=` from `bitset`
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D152611
Added:
Modified:
libcxx/docs/Status/SpaceshipProjects.csv
libcxx/include/bitset
Removed:
################################################################################
diff --git a/libcxx/docs/Status/SpaceshipProjects.csv b/libcxx/docs/Status/SpaceshipProjects.csv
index aff1da905986e..b8eaa76af1a51 100644
--- a/libcxx/docs/Status/SpaceshipProjects.csv
+++ b/libcxx/docs/Status/SpaceshipProjects.csv
@@ -50,7 +50,7 @@ Section,Description,Dependencies,Assignee,Complete
| `[variant.monostate.relops] <https://wg21.link/variant.monostate.relops>`_","| `monostate <https://reviews.llvm.org/D131372>`_
| `variant <https://reviews.llvm.org/D131372>`_",None,Kent Ross,|Complete|
"| `[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|
+| `[bitset.members] <https://wg21.link/bitset.members>`_","| remove ops `bitset <https://reviews.llvm.org/D152611>`_",None,Hristo Hristov,|Complete|
| `[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|
| `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_,| `unique_ptr <https://reviews.llvm.org/D130838>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index fc8ffb882e6d5..afd95a71eae9c 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -79,7 +79,7 @@ public:
size_t count() const noexcept; // constexpr since C++23
constexpr size_t size() const noexcept; // constexpr since C++23
bool operator==(const bitset& rhs) const noexcept; // constexpr since C++23
- bool operator!=(const bitset& rhs) const noexcept; // constexpr since C++23
+ bool operator!=(const bitset& rhs) const noexcept; // removed in C++20
bool test(size_t pos) const; // constexpr since C++23
bool all() const noexcept; // constexpr since C++23
bool any() const noexcept; // constexpr since C++23
@@ -761,8 +761,10 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const bitset& __rhs) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
+#if _LIBCPP_STD_VER <= 17
+ _LIBCPP_INLINE_VISIBILITY
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
+#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool test(size_t __pos) const;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -1041,15 +1043,19 @@ bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
}
+#if _LIBCPP_STD_VER <= 17
+
template <size_t _Size>
inline
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
+_LIBCPP_HIDE_FROM_ABI
bool
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
{
return !(*this == __rhs);
}
+#endif
+
template <size_t _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
bool
More information about the libcxx-commits
mailing list