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

Move [range.counted] from [range.adaptors] to [range.factories] #625

Open
ericniebler opened this issue May 17, 2019 · 3 comments
Open

Move [range.counted] from [range.adaptors] to [range.factories] #625

ericniebler opened this issue May 17, 2019 · 3 comments

Comments

@ericniebler
Copy link
Owner

It isn't a range adaptor. It's a range factory.

Proposed Resolution

At the editor's discretion.

@CaseyCarter
Copy link
Collaborator

CaseyCarter commented May 17, 2019

view::counted(i, n) adapts the counted range [i, n) into the iterator/sentinel range [i, i+n) or [counted_iterator{i, n}, default_sentinel), no?

@ericniebler
Copy link
Owner Author

ericniebler commented May 17, 2019

In a manner of speaking, yes, I suppose so. But the other range adaptors support pipe syntax. And view::counted just feels more like a factory than an adaptor.

Feel free to close if you disagree.

@h-2
Copy link

h-2 commented May 17, 2019

But the other range adaptors support pipe syntax

I also think it would be helpful to have some overlap between semantic rules and syntactic rules and I think "you can pipe something into it" is a good rule for disambiguating adaptors and factories – if the distinction is one that we want to make at all; I could live with all of them being called adaptors, but I sense confusion around the topic 😉

This also affects view::zip which does not accept a range but is documented as a "range adaptor" in the last proposal IIRC.

For the concrete example of view::counted I thought the main purpose of it was to beused in cases where you have no range and just an iterator, right? In the other cases you can use view::take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants