-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chunk_by_view's helper lambda returns bool
#2890
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
Conversation
miscco
left a comment
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.
We are missing some additional test coverage.
strega-nil-ms
left a comment
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.
Removing my approval as I do not believe it correctly implements the standard.
strega-nil-ms
left a comment
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.
It definitely took a bit to convince me that this is correct, but I have now been convinced.
CaseyCarter
left a comment
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.
Small suggestions, of which we have enough that I think I should push changes.
| #else // ^^^ no workaround / workaround vvv | ||
| indirect_result_t<_Proj&, _It> operator*() const { | ||
| _CSTD abort(); // TRANSITION, VSO-1308657 | ||
| _CSTD abort(); |
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.
For reviewers:
projected is a tool to simplify expressing the requirements of algorithms that use projections. The design intent is that the member functions don't have definitions - they are just signatures that exist for iter_reference_t et al. to look at. This hasn't worked well in practice in the real world, as witnessed by the warning suppressions for clang and MSVC around the definition, the additional bug report (VSO-1308657) mentioned there, and the fact that it broke yet again when I made Bool a local class in that PR. The PR uses projected<Bool*, identity>, and clang-cl decided to report an error about operator* being used-but-not-defined when it can't possibly be defined in another TU since Bool has internal linkage. Rather than trying to find yet another workaround for this perennial issue (four or five changes here in ~3 years?) I decided to give up and simply always define operator* to call abort. The function should never be called in practice, so even if it does end up emitted into some object files the linker should be able to clean it up.
strega-nil-ms
left a comment
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 am sad about projected::operator*, but cools.
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for fixing this compiler error and improving the ranges experience! 😻 🐞 🎉 |
Co-authored-by: Casey Carter <[email protected]>
Co-authored-by: Casey Carter <[email protected]>
Fixes #2889
Casey's drive-by: Give up on the Standard's dream that we can avoid defining
projected::operator*. There are just too many interactions with the "need for constant evaluation" rules and the use of types with internal linkage - it's not worth fighting anymore.