8000 Remove use of std::iterator by nvander1 · Pull Request #45 · ryanhaining/cppitertools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove use of std::iterator #45

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

Merged
merged 2 commits into from
Mar 5, 2018
Merged

Remove use of std::iterator #45

merged 2 commits into from
Mar 5, 2018

Conversation

nvander1
Copy link
Contributor
@nvander1 nvander1 commented Mar 5, 2018

In response to #31.

I tried running clang-format with your .clang-format file but it also made changes on lines I hadn't touched,
so I undid those changes.

You can grep -rs 'std::iterator<' . to double check that all inheritances from std::iterator are gone.

range.hpp Outdated
using value_type = T;
using difference_type = std::ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the annoying thing, the way range() is set up, reference is still T rather than T&. I've stressed over this a lot and questioned std::vector::iterator in the process, unfortunately reference = T is the current state of things

@ryanhaining
Copy link
Owner

Holy shit! Thank you for doing this. I have one comment about range() but other than that this looks great. Much appreciated

Range<T>::Iterator::reference == Range<T>::Iterator::value_type
@nvander1
Copy link
Contributor Author
nvander1 commented Mar 5, 2018

No problem! Fixed up that using alias in Range::Iterator. That's an odd quirk about the std::vector. I just looked through 7.3.0/bits/stl_bvector.h to check out that proxy _Bit_reference object. Coincidentally, std::vector::iterator still indirectly inherits from std::iterator.

@ryanhaining ryanhaining merged commit c7434b3 into ryanhaining:master Mar 5, 2018
@ryanhaining
Copy link
Owner

merged into cpp17 as well. I just looked at your profile that you going to Binghamton, did I meet you on my recruiting trips a couple years ago?

@nvander1
Copy link
Contributor Author
nvander1 commented Mar 5, 2018

Yeah we met briefly. You also gave Jack, Ethan and I some suggestions on that C++ web-browser hackathon project that we unfortunately never did anything with after the hackathon.

@ryanhaining
Copy link
Owner

I didn't really expect anyone to continue working on that browser, it was more of me being a c++ teacher

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.

2 participants
0