-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<algorithm>: Use iter[idx] for clarity #289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace changes are needed to pass clang-format validation; other than that, these changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to merge this without test changes; defending against regression of clarity seems like a hard problem.
I'm porting this to our Microsoft-internal MSVC repo now, for a full build and test run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said, I'm still concerned about backcompat fallout; as long as RWC comes back OK I agree this is nicer.
Thanks for implementing this enhancement! MSVC's internal test suites have passed, so I've merged your change for the VS 2019 16.5 Preview 2 release. Another test suite of "Real World Code" projects will run (it takes longer), compiling various open-source programs with the updated STL. If we encounter breaking changes there, we'll submit fixes to those projects and document this as a significant breaking change (although I think that's unlikely). |
Fix merged: facebook/rocksdb#6047 |
This fix has some interesting side-effects with boost::iterator_facade. |
Formally I am forcefully reminded that half of the reason for using Concepts in Ranges was to clean up the horrid mess that is the legacy algorithm requirements. |
(Aside: I don't know how much we should concern ourselves specifically with |
IMO we should just ban |
Those Predicate requirements are an unfortunate surprise to me. Although I thought that subscripting improved clarity, I agree that we should revert this PR and enhance our test coverage. I'll take care of that. |
This reverts microsoft#289 and changes several more algorithms. Unrelated cleanup: this changes one occurrence of `[[nodiscard]]` to `_NODISCARD` for consistency.
thanks a lot to all |
Sorry if this is not the right place to ask but 16.5.0 was released still breaking boost::iterator_facade. Will there be a 16.5.x update that fixes this ? |
Probably not, #464 was merged well after the 16.5 lockdown. |
Description
Replace *(iter+idx) to iter[idx] for clarity #278
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Ugly
as perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft as a reference (and any other cited standards).
If they were derived from a project that's already listed in NOTICE.txt,
that's fine, but please mention it. If they were derived from any other
project (including Boost and libc++, which are not yet listed in
NOTICE.txt), you must mention it here, so we can determine whether the
license is compatible and what else needs to be done.