fork(1) download
  1. #include <iostream>
  2.  
  3. #include <boost/lambda/lambda.hpp>
  4. #include <boost/phoenix/phoenix.hpp>
  5. #include <boost/range/adaptors.hpp>
  6. #include <boost/range/algorithm/for_each.hpp>
  7. #include <boost/range/irange.hpp>
  8.  
  9.  
  10. int main() {
  11. using namespace std;
  12. using namespace boost;
  13. using namespace boost::adaptors;
  14.  
  15. using boost::lambda::_1;
  16. using boost::phoenix::placeholders::arg1;
  17.  
  18. auto result = irange(1, 100 + 1)
  19. | filtered(arg1 % 3 == 0)
  20. | reversed
  21. ;
  22. for_each(result, cout << _1 << " ");
  23. }
  24.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
99 96 93 90 87 84 81 78 75 72 69 66 63 60 57 54 51 48 45 42 39 36 33 30 27 24 21 18 15 12 9 6 3