mercredi 5 avril 2017

Assigning vectors without copying them

I have two std::vector with several std::unordered_set inside. However, one of the vector will be replacing the other throughout the execution, like this:

vector1 = ...
vector2 = ...
// some operations
vector1 = vector2
vector2 = std::vector<...>

Is there a way of achieving this without having to copy the contents of the vectors?

Aucun commentaire:

Enregistrer un commentaire