[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove (#97964) (PR #100177)

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 14:21:51 PDT 2024


================
@@ -20,6 +20,47 @@ struct shared_ptr {
   explicit operator bool() const noexcept;
 };
 
+template <typename T>
+struct vector {
+  vector();
+  bool operator==(const vector<T>& other) const;
+  bool operator!=(const vector<T>& other) const;
+  unsigned long size() const;
+  bool empty() const;
+
+  // Basic iterator implementation for testing
+  struct iterator {
----------------
njames93 wrote:

This boilerplate is excessive, you can just say the iterator is a pointer to T.
Also definitions aren't needed for all methods in the class, a declaration is more than enough 

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


More information about the cfe-commits mailing list