Lines Matching full:container
30 // For a range within a container of pointers, calls delete (non-array version)
48 // For a range within a container of pairs, calls delete (non-array version) on
52 // container may call the hash function on the iterator when it is advanced,
66 // For a range within a container of pairs, calls delete (non-array version) on
79 // For a range within a container of pairs, calls delete.
93 // Counts the number of instances of val in a container.
94 template <typename Container, typename T>
96 typename Container::const_iterator>::difference_type
97 STLCount(const Container& container, const T& val) {
98 return std::count(container.begin(), container.end(), val);
121 // STLDeleteElements() deletes all the elements in an STL container and clears
122 // the container. This function is suitable for use with a vector, set,
123 // hash_set, or any other STL container which defines sensible begin(), end(),
126 // If container is NULL, this function is a no-op.
129 // STLElementDeleter (defined below), which ensures that your container's
132 void STLDeleteElements(T* container) {
133 if (!container)
135 STLDeleteContainerPointers(container->begin(), container->end());
136 container->clear();
139 // Given an STL container consisting of (key, value) pairs, STLDeleteValues
140 // deletes all the "value" components and clears the container. Does nothing
143 void STLDeleteValues(T* container) {
144 if (!container)
146 STLDeleteContainerPairSecondPointers(container->begin(), container->end());
147 container->clear();
162 // Given a pointer to an STL container this class will delete all the element
167 STLElementDeleter<T>(T* container) : container_(container) {}
174 // Given a pointer to an STL container this class will delete all the value
179 STLValueDeleter<T>(T* container) : container_(container) {}
203 // Returns true if the container is sorted.
204 template <typename Container>
205 bool STLIsSorted(const Container& cont) {
206 // Note: Use reverse iterator on container to ensure we only require
209 std::less<typename Container::value_type>())
250 // Returns true if the sorted container |a1| contains all elements of the sorted
251 // container |a2|.