[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 5 10:37:11 PDT 2024


================
@@ -50,12 +50,16 @@ struct basic_string {
   size_type find(const _Type& str, size_type pos = 0) const;
   size_type find(const C* s, size_type pos = 0) const;
   size_type find(const C* s, size_type pos, size_type n) const;
+  size_type find(C ch, size_type pos = 0) const;
----------------
nicovank wrote:

```suggestion
  size_type find(C ch, size_type pos = 0) const;
  template<class StringViewLike>
  size_type find(const StringViewLike& t, size_type pos = 0) const;
```

Let's cover them all if possible.
This one might cause issues, and is probably not all that common, but let's see.

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


More information about the cfe-commits mailing list