[libc++] Remove operator!= from type_info in C++20

Implements part of:

* P1614R2 The Mothership has Landed

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130853
This commit is contained in:
Adrian Vogelsgesang 2022-08-06 15:09:50 +02:00 committed by Mark de Wever
parent 735240b38f
commit 619e8f46f3
2 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Section,Description,Dependencies,Assignee,Complete
| `weak_order_fallback <https://reviews.llvm.org/D111514>`_
| `partial_order_fallback <https://reviews.llvm.org/D111514>`_",None,Arthur O'Dwyer,|Complete| [#note-strongorder]_
| `[alg.three.way] <https://wg21.link/alg.three.way>`_,| `lexicographical_compare_three_way <https://reviews.llvm.org/D80902>`_,[comparisons.three.way],Christopher Di Bella,|In Progress|
| `[type.info] <https://wg21.link/type.info>`_,| `typeinfo <https://reviews.llvm.org/D130853>`_,None,Adrian Vogelsgesang,|Complete|
| `[coroutine.handle.compare] <https://wg21.link/coroutine.handle.compare>`_,| `coroutine_handle <https://reviews.llvm.org/D109433>`_,[comparisons.three.way],Chuanqi Xu,|Complete|
| `[pairs.spec] <https://wg21.link/pairs.spec>`_,| `pair <https://reviews.llvm.org/D107721>`_,[expos.only.func],Kent Ross,|Complete|
| `[syserr.errcat.nonvirtuals] <https://wg21.link/syserr.errcat.nonvirtuals>`_,| error_category,[comparisons.three.way],Unassigned,|Not Started|

1 Section Description Dependencies Assignee Complete
12 | `[tuple.rel] <https://wg21.link/tuple.rel>`_ | `[syserr.compare] <https://wg21.link/syserr.compare>`_ | `tuple <https://reviews.llvm.org/D108250>`_ | error_code | error_condition [expos.only.func] None Kent Ross Unassigned |Complete| |Not Started|
13 | `[optional.relops] <https://wg21.link/optional.relops>`_ | `[optional.nullops] <https://wg21.link/optional.nullops>`_ | `[optional.comp.with.t] <https://wg21.link/optional.comp.with.t>`_ | `[tuple.rel] <https://wg21.link/tuple.rel>`_ | optional | nullopt | `tuple <https://reviews.llvm.org/D108250>`_ None [expos.only.func] Kent Ross |In Progress| |Complete|
14 | `[variant.relops] <https://wg21.link/variant.relops>`_ | `[variant.monostate.relops] <https://wg21.link/variant.monostate.relops>`_ | `[optional.relops] <https://wg21.link/optional.relops>`_ | `[optional.nullops] <https://wg21.link/optional.nullops>`_ | `[optional.comp.with.t] <https://wg21.link/optional.comp.with.t>`_ | monostate | variant | optional | nullopt None Kent Ross |In Progress|
15 | `[variant.relops] <https://wg21.link/variant.relops>`_ | `[variant.monostate.relops] <https://wg21.link/variant.monostate.relops>`_ | monostate | variant None Kent Ross |In Progress|
16 | `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_ | `unique_ptr <https://reviews.llvm.org/D130838>`_ [comparisons.three.way] Adrian Vogelsgesang |Complete|
17 | `[util.smartptr.shared.cmp] <https://wg21.link/util.smartptr.shared.cmp>`_ | `shared_ptr <https://reviews.llvm.org/D130852>`_ [comparisons.three.way] Adrian Vogelsgesang |Complete|
18 | `[type.index.members] <https://wg21.link/type.index.members>`_ | type_index None Unassigned |Not Started|

View File

@ -22,7 +22,7 @@ public:
virtual ~type_info();
bool operator==(const type_info& rhs) const noexcept;
bool operator!=(const type_info& rhs) const noexcept;
bool operator!=(const type_info& rhs) const noexcept; // removed in C++20
bool before(const type_info& rhs) const noexcept;
size_t hash_code() const noexcept;
@ -112,9 +112,11 @@ public:
return __compare(__arg) == 0;
}
#if _LIBCPP_STD_VER <= 17
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const type_info& __arg) const _NOEXCEPT
{ return !operator==(__arg); }
#endif
};
#else // !defined(_LIBCPP_ABI_MICROSOFT)
@ -337,9 +339,11 @@ public:
return __impl::__eq(__type_name, __arg.__type_name);
}
#if _LIBCPP_STD_VER <= 17
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const type_info& __arg) const _NOEXCEPT
{ return !operator==(__arg); }
#endif
};
#endif // defined(_LIBCPP_ABI_MICROSOFT)