-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unnecessary-value-param to match templated functions including …
…lambdas with auto. Clang-Tidy unnecessary-value-param value param will be triggered for templated functions if at least one instantiontion with expensive to copy type is present in translation unit. It is relatively common mistake to write lambda functions with auto arguments for expensive to copy types. Example: Copy of the vectors will happen on every comparison. void SortBySize(std::vector<std::vector<int>>& a) { std::sort( a.begin(), a.end(), [](auto x, auto y) { return a.size() < b.size()}); }
- Loading branch information
%username%
committed
Jul 4, 2024
1 parent
1cf4340
commit 593b336
Showing
2 changed files
with
2 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters