MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ContainsElement

Function ContainsElement

Bcore/src/main/cpp/base/stl_util.h:117–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115// Search for an element with the specified value and return true if it was found, false otherwise.
116template <typename Container, typename T>
117bool ContainsElement(const Container& container, const T& value, size_t start_pos = 0u) {
118 DCHECK_LE(start_pos, container.size());
119 auto start = container.begin();
120 std::advance(start, start_pos);
121 auto it = std::find(start, container.end(), value);
122 return it != container.end();
123}
124
125// 32-bit FNV-1a hash function suitable for std::unordered_map.
126// It can be used with any container which works with range-based for loop.

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected