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

Jakub Mazurkiewicz via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 25 11:27:39 PDT 2023


================
@@ -266,6 +266,13 @@ export namespace std {
       using std::ranges::views::zip;
     } // namespace views
 
+    // [range.stride], stride view
+    using std::ranges::stride_view;
+
+    namespace views {
+      using std::ranges::views::stride;
+    }
+
----------------
JMazurkiewicz wrote:

> In C++20 there is an extension that would enable the use of this module.

Yes, it is documented here: https://libcxx.llvm.org/Modules.html

> `std::ranges::stride_view` is only available as of C++23. So, in the case where this module was used as an extension in a C++20-compatible compiler, without this guard there would be a problem.

Yes, I've got bitten by it too while implementing [`views::chunk_by`](https://reviews.llvm.org/D144767#4639510).

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


More information about the libcxx-commits mailing list