[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
This commit is contained in:
Hristo Hristov 2023-06-10 10:28:05 +03:00
parent 3d74398bd3
commit 7c96cd35bf
2 changed files with 10 additions and 4 deletions

View File

@ -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|

1 Section Description Dependencies Assignee Complete
50 | `[associative.set.syn] <https://wg21.link/associative.set.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | `multiset <https://reviews.llvm.org/D148416>`_ | `set <https://reviews.llvm.org/D148416>`_ [expos.only.func] Hristo Hristov |Complete|
51 | `[unord.map.syn] <https://wg21.link/unord.map.syn>`_ | remove ops `unordered_map <https://reviews.llvm.org/D152642>`_ | remove ops `unordered_multimap <https://reviews.llvm.org/D152642>`_ None Hristo Hristov |Complete|
52 | `[unordered.set.syn] <https://wg21.link/unordered.set.syn>`_ | remove ops `unordered_set <https://reviews.llvm.org/D152643>`_ | remove ops `unordered_multiset <https://reviews.llvm.org/D152643>`_ None Hristo Hristov |Complete|
53 | `[queue.syn] <https://wg21.link/queue.syn>`_ | `queue <https://reviews.llvm.org/D146066>`_ None Hristo Hristov |Complete|
54 | `[stack.syn] <https://wg21.link/stack.syn>`_ | `stack <https://reviews.llvm.org/D146094>`_ None Hristo Hristov |Complete|
55 | `[queue.ops] <https://wg21.link/queue.ops>`_ | `queue <https://reviews.llvm.org/D146066>`_ None Hristo Hristov |Complete|
56 | `[stack.ops] <https://wg21.link/stack.ops>`_ | `stack <https://reviews.llvm.org/D146094>`_ None Hristo Hristov |Complete|

View File

@ -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