[clang-tools-extra] [clang-tidy] Add modernize-use-std-tie check (PR #191218)
Daniil Dudkin via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 9 16:53:51 PDT 2026
================
@@ -0,0 +1,28 @@
+.. title:: clang-tidy - modernize-use-std-tie
+
+modernize-use-std-tie
+=====================
+
+Suggests replacing manual field-by-field lexicographical comparisons with ``std::tie``.
+
+Manual implementations of ``operator<`` and ``operator>`` can be error-prone and verbose.
+Using ``std::tie`` makes the code more readable and optimizes branch prediction.
----------------
unterumarmung wrote:
> optimizes branch prediction
Seems like it is too speculative to be in the docs.
https://github.com/llvm/llvm-project/pull/191218
More information about the cfe-commits
mailing list