Skip to content
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.syn] Fix the constraints order of slide_view #5519

Merged
merged 1 commit into from Jun 12, 2022

Conversation

hewillk
Copy link
Contributor

@hewillk hewillk commented Jun 11, 2022

No description provided.

@jensmaurer
Copy link
Member

Why is the other order "better"?

@hewillk
Copy link
Contributor Author

hewillk commented Jun 11, 2022

I don't think it's better, I just fixed it with minimal changes.

@jensmaurer
Copy link
Member

Why is it a "fix"? The end result is two constraints, it seems.

@hewillk
Copy link
Contributor Author

hewillk commented Jun 11, 2022

The constraint orders matter, they are different things, you can not

namespace std::ranges {
template<view V>
  requires forward_range<V>
class slide_view;

template<forward_range V>
  requires view<V>
class slide_view { };
}

I think you may have misunderstood my intention as I didn't mention more in the comments, sorry.

@JohelEGP
Copy link
Contributor

Because the order is relevant: https://godbolt.org/z/3MPrfeWq6. In this case, the fix orders the constraints like in its class synopsis and those of its iterator/sentinel pair.

@jensmaurer
Copy link
Member

Ah, ok, this is making the declarations consistent across the synopsis and the iterator/sentinel. Thanks.

@tkoeppe tkoeppe merged commit d86e1ef into cplusplus:main Jun 12, 2022
@hewillk hewillk deleted the main-slide branch June 14, 2022 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants