Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- template <typename Element>
- ostream& operator<<(ostream& out, const vector<Element>& container) {
- for (const auto& element : container) {
- out << element << " "s;
- }
- return out;
- }
- int main() {
- const vector<int> ages = {10, 5, 2, 12};
- cout << ages << endl;
- }
Add Comment
Please, Sign In to add comment