Created on 2024-05-10.00:00:00 last changed 4 months ago
Proposed resolution:
This wording is relative to N4981.
Modify [range.as.rvalue.overview] as indicated:
-2- The name views::as_rvalue denotes a range adaptor object ([range.adaptor.object]). Let E be an expression and let T be decltype((E)). The expression views::as_rvalue(E) is expression-equivalent to:
(2.1) — views::all(E) if same_as<range_rvalue_reference_t<views::all_t<T>>, range_reference_t<views::all_t<T>>> is true.
(2.2) — Otherwise, as_rvalue_view(E).
Modify [range.common.overview] as indicated:
-3- The name views::common denotes a range adaptor object ([range.adaptor.object]). Given a subexpression E, the expression views::common(E) is expression-equivalent to:
(3.1) — views::all(E), if
decltype((E))views::all_t<T>
models common_rangeand views::all(E) is a well-formed expression.(3.2) — Otherwise, common_view{E}.
[ 2024-06-24; Reflector poll ]
Set priority to 4 after reflector poll. "Not aware of any use case for making `const` affect those properties".
Currently, these two adaptors return views::all(E)
when the type of subexpression E
models common_range
or its reference is the same as the rvalue reference.
range
type must have the same non-commonality or value category of the reference as the non-const
one,
this makes it theoretically possible for these two to still return non-common ranges or ranges whose reference
are lvalue when acting on a const
-qualified lvalue view
object, because
views::all(E)
will remove the const
-qualifier.
The proposed wording pedantically checks views::all_t<decltype((E))>
instead of decltype((E)).
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-06-24 12:09:57 | admin | set | messages: + msg14191 |
2024-05-12 11:08:33 | admin | set | messages: + msg14136 |
2024-05-10 00:00:00 | admin | create |