Skip to content
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

<functional>: Constrain functions used by std::bind #3577

Merged
merged 4 commits into from
Mar 28, 2023

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Mar 16, 2023

Fixes #952.

The issue is probably because of that some functions used by bind are not well constrained.

  • _Invoker_ret<_Rx>::_Call ("backported invoke_r") is not constrained at all.
  • the return types of some _Select_fixer<...>::_Fix/_Apply rely on std::get for tuple, which is not constrained.

Driven-by changes: use direct if constexpr and invoke in the internal functions used by function and move_only_function (similar to the use in invoke_r), which may slightly improve compiler throughput.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner March 16, 2023 18:20
@github-actions github-actions bot added this to Initial Review in Code Reviews Mar 16, 2023
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Mar 16, 2023
@StephanTLavavej StephanTLavavej self-assigned this Mar 22, 2023
@StephanTLavavej
Copy link
Member

Thanks! Product code looked good, I pushed a commit to fix and enhance the test code. 😸

@StephanTLavavej StephanTLavavej removed their assignment Mar 25, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Mar 25, 2023
@strega-nil-ms strega-nil-ms moved this from Final Review to Ready To Merge in Code Reviews Mar 27, 2023
@StephanTLavavej StephanTLavavej self-assigned this Mar 28, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit e863967 into microsoft:main Mar 28, 2023
Code Reviews automation moved this from Ready To Merge to Done Mar 28, 2023
@StephanTLavavej
Copy link
Member

Thanks! One PR to rule them all and in the darkness bind them! 💍 🧙 😹

@frederick-vs-ja frederick-vs-ja deleted the bind-constraints branch March 28, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

<functional>: std::is_convertible is broken for std::bind functors
3 participants