In most of the C++11 codes, I see:
for (auto i : list) { // a space before colon
...
}
However, usually C++ developers do not prefer:
for (int i = 0 ; i < list.size() ; ++i) { // spaces before semi-colons
...
}
but
for (int i = 0; i < list.size(); ++i) { // no spaces before semi-colon
...
}
.
If you are one of them, why do you NOT prefer:
for (auto i: list) { // no space before colon
...
}
?
Aucun commentaire:
Enregistrer un commentaire