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

[clang-tidy] Remove in-product uses of std::bind #16870

Merged
merged 4 commits into from Apr 29, 2024

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Mar 13, 2024

These changes were automatically generated by clang-tidy.

clang-tidy --checks=modernize-avoid-bind --fix

I have not bothered with the test code.

These changes were automatically generated by clang-tidy.

```
clang-tidy --checks=modernize-avoid-bind --fix
```
@@ -98,28 +98,28 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// GH#8969: pre-seed working directory to prevent potential races
_terminal->SetWorkingDirectory(_settings->StartingDirectory());

auto pfnCopyToClipboard = std::bind(&ControlCore::_terminalCopyToClipboard, this, std::placeholders::_1);
auto pfnCopyToClipboard = [this](auto&& PH1) { _terminalCopyToClipboard(std::forward<decltype(PH1)>(PH1)); };
Copy link
Member

Choose a reason for hiding this comment

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

I was tempted to replace all these Terminal callbacks with til::event now that we can use that in the core lib, but this is also better than before

Copy link
Member Author

Choose a reason for hiding this comment

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

Nah, til::event is only suitable for WinRT stuff. I don’t think we need to construct a whole whatever gets constructed for WinRT event invocations for something like these.

In fact, I am planning on moving ControlCore and Interactivity themselves away from WinRT!

@zadjii-msft zadjii-msft added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit af91e6e Apr 29, 2024
20 checks passed
@zadjii-msft zadjii-msft deleted the dev/duhowett/clang-tidy-fixes-1 branch April 29, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants