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

Remove _For_each_tuple_element in scoped_lock #760

Merged
merged 5 commits into from
Apr 30, 2020

Conversation

bhardwajs
Copy link
Contributor

scoped_lock::~scoped_lock uses _For_each_tuple_element which is not
needed in C++17 because fold expressions can be used. This PR removes
_For_each_tuple_element from tuple and changes the dtor in scoped_lock
to use fold expression with std::apply.

To minimize the changes in test (VSO_0000000_instantiate_containers)
using _For_each_tuple_element, we copied this function to the test.

Closes #738

scoped_lock::~scoped_lock uses _For_each_tuple_element which is not
needed in C++17 because fold expressions can be used. This PR removes
_For_each_tuple_element from tuple and changes the dtor in scoped_lock
to use fold expression with std::apply.

To minimize the changes in test (VSO_0000000_instantiate_containers)
using _For_each_tuple_element, we copied this function to the test.
@bhardwajs bhardwajs requested a review from a team as a code owner April 27, 2020 23:27
stl/inc/mutex Outdated Show resolved Hide resolved
Address PR comments by adding _STD to scoped_lock::~scoped_lock() and
make the functions in VSO_0000000_instantiate_containers/test.cpp not
_Ugly.
@CaseyCarter CaseyCarter added the enhancement Something can be improved label Apr 28, 2020
Changing as per suggestion on PR review.

Co-Authored-By: Casey Carter <cartec69@gmail.com>
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.

Looks good. I found a few typos and other stylistic nitpicks; I'll just push changes to fix them, then I'll bundle this up with some other PRs that I'm going to merge into the MSVC-internal repo today. Thanks for cleaning this up!

stl/inc/mutex Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Apr 28, 2020
@StephanTLavavej StephanTLavavej merged commit d7f8558 into microsoft:master Apr 30, 2020
@StephanTLavavej
Copy link
Member

Thanks for this compiler throughput improvement! We've got unrelated test failures caused by other PRs colliding, so I went ahead and merged your PR with administrator powers.

@bhardwajs bhardwajs deleted the issue_738 branch April 30, 2020 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<mutex>: ~scoped_lock() can use fold expressions
4 participants