Preferisco due modi:
void copyVecFast(const vec<int>& original)
{
vector<int> newVec;
newVec.reserve(original.size());
copy(original.begin(),original.end(),back_inserter(newVec));
}
void copyVecFast(vec<int>& original)
{
vector<int> newVec;
newVec.swap(original);
}
Come si fa?