Skip to content

clang-tidy: Add check modernize-use-transparent-functors

Add and apply clang-tidy check modernize-use-transparent-functors.

This check enforces the rule of preferring transparent functors to non-transparent. This improves readability and avoids errors when refactoring code.

Example:

// Avoid repeating the type name "MyClass" in std::less<>
std::map<MyClass, int, std::less<MyClass>> myMap;

// Prefer to use transparent functors
std::map<MyClass, int, std::less<>> myMap;

Merge request reports