#include <iostream>
#include <algorithm>
using namespace std;

template <typename Container, typename Filter>
void filter_ip(Container& c, Filter&& f)
{
  c.erase(std::remove_if(c.begin(), c.end(), 
                         [&f](const typename Container::value_type& x) { 
                         	return !f(x); 
                         }), 
          c.end());
}

int main() {
	std::vector<int> stuff{1, 2, 3, 4, 5};
	filter_ip(stuff, [](int i) { return i >= 3; });
	for (int i : stuff) cout << i << ", ";
	return 0;
}