Created on 2018-12-09.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4791.
Modify the ref-view class synopsis in [ranges.view.ref] as follows:
namespace std::ranges { template<Range R> requires is_object_v<R> class ref-view : public view_interface<ref-view<R>> { […] }; template<class R> ref_view(R&) -> ref_view<R>; }
[ 2018-12-16 Status to Tentatively Ready after six positive votes on the reflector. ]
In the specification of view::all in [range.all], paragraph 2.2 states that view::all(E) is sometimes expression-equivalent to "ref-view{E} if that expression is well-formed". Unfortunately, the expression ref-view{E} is never well-formed: ref-view's only non-default constructor is a perfect-forwarding-ish constructor template that accepts only arguments that convert to lvalues of the ref-view's template argument type, and either do not convert to rvalues or have a better lvalue conversion (similar to the reference_wrapper converting constructor ([refwrap.const]) after issue 2993).
Presumably this breakage was not intentional, and we should add a deduction guide to enable class template argument deduction to function as intended by paragraph 2.2.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2019-02-26 17:40:23 | admin | set | status: voting -> wp |
2019-01-21 04:50:04 | admin | set | status: ready -> voting |
2018-12-16 11:28:40 | admin | set | messages: + msg10258 |
2018-12-16 11:28:40 | admin | set | status: new -> ready |
2018-12-10 00:23:29 | admin | set | messages: + msg10252 |
2018-12-09 00:00:00 | admin | create |