fork(1) download
  1. #include <algorithm>
  2. #include <vector>
  3. #include <iterator>
  4. #include <iostream>
  5.  
  6. int main() {
  7. std::vector<int> values{1, 2, 3, 4, 5, 6};
  8. std::copy_if(values.cbegin(),
  9. values.cend(),
  10. std::ostream_iterator<int>(std::cout, " "),
  11. [](const int val) { return val != 2; });
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1 3 4 5 6