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

Negative indexing on slice #77

Open
gaffney2010 opened this issue May 28, 2020 · 1 comment
Open

Negative indexing on slice #77

gaffney2010 opened this issue May 28, 2020 · 1 comment

Comments

@gaffney2010
Copy link

Have you thought about adding functionality for Python-style negative indices on the slice function?

@ryanhaining
Copy link
Owner

Yeah, I would also like to be able to use that, but it's pretty complicated to implement. Everything in iter::slice needs to work with types that don't support std::prev / operator--, so there would be some wacky complie-time conditional work. The best I could say for now would be to use iter::slice + iter::reversed, unless you can point to a case where that doesn't get what you want?

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

No branches or pull requests

2 participants