[libcxx-commits] [libcxx] [libc++] Implement ranges::iota (PR #68494)

James E T Smith via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 28 11:35:14 PDT 2024


================
@@ -100,6 +101,11 @@ constexpr void run_tests() {
   test(std::ranges::search, in, in2);
   test(std::ranges::search_n, in, count, x);
   test(std::ranges::find_end, in, in2);
+#if TEST_STD_VER >= 23
+  if constexpr (std::copyable<T>) {
----------------
jamesETsmith wrote:

This conditional filters out the tests using `MoveOnly` which is not `std::weakly_incrementable` so just doing `T{}` wouldn't work. I agree that it's not desirable to have lots of conditional blocks, but it's at least consistent with similar `if`-statements in this file that predate this PR ([example here)](https://github.com/llvm/llvm-project/blob/5f0389c42b539cfc54d82176894b96b44ca1bd7b/libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp#L126-L131).

https://github.com/llvm/llvm-project/pull/68494


More information about the libcxx-commits mailing list