lundi 26 février 2018

Use of auto vs auto& in C++

I've seen auto& used in range for loops to avoid copying members in the loop. But I don't have a deep, meaningful understanding when I should use auto vs auto&. Can somebody please give the theory on it, as well as concrete usage cases?

Aucun commentaire:

Enregistrer un commentaire