Fix the interaction between _Pass_fn and invoke #1091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
_Pass_fnreturns a copy of arguments no larger thanvoid*, and a call-forwarding reference-wrapper-alike_Ref_fnfor larger function objects. This became a problem when Ranges started throwing pointers-to-member at_Pass_fnwith the expectation that they would eventually beinvoked: pointers-to-member can be larger thanvoid*, but_Ref_fndoesn't speak theinvokeprotocol.There are two relatively obvious possible fixes:
_Pass_fnto always return copies of pointers-to-member regardless of size_Ref_fnto obey theinvokeprotocol(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_fnto call-forward throughinvokewhen it wraps a pointer-to-member.Fixes GH-1089.