For the two for loop below, are they equivalent? Basically does the auto look over "=0" assignment and see iter
is compared with s.size()
and so decides iter
is of type decltype(s.size())
?
string s;
for(auto iter=0; iter<s.size();iter++)
string s;
for(decltype(s.size()) iter=0; iter<s.size();iter++)
Aucun commentaire:
Enregistrer un commentaire