[libcxx-commits] [PATCH] D131430: [libc++] Implement `thread::id` comparators as free functions

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 10 08:46:54 PDT 2022


Mordante added a comment.

Thanks for fixing this bug!
Can you mention this change to the API changes of the release documentation?



================
Comment at: libcxx/include/__threading_support:619
 
+    friend _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT;
+    friend _LIBCPP_HIDE_FROM_ABI bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT;
----------------
Is there a reason to make all 6 of them friends? I would only `operator==` and `operator<` to be a friend.


================
Comment at: libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/eq.pass.cpp:36
+    // libc++ previously declared the comparison operators as hidden friends
+    // which was non-conforming.
+    assert(!std::operator==(id1, id0));
----------------
Nice!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131430



More information about the libcxx-commits mailing list