MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / contains

Function contains

Libraries/Containers/Algorithms/AlgorithmFind.h:50–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48/// @return `true` if the container contains the given value, `false` otherwise
49template <typename Container, typename T>
50constexpr bool contains(Container container, const T& value, size_t* index = nullptr)
51{
52 return findIf(
53 container.begin(), container.end(), [&](auto& item) { return item == value; }, index) != container.end();
54}
55
56//! @}
57

Callers

nothing calls this directly

Calls 3

findIfFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected