std::remove_if
comes to the rescue!
99 would be replaced by UnaryPredicate
that would filter your delays, which I am going to use a lambda function for.
And here’s the example:
v.erase(std::remove_if(
v.begin(), v.end(),
[](const int& x) {
return x > 10; // put your condition here
}), v.end());
Related Contents:
- Appending a vector to a vector [duplicate]
- What is the easiest way to initialize a std::vector with hardcoded elements?
- How do I erase an element from std::vector by index?
- Sorting a vector in descending order
- Best way to extract a subvector from a vector?
- How to sum up elements of a C++ vector?
- C++ Erase vector element by value rather than by position? [duplicate]
- Is std::vector so much slower than plain arrays?
- How do I print the elements of a C++ vector in GDB?
- Thou shalt not inherit from std::vector
- How to initialize std::vector from C-style array?
- When vectors are allocated, do they use memory on the heap or the stack?
- How do I reverse a C++ vector?
- Why is a C++ Vector called a Vector? [closed]
- How to get std::vector pointer to the raw data?
- How do you copy the contents of an array to a std::vector in C++ without looping?
- Why isn’t vector a STL container?
- C++ convert vector to vector
- Erasing elements from a vector
- Why is it OK to return a ‘vector’ from a function?
- std::vector::resize() vs. std::vector::reserve()
- Why would I prefer using vector to deque
- What happens if you increment an iterator that is equal to the end iterator of an STL container
- How to avoid memory leaks when using a vector of pointers to dynamically allocated objects in C++?
- Looking for C++ STL-like vector class but using stack storage
- What’s the benefit of std::back_inserter over std::inserter?
- C++ std::vector emplace vs insert [duplicate]
- How to change a particular element of a C++ STL vector
- how do you insert the value in a sorted vector?
- Is there a sorted_vector class, which supports insert() etc.?
- Delete all items from a c++ std::vector
- Using C++ vector::insert() to add to end of vector
- Convert iterator to pointer?
- Replace an element into a specific position of a vector
- How do I sort a std::vector by the values of a different std::vector? [duplicate]
- Is it safe to assume that STL vector storage is always contiguous?
- Resizing a C++ std::vector without initializing data [duplicate]
- std::vector, default construction, C++11 and breaking changes
- array vs vector vs list
- Does vector::erase() on a vector of object pointers destroy the object itself?
- STL vectors with uninitialized storage?
- Checking whether a vector is empty
- Cleaning up an STL list/vector of pointers
- C++ vector that *doesn’t* initialize its members?
- C++ remove_if on a vector of objects
- Speed accessing a std::vector by iterator vs by operator[]/index?
- How do I iterate over a vector and also know the index of the element?
- Reorder vector using a vector of indices [duplicate]
- Why push_back is slower than operator[] for a previously allocated vector
- Vector Iterators Incompatible