[libcxx-commits] [PATCH] D80902: [libcxx] adds lexicographical_compare_three_way
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 2 18:08:02 PDT 2020
cjdb added inline comments.
================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp:24
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 3};
----------------
curdeius wrote:
> Constexpr test is... minimal to say the least. I think it would be better to have a single constexpr function (for applicable cases) and call it once on runtime and once on compile time.
I can do that. This test is (mostly) a carbon copy of the test for std::lexicographical_compare, so many of your comments are also applicable to that test as well. That doesn't excuse me from improving this test, so I've applied the changes here.
Does libc++ have a way to assert based on whether it's compile-time or run-time yet?
================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp:12
+// template<InputIterator Iter1, InputIterator Iter2, CopyConstructible Compare>
+// constexpr bool
+// lexicographical_compare_three_way(Iter1 first1, Iter1 last1,
----------------
curdeius wrote:
> Bool?
Fixed. How many of your comments from the above are also applicable here?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80902/new/
https://reviews.llvm.org/D80902
More information about the libcxx-commits
mailing list