#include using namespace std; template void print(vector &v) { typename vector::iterator it = v.begin(); while (it != v.end()) { cout << *it << " "; it++; } cout << endl; } int main() { int arr1[5] = {1, 2, 3, 4, 5}; vector v1(arr1, arr1 + 5); vector v2(5, 1.2f); v1.swap(v2); print(v1); print(v2); return 0; }