#include <iterator>
#include <vector>
#include <algorithm>
int removeLessThan(std::vector<int>& v, int limit) {
std::remove_if(v.begin(), v.end(), [limit](int a){return a < limit;});
return EXIT_SUCCESS;
}
My output:
Vector after removing all values under 44: [ 28 43 40 42 8 24 12 25 31 13 36 30 28 35 37]
Desired output:
Vector after removing all values under 44: [ ]
So why does my code not remove any elements when it should remove everything?