[libcxx-commits] [libcxx] [libc++][ranges] Implement `ranges::stride_view`. (PR #65200)

Will Hawkins via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 17 18:49:11 PST 2023


================
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// ranges
+
+// std::views::stride_view
+
+#include "test.h"
+#include <ranges>
+
+constexpr bool test() {
+  using std::ranges::enable_borrowed_range;
+  // Make sure that a stride_view over neither a borrowable nor an unborrowable view
+  // is itself borrowable.
+  static_assert(!enable_borrowed_range<std::ranges::stride_view<MovedCopiedTrackedBasicView<int>>>);
----------------
hawkinsw wrote:

I believe that this is addressed in 7c60b12f920a3c97e578910160489c67304d4861.

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


More information about the libcxx-commits mailing list