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>: Deleted operator() overloads for return types of bind, bind_front, and bind_back #3775

Merged
merged 5 commits into from Jul 14, 2023

Conversation

frederick-vs-ja
Copy link
Contributor

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

The deleted overloads prevent overload resolution flowing into another unintended overload when the invocation should be (SFINAE-friendlily) ill-formed.

Since the operator() overloads are constrained in default template arguments now, I think it would be better to use decltype(auto) to specify the return types.

There seems to be something wrong with modules when using traditional SFINAE, so I'm changing to use requires when possible.

Unblock one libc++ test:

  • std/utilities/function.objects/func.bind_front/bind_front.pass.cpp

The test seemly requires bind_front to be SFINAE-friendly, while the Standard uses "Mandates:"... As a result, I decided to copy some parts of that file into MSVC STL's test file.

Driven-by: _STD-qualify the internal calling helpers.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner June 16, 2023 17:19
@github-actions github-actions bot added this to Initial Review in Code Reviews Jun 16, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Work In Progress in Code Reviews Jun 16, 2023
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Jun 16, 2023
@StephanTLavavej StephanTLavavej moved this from Work In Progress to Initial Review in Code Reviews Jun 17, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jun 19, 2023
@StephanTLavavej
Copy link
Member

The test seemly requires bind_front to be SFINAE-friendly

My mother was an English teacher so I feel compelled to explain 😸 - "seemingly" is the word to use here (like "apparently"). "seemly" is a completely different word (and is rarely used; usually only the antonym "unseemly" is used). 📚

Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll validate and push changes...

stl/inc/functional Outdated Show resolved Hide resolved
stl/inc/functional Outdated Show resolved Hide resolved
stl/inc/functional Outdated Show resolved Hide resolved
stl/inc/functional Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej removed their assignment Jul 8, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Jul 8, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jul 13, 2023
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in Code Reviews Jul 13, 2023
@StephanTLavavej StephanTLavavej merged commit df4dc31 into microsoft:main Jul 14, 2023
35 checks passed
Code Reviews automation moved this from Ready To Merge to Done Jul 14, 2023
@StephanTLavavej
Copy link
Member

Thanks for improving this very tricky metaprogramming! 🛠️ ⚙️ 🎉

@frederick-vs-ja frederick-vs-ja deleted the bind-overloads branch July 14, 2023 02:33
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.

None yet

3 participants