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

Kent Ross via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 12 11:21:22 PDT 2022


mumbleskates added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp:62
+}
+
+constexpr bool test() {
----------------
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.


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