[libcxx-commits] [PATCH] D131395: [libc++] Implement `lexicographical_compare_three_way`

Adrian Vogelsgesang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 13 03:59:50 PDT 2022


avogelsgesang added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp:62
+}
+
+constexpr bool test() {
----------------
mumbleskates wrote:
> avogelsgesang wrote:
> > huixie90 wrote:
> > > The spec has explicitly specifies the return type ` -> decltype(__comp(*__first1, *__first2))` and this has a SFINAE effect.
> > > It would be good to test the SFINAE effect as well (if __comp is not callbale then the function should be SFINAEed out)
> > Sorry, but I don't quite understand this point. How should I check for SFINAE here?
> in C++20 (which you have the luxury of relying upon since this function is new in C++20) you can just make a concept and then `static_check` it.
still can't follow. Did you mean `static_assert`? Or is `static_check` something different?
How would I use a concept to `static_assert` that `std::lexicographical_compare_three_way` is excluded from a function overload set due to SFINAE?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131395



More information about the libcxx-commits mailing list