#include #include #include #include using namespace std; template void print(vector v) { for(auto it = v.cbegin(); it!=v.cend(); it++) cout << setw(3) << *it; cout << endl; } int main () { vector v = {1,2,3}; array a = {10, 20, 30, 40, 50, 60}; /* Assigns 20, 30, 40, 50 */ v.assign(a.begin()+1, a.end()-1); // 10 20 30 40 50 60 // ^ ^ // begin()+1 end()-1 print(v); }