MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / containerAppendsElement

Function containerAppendsElement

lib/checkstl.cpp:68–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static bool containerAppendsElement(const Library::Container* container, const Token* parent)
69{
70 if (Token::Match(parent, ". %name% (")) {
71 const Library::Container::Action action = container->getAction(parent->strAt(1));
72 if (contains({Library::Container::Action::INSERT,
73 Library::Container::Action::APPEND,
74 Library::Container::Action::CHANGE,
75 Library::Container::Action::CHANGE_INTERNAL,
76 Library::Container::Action::PUSH,
77 Library::Container::Action::RESIZE},
78 action))
79 return true;
80 }
81 return false;
82}
83
84static bool containerYieldsElement(const Library::Container* container, const Token* parent)
85{

Callers 1

outOfBoundsMethod · 0.85

Calls 2

containsFunction · 0.85
getActionMethod · 0.80

Tested by

no test coverage detected