clang-tools 22.0.0git
|
Checks for inaccurate use of the erase() method. More...
#include <InaccurateEraseCheck.h>
Public Member Functions | |
InaccurateEraseCheck (StringRef Name, ClangTidyContext *Context) | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
std::optional< TraversalKind > | getCheckTraversalKind () const override |
Checks for inaccurate use of the erase() method.
Algorithms like remove() do not actually remove any element from the container but return an iterator to the first redundant element at the end of the container. These redundant elements must be removed using the erase() method. This check warns when not all of the elements will be removed due to using an inappropriate overload.
Definition at line 23 of file InaccurateEraseCheck.h.
|
inline |
Definition at line 25 of file InaccurateEraseCheck.h.
|
override |
Definition at line 37 of file InaccurateEraseCheck.cpp.
|
inlineoverride |
Definition at line 32 of file InaccurateEraseCheck.h.
|
inlineoverride |
Definition at line 27 of file InaccurateEraseCheck.h.
|
override |
Definition at line 17 of file InaccurateEraseCheck.cpp.