fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. void foo(const std::vector<std::vector<int>> &v_v)
  5. {
  6. std::cout << "foo vector vector\n";
  7. }
  8.  
  9. void foo(const std::vector<int> &v)
  10. {
  11. std::cout << "foo vector\n";
  12. }
  13.  
  14. // void foo(const std::vector<std::vector<int>> &v_v)
  15. // {
  16. // std::cout << "foo vector vector\n";
  17. // }
  18.  
  19. int main() {
  20. std::vector<int> v = {0, 1, 2};
  21. std::vector<int> v2 = {v};
  22. std::vector<std::vector<int>> v_v = {v};
  23. foo({v});
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
foo vector