[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;
 
   size_type rfind(const _Type& str, size_type pos = npos) const;
   size_type rfind(const C* s, size_type pos, size_type count) const;
   size_type rfind(const C* s, size_type pos = npos) const;
   size_type rfind(C ch, size_type pos = npos) const;
 
+  bool contains(const C *s) const;
+  bool contains(C s) const;
----------------
nicovank wrote:

```suggestion
  bool contains(const C *s) const;
  bool contains(C s) const;
  bool contains(basic_string_view<C, T> sv) const;
```

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


More information about the cfe-commits mailing list