Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // TestBoostRange
- //
- // Created by Rizky Herucakra on 7/17/13.
- // Copyright (c) 2013 Rizky Herucakra. All rights reserved.
- //
- #include <iostream>
- #include "boost/range/algorithm/sort.hpp"
- #include "boost/range/adaptor/filtered.hpp"
- using namespace std;
- using namespace boost;
- using namespace boost::adaptors;
- int main(int argc, const char * argv[])
- {
- int arr[7] = {5,2,8,0,1,3,9};
- for (auto x : sort(arr)| filtered([](int v ){ return v % 2 == 0;})){
- cout << x << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement