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

Method removeAll

Libraries/Containers/Vector.h:215–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 /// @see Algorithms::removeIf
214 template <typename Lambda>
215 [[nodiscard]] bool removeAll(Lambda&& criteria) noexcept
216 {
217 T* itBeg = Parent::begin();
218 T* itEnd = Parent::end();
219 T* it = Algorithms::removeIf(itBeg, itEnd, forward<Lambda>(criteria));
220
221 const size_t numElements = static_cast<size_t>(itEnd - it);
222 const size_t offset = static_cast<size_t>(it - itBeg);
223 detail::VectorVTable<T>::destruct({Parent::data() + offset, numElements});
224 Parent::header.sizeBytes -= static_cast<decltype(Parent::header.sizeBytes)>(numElements * sizeof(T));
225 return it != itEnd;
226 }
227
228 /// @brief Removes all values equal to `value`
229 /// @tparam U Type of the Value

Callers 2

testClassTypeMethod · 0.80
getPathsRelativeToMethod · 0.80

Calls 4

beginFunction · 0.85
endFunction · 0.85
removeIfFunction · 0.85
dataFunction · 0.70

Tested by 1

testClassTypeMethod · 0.64