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

P0288R9 move_only_function #2267

Merged
merged 117 commits into from
Dec 17, 2021

Conversation

AlexGuteniev
Copy link
Contributor

@AlexGuteniev AlexGuteniev commented Oct 10, 2021

Resolve #2241

stl/inc/functional Outdated Show resolved Hide resolved
stl/inc/functional Outdated Show resolved Hide resolved
@CaseyCarter CaseyCarter added the cxx23 C++23 feature label Oct 10, 2021
stl/inc/functional Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Dec 14, 2021
@StephanTLavavej StephanTLavavej removed their assignment Dec 15, 2021
@@ -1247,6 +1251,10 @@ union alignas(max_align_t) _Move_only_function_data {
// Treat a small function as if it has this size too if it fits and is trivially copyable.
inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*);

// The below functions are __stdcall as they are called by pointers from _Move_only_function_base::_Impl_t.
// (We use explicit __stdcall to make the ABI stable for translation units with different calling convention options.)
Copy link
Member

Choose a reason for hiding this comment

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

stdcall is not the default calling convention...

Copy link
Member

@StephanTLavavej StephanTLavavej Dec 16, 2021

Choose a reason for hiding this comment

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

That's correct - it's not the default calling convention, we just need to choose a fixed calling convention that isn't sensitive to /Gd /Gr /Gz /Gv. __stdcall is our usual modern preference as it's reportedly faster than __cdecl.

@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 b33a89e into microsoft:main Dec 17, 2021
@StephanTLavavej
Copy link
Member

Thanks for moving the STL's functionality forward to C++23! 😹 🚀 🎉

@AlexGuteniev AlexGuteniev deleted the move_only_function branch December 17, 2021 05:02
@MikeGitb
Copy link

MikeGitb commented Dec 17, 2021

Thansk @AlexGuteniev also from my side (looking forward to use it)

Any Idea, when this will be ABI locked? I was considering to play around with the ideas discussed in #2241 over christmas once there is a merged baseline.

@AlexGuteniev
Copy link
Contributor Author

@MikeGitb , as C++latest feature, this is not ABI blocked until C++23 is finalized, and the feature is moved from C++latest to C++23

@AlexGuteniev
Copy link
Contributor Author

Out of other good news, regarding devirtualization in vtable emulation.
DevCom-1554693 is Fixed in Pending Release; also it did not affect all /LTGC cases, only /LTCG:incremental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P0288R9 move_only_function
10 participants
  翻译: