[libcxx-commits] [PATCH] D130853: [libc++] Remove `operator!=` from `type_info` in C++20

Adrian Vogelsgesang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 31 12:55:31 PDT 2022


avogelsgesang created this revision.
Herald added a subscriber: smeenai.
Herald added a project: All.
avogelsgesang requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Implements part of:

- P1614R2 The Mothership has Landed


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130853

Files:
  libcxx/include/typeinfo


Index: libcxx/include/typeinfo
===================================================================
--- libcxx/include/typeinfo
+++ libcxx/include/typeinfo
@@ -22,7 +22,7 @@
     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 @@
       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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130853.448879.patch
Type: text/x-patch
Size: 774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220731/9ac18367/attachment.bin>


More information about the libcxx-commits mailing list