Lines Matching refs:container
62 void STLDeleteElements(T *container) { in STLDeleteElements() argument
63 if (container != nullptr) { in STLDeleteElements()
64 STLDeleteContainerPointers(container->begin(), container->end()); in STLDeleteElements()
65 container->clear(); in STLDeleteElements()
96 size_t IndexOfElement(const Container& container, const T& value) { in IndexOfElement() argument
97 auto it = std::find(container.begin(), container.end(), value); in IndexOfElement()
98 DCHECK(it != container.end()); // Must exist. in IndexOfElement()
99 return std::distance(container.begin(), it); in IndexOfElement()
104 void RemoveElement(Container& container, const T& value) { in RemoveElement() argument
105 auto it = std::find(container.begin(), container.end(), value); in RemoveElement()
106 DCHECK(it != container.end()); // Must exist. in RemoveElement()
107 container.erase(it); in RemoveElement()
112 void ReplaceElement(Container& container, const T& old_value, const T& new_value) { in ReplaceElement() argument
113 auto it = std::find(container.begin(), container.end(), old_value); in ReplaceElement()
114 DCHECK(it != container.end()); // Must exist. in ReplaceElement()
120 bool ContainsElement(const Container& container, const T& value, size_t start_pos = 0u) {
121 DCHECK_LE(start_pos, container.size());
122 auto start = container.begin();
124 auto it = std::find(start, container.end(), value);
125 return it != container.end();
129 bool ContainsElement(const std::set<T>& container, const T& value) { in ContainsElement() argument
130 return container.count(value) != 0u; in ContainsElement()