Bad Vector Code void duplicate(vector &v) { vector::const_iterator b = v.begin(), e = v.end(); for(; b != e; ++b) v.push_back(*b); } Not safe Reallocation may invalidate b and e Easily fixed in this case