A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue4219 below:

erase[_if] should be based on ranges remove

template<class T, class Allocator, class U = T>
  constexpr typename vector<T, Allocator>::size_type
    erase(vector<T, Allocator>& c, const U& value);

-1- Effects: Equivalent to:

auto rit = ranges::remove(c.begin(), c.end(), value);
auto r = distance(it, c.end());
c.erase(r.begin()it, rc.end());
return r.size();
template<class T, class Allocator, class Predicate>
  constexpr typename vector<T, Allocator>::size_type
    erase_if(vector<T, Allocator>& c, Predicate pred);

-2- Effects: Equivalent to:

auto rit = ranges::remove_if(c.begin(), c.end(), pred);
auto r = distance(it, c.end());
c.erase(r.begin()it, rc.end());
return r.size();

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4