Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <iterator>
- #include <functional>
- using namespace std;
- int main(int, char**) {
- vector<int> vec {1,2,3,4,5,6,7,8,9,0};
- auto beg = vec.begin();
- auto end = vec.end();
- copy(beg, end, ostream_iterator<int>(cout, " "));
- cout << vec.size() << endl;
- remove_if(beg, end, std::bind(std::greater<int>(), placeholders::_1, 5));
- copy(beg, end, ostream_iterator<int>(cout, " "));
- cout << vec.size() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement