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

Function uninitvar_std_next

test/cfg/std.cpp:777–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777void uninitvar_std_next(const std::vector<int> &v, int count)
778{
779 // No warning shall be shown:
780 if (std::next(v.begin()) != v.end()) {}
781 if (std::next(v.begin(), count) != v.end()) {}
782
783 std::vector<int>::iterator it;
784 // cppcheck-suppress uninitvar
785 if (std::next(it) != v.end()) {}
786
787 std::vector<int>::const_iterator const_it;
788 // cppcheck-suppress uninitvar
789 if (std::next(const_it) != v.end()) {}
790
791 std::vector<int>::reverse_iterator rit;
792 // cppcheck-suppress uninitvar
793 if (std::next(rit) != v.rend()) {}
794
795 std::vector<int>::const_reverse_iterator const_rit;
796 // cppcheck-suppress uninitvar
797 if (std::next(const_rit) != v.rend()) {}
798}
799
800void uninitvar_std_prev(const std::vector<int> &v, int count)
801{

Callers

nothing calls this directly

Calls 3

nextFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected