this template prints the content of an 2D vector
how would you generalize this template so it works for every STL container ?
template<class T>
void printVector(std::vector<std::vector<T>> const &matrix) {
for (std::vector<T> row : matrix) {
for (T val : row) {
std::cout << val << " ";
}
std::cout << '\n';
}
}
Is there maybe "print" that allows me to print anything, no matter what I put into it ? (n-dimensional containers, strings, etc ?)