-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ranges] Parameter of range refinement should be named R #3457
Comments
Could you please be a little more specific? Sometimes, it's actually a "view" that is called V. |
Right. I mean that the definition of concepts that refine The following already use template<class R, class T>
concept output_range =
template<class R>
concept @\exposconcept{tiny-range}@ = The following should change template<class T>
concept range =
template<class T>
concept sized_range =
template<class T>
concept view =
template<class T>
concept input_range =
template<class T>
concept forward_range =
template<class T>
concept bidirectional_range =
template<class T>
concept random_access_range =
template<class T>
concept contiguous_range =
template<class T>
concept common_range =
template<class T>
concept viewable_range =
template<class T>
concept @\defexposconcept{forwarding-range}@ =
template<class R>
concept @\defexposconcept{simple-view}@ = Right now, the iterator concepts mostly use |
Indeed, the range adaptors use |
@CaseyCarter , are you ok with the suggested T -> R rename? |
I'm ambivalent. Pre-concepts, we used the names of template parameters to indicate requirements that the template argument must fulfill. Post-concepts, we generally pick a name that's short but still suggestive of the requirements that are explicit in a type-constraint or requires-clause ( Admittedly we're inconsistent about this in the existing library specification - I don't think anyone's given it much thought. In any case, I'm neither strongly in favor of nor strongly opposed to the change. EDIT:
This seems arbitrary to me. In: template <class T>
concept X = Meow<T> && Woof<T> && Buzz<T>; Should we change template <class T>
concept X = Meow<T> && requires { /* ... */ }; or template <class T>
concept X = requires { /* ... */ }; ? |
Such an aggregate concept could use
|
I don't see any compelling reason to use In fact, I'd say using |
Editorial meeting: Concepts are predicates. The name should not presuppose the outcome of the check. Thus, use "T" in concept definitions. |
Following the practice of iterator concepts,
range
refinements should name their to-be-range
parameterR
instead ofT
. A handful of exposition-only concepts andoutput_range<R, T>
(inevitably) already do.The text was updated successfully, but these errors were encountered: