You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the conversion operator defers back to ranges::empty(). While I believe that it is implied in ranges::empty() it would improve readability/consistency to require forward_range<D>/forward_range<const D>.
The text was updated successfully, but these errors were encountered:
Unless you can show that a WG21-approved paper was misapplied by the editors, all of your concerns seem to be non-editorial. Note that requires-clauses contribute to partial ordering, which might be detectable once user-supplied overloads end up in an overload set. @CaseyCarter , could you please forward to LWG?
Life is hard, from conversation with @CaseyCarter :
data() has no requirement on range<Derived> as that is implicit in the requirements of Derived as view<Derived> implies range<Derived>. So this is technically correct, although I would question whether it is good practise to omit the -tautological- requirement only at that single place.
operator() must not be restricted on forward_range as a user might write a custom container that does not fulfill the forward_range requirement. Moreover, if I understand CRTP correctly even for the forward_range case view_interface::empty() would be hidden if there is a Derived::empty() and correctly selected by ranges::empty()
operator[] is worse. As Derived might be an incomplete type range_difference_t<Derived> might not compile. By using the indirection template<random_access_range R = Derived> the operator[] is only ever synthesized once it is used and Derived is complete.
In the first paragraph there seem to be some inconsistencies in the current draft.
The
data()
methods are depicted as follows:Note that the non-const member function is missing the
range<D>
requirementThe
operator[]
member functions are the only ones written in the "old" template styleThey should be written with a
requires
clause similar to all other methods.Finally, the implicit conversion opterator seems to be missing a requirement too.
Note that the conversion operator defers back to
ranges::empty()
. While I believe that it is implied inranges::empty()
it would improve readability/consistency to requireforward_range<D>
/forward_range<const D>
.The text was updated successfully, but these errors were encountered: