<algorithm>: Use iter[idx] for clarity#289
Conversation
StephanTLavavej
left a comment
There was a problem hiding this comment.
Whitespace changes are needed to pass clang-format validation; other than that, these changes look good to me.
CaseyCarter
left a comment
There was a problem hiding this comment.
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. |
BillyONeal
left a comment
There was a problem hiding this comment.
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.
_Uglyas 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.