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

Function isKnownEmptyContainer

lib/checkstl.cpp:3255–3268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3253}
3254
3255static bool isKnownEmptyContainer(const Token* tok)
3256{
3257 if (!tok)
3258 return false;
3259 return std::any_of(tok->values().begin(), tok->values().end(), [&](const ValueFlow::Value& v) {
3260 if (!v.isKnown())
3261 return false;
3262 if (!v.isContainerSizeValue())
3263 return false;
3264 if (v.intvalue != 0)
3265 return false;
3266 return true;
3267 });
3268}
3269
3270void CheckStlImpl::knownEmptyContainer()
3271{

Callers 1

knownEmptyContainerMethod · 0.85

Calls 3

isKnownMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected