[clang-tools-extra] [clang-tidy][modernize-use-std-erase] Replace iterator erase-remove idiom with std::(erase/erase_if) (PR #193407)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 07:53:08 PDT 2026


================
@@ -151,6 +151,11 @@ New checks
   Finds common idioms which can be replaced by standard functions from the
   ``<bit>`` C++20 header.
 
+- New :doc:`modernize-use-std-erase
+  <clang-tidy/checks/modernize/use-std-erase>` check.
+
+  Replaces erase-remove idiom with C++20's' std::erase and std::erase_if for improved readability.
----------------
EugeneZelenko wrote:

```suggestion
  Replaces erase-remove idiom with C++20's' ``std::erase`` and
  ``std::erase_if`` for improved readability.
```

https://github.com/llvm/llvm-project/pull/193407


More information about the cfe-commits mailing list