vector<int> First;//Size () ==2First.push_back (1); First.push_back (2); //First.insert (2);Vector<int>second;//Size () ==3 + assign??Second.push_back (3); Second.push_back (4); Second.push_back (5); Vector<int>::iterator it =First.begin (); //second.assign (It,first.end ());Second.insert (Second.end (), First.begin (), First.end ()); printf ("first.size=%d\n", First.size ()); printf ("second.size=%d\n", Second.size ()); for(it = Second.begin (); It! = Second.end (); it++) printf ("second[]=%d\n", *it);
Second to insert the first content, too long. Good trouble. Why there is no direct push_back (vector) of the refactoring function??
Emplace is in the c++11, it feels the same as this insert usage.
--------------
Really want to www.cplusplus.com this site to catch down, and then do a site.
It has no comment; some examples are very bad.
Emplace and inserts of vectors