[libcxx-commits] [PATCH] D96477: [libcxx] adds remaining callable concepts

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 21 07:21:07 PST 2021


Mordante added inline comments.


================
Comment at: libcxx/include/concepts:228
+  { !std::forward<_Tp>(__t) } -> __boolean_testable_impl;
+};
+
----------------
I'm somewhat surprised the concept is define like this in the Standard, but http://eel.is/c++draft/concept.booleantestable#2 has additional constrains.
Did I miss the tests for this concept? I'd like some tests, https://en.cppreference.com/w/cpp/concepts/boolean-testable has some examples of valid types: `bool`, `std::true_type`, `std::bitset<N>::reference`, and `int*`.


================
Comment at: libcxx/test/std/concepts/callable/equiv.compile.pass.cpp:13
+// template<class F, class T, class U>
+// concept relation;
+
----------------
Copy-paste.


================
Comment at: libcxx/test/std/concepts/callable/functions.h:57
+struct Equivalent {
+  Bool operator()(int X, long Y) const noexcept { return {.Value = X == Y}; }
+};
----------------
The `.Value =` isn't required right?I think this makes it harder to read.


================
Comment at: libcxx/test/std/concepts/callable/strictweakorder.compile.pass.cpp:13
+// template<class F, class T, class U>
+// concept relation;
+
----------------
Copy-paste.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96477



More information about the libcxx-commits mailing list