View difference between Paste ID: WchKRaTH and cxAk4PZ1
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
#include <vector>
3
4
using namespace std;
5
6
template <typename Element>
7
ostream& operator<<(ostream& out, const vector<Element>& container) {
8
    for (const auto& element : container) {
9
        out << element << " "s;
10
    }
11
    return out;
12
}
13
14
int main() {
15
    const vector<int> ages = {10, 5, 2, 12};
16
    cout << ages << endl;
17
}