P3411R5 — any_view (13 items) SG9, LEWG
Hui Xie, Louis Dionne, S. Levent Yilmaz, Patrick Roberts
This paper proposes adding std::ranges::any_view, a type-erased view that can hold any object satisfying the ranges::view concept while allowing customization of traversal category, sized, borrowed, copyable, and approximately_sized properties via a bitmask enum any_view_options. The design uses a primary template with defaulted parameters so that any_view and any_view work as input ranges out of the box, while more specific configurations can be expressed by ORing option flags. Full wording is provided, including the iterator and sentinel exposition-only nested types, constexpr support, and a move-only-by-default policy.

References — Anthropic Citations API

[1]
"static constexpr move_only = true;"
[2]
""any_views_options::contiguous" (2.11.1), "any_views_options::random_access" (2.11.2), "any_views_options::bidirectional" (2.11.3), "any_views_options::forward" (2.11.4),..."
[3]
"auto tmp = *this; --(*this); return tmp;"
[4]
"constexpr any_view &operator=(const any_view&)"
[5]
"constexpr any_view &operator=(any_view&&)"
[6]
"Paragraph 20 is used for both `operator->` Constraints ("Constraints: `Opts & any_view_options::contiguous` is `any_view_options::contiguous`") and `operator==` Constraints ("Constraints: `Opts &..."
[7]
"If either x has no target iterator object, or y has a target sentinel object, equivalent to: return false;"
[8]
"Preconditions: *this has a target iterator object."
[9]
"Opts & any_view_options::forward == any_view_options::forward"
[10]
"The specification for `operator-=(difference_type n)` at paragraph 18 only has an *Effects* clause."
[11] chars 224744–225072
"
https://github.com/bemanproject/any_view
Summary: P3411R5 proposes a type-erased view adaptor, any_view, that wraps any range satisfying a set of compile-time options (iterator category, value type, borrowability, move-only constraint) into a single type for use across ABI boundaries and in non-template contexts. The paper provides wording for a new subclause under [ranges] including the any_view class template, its type-erased iterator and sentinel, and a traits customization point. Eleven defects were found spanning specification correctness, wording consistency, and surface errors.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.