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

Will Hawkins via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 11 07:28:31 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
+// UNSUPPORTED: no-exceptions
+// UNSUPPORTED: !libcpp-hardening-mode=debug
+// XFAIL: availability-verbose_abort-missing
+
+// <ranges>
+
+// Call ....
+
+#include "check_assertion.h"
+#include <ranges>
+
+void cannot_increment_at_the_end_iterator() {
+  int range[]   = {1, 2, 3};
+  auto striv    = std::ranges::views::stride(range, 3);
+  auto striv_it = striv.begin();
+  striv_it++;
+  TEST_LIBCPP_ASSERT_FAILURE(striv_it++, "Cannot increment an iterator already at the end.");
+}
+
+int main() {
----------------
hawkinsw wrote:

I believe that this is addressed in 93e5bcfea6792e9f8e28e0199b372819f61ddd71.

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


More information about the libcxx-commits mailing list