-
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
Fix the interaction between _Pass_fn and invoke #1091
Conversation
... to handle member-pointers that are larger than `void*` correctly. Fixes microsoftGH-1089.
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.
Quantum cats! ⚛️ 🐱 Thanks, I think your solution is better than what I would have come up with.
It doesn't look like your title and message match the actual effects? |
Updated. |
Thanks for fixing this bug that you should have noticed months ago! |
_Pass_fn
returns a copy of arguments no larger thanvoid*
, and a call-forwarding reference-wrapper-alike_Ref_fn
for larger function objects. This became a problem when Ranges started throwing pointers-to-member at_Pass_fn
with the expectation that they would eventually beinvoke
d: pointers-to-member can be larger thanvoid*
, but_Ref_fn
doesn't speak theinvoke
protocol.There are two relatively obvious possible fixes:
_Pass_fn
to always return copies of pointers-to-member regardless of size_Ref_fn
to obey theinvoke
protocol(1) results in "large" pointers-to-member that can't be enregistered being copied and passed by hidden reference resulting in larger codesize than (2), but with no corresponding performance benefits. We therefore implement (2) by teaching
_Ref_fn
to call-forward throughinvoke
when it wraps a pointer-to-member.Fixes GH-1089.