fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. class Debug
  5. {
  6. public:
  7. template <typename T, typename A>
  8. static void printVector(const std::vector<T,A>&, const std::string& = "Vector:");
  9. };
  10.  
  11. template <typename T, typename A>
  12. void Debug::printVector(const std::vector<T,A>& v, const std::string& message)
  13. {
  14. std::cout<<message<<std::endl;
  15. for(auto item : v)
  16. {
  17. std::cout<<item<<std::endl;
  18. }
  19. }
  20.  
  21. int main() {
  22. std::vector<std::string> vec {"a","b","c"};
  23. Debug::printVector(vec);
  24. return 0;
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Vector:
a
b
c