clang-tools 22.0.0git
|
Replace copy and swap tricks on shrinkable containers with the shrink_to_fit() method call. More...
#include <ShrinkToFitCheck.h>
Public Member Functions | |
ShrinkToFitCheck (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 |
Replace copy and swap tricks on shrinkable containers with the shrink_to_fit() method call.
The shrink_to_fit() method is more readable and more effective than the copy and swap trick to reduce the capacity of a shrinkable container. Note that, the shrink_to_fit() method is only available in C++11 and up.
Definition at line 22 of file ShrinkToFitCheck.h.
|
inline |
Definition at line 24 of file ShrinkToFitCheck.h.
|
override |
Definition at line 44 of file ShrinkToFitCheck.cpp.
|
inlineoverride |
Definition at line 31 of file ShrinkToFitCheck.h.
|
inlineoverride |
Definition at line 26 of file ShrinkToFitCheck.h.
|
override |
Definition at line 19 of file ShrinkToFitCheck.cpp.