vendredi 24 mars 2017

Are moves automatically used when reassigning to the mapped variable?

Suppose I implement a new interface for sort

vector<int> sort(vector<int> in){
  //sorting logic
}

And use it like this

vector<int> some_integers = {2, 1, 3};
some_integers = sort(some_integers);

Will the compiler automatically move some_integers? Or will it copy?

Aucun commentaire:

Enregistrer un commentaire