fork download
  1. #include <vector>
  2. #include <iostream>
  3. #include <iterator>
  4. #include <algorithm>
  5.  
  6. void foo2(std::vector<int> const &parameter) {
  7. // print parameter to cout
  8. copy(parameter.begin(), parameter.end(),
  9. std::ostream_iterator<int>(std::cout, " "));
  10. }
  11.  
  12. std::vector<int> make_vector() {
  13. return {1, 2, 3};
  14. }
  15.  
  16. int main() {
  17. foo2(make_vector());
  18. }
Success #stdin #stdout 0s 3060KB
stdin
Standard input is empty
stdout
1 2 3