[libcxx-commits] [libcxx] [libc++][ranges] LWG4083: `views::as_rvalue` should reject non-input ranges (PR #155156)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 1 18:12:57 PDT 2025


================
@@ -48,6 +48,16 @@ struct move_iterator_range {
 static_assert(!std::ranges::view<move_iterator_range>);
 static_assert(std::ranges::range<move_iterator_range>);
 
+// LWG4083: views::as_rvalue should reject non-input ranges
+struct I {
+  int operator*();
+  using difference_type = int;
+  I& operator++();
+  void operator++(int);
+};
+static_assert(
----------------
frederick-vs-ja wrote:

I think it's better to verify `!std::is_invocable_v<...>` together.

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


More information about the libcxx-commits mailing list