samedi 20 décembre 2014

How can I check if I'm on the last element when iterating using foreach syntax

For example:



for( auto &iter: item_vector ) {
if(not_on_the_last_element) printf(", ");
}


or



for( auto &iter: skill_level_map ) {
if(not_on_the_last_element) printf(", ");
}

Aucun commentaire:

Enregistrer un commentaire