Ranges: C++20 defect fixes
Borrowed/view semantics, adaptor object rules, default-constructibility, poison pills, move-only adaptors and the other C++20 ranges repairs.
Connected features
Papers
19 · Virtual Feb 2021 → Issaquah 2023Makes adaptors like take_view/drop_view conditionally borrowed, so their iterators outlive the view when the underlying range is borrowed.
Repairs input-range adaptors and counted_iterator (iterator_category only for forward iterators, operator->).
Fixes split_view so splitting a string yields string-like subranges; the old lazy form becomes lazy_split_view (DR C++20).
Clarifies that range adaptor objects bind their arguments by value and how pipelines compose (resolves LWG3509/3510).
Drops the requirement that views be default-constructible (DR C++20).
Allows join_view to join ranges of prvalue non-view ranges by boxing them (DR C++20).
Removes list-initialization from the ranges specification where it caused narrowing and ambiguity (DR C++20).
Cleans up the specification of integer-class types used by iota_view and friends.
Redefines view as cheap to copy/move/destroy rather than O(1) copy, and adds owning_view (DR C++20).
Fixes istream_view to follow the adaptor conventions (views::istream<T>) (DR C++20).
Allows move-only types to satisfy equality_comparable_with, totally_ordered_with and three_way_comparable_with.
Lets iterators that only model the C++20 iterator concepts be used with the classic algorithms.
Relaxes range adaptors to accept move-only callables and types.
Makes move_iterator<T*> a random-access iterator.
Improved wording for LWG2114: what 'contextually convertible to bool' requires of predicates.
Reworks the poison-pill overloads of the ranges CPOs so ADL-found begin/end/size work for more types.
Relaxes the indirect callable concepts so projections and predicates need not accept the iterator's common reference type.
Makes multi-parameter constructors of the standard views explicit.
Makes join_view/join_with_view handle stashing iterators (iterators that own the element they return).