..." A vector is a single object that can be assigned. For example:
Code:
void f(vector<Entry>& v)
{
vector<Entry> v2 = phone_book;
v = v2;
//...
}
... " Assigning a vector involves copying its elements. Thus, after the initialization and assignment in
f(), v and v2 each holds a seperate copy of every Entry in the phone book. When a vector holds many
elements, such innocent-looking assignments and initialization can be prohibihtively expensive. Where
copying is indesirable, refrences or pointers should be used."