I\'m trying to figure out the best way to determine whether I\'m in the last iteration of a loop over a map in order to do something like the following:
If you just want to use a ForwardIterator, this should work:
for ( i = c.begin(); i != c.end(); ) {
iterator cur = i++;
// do something, using cur
if ( i != c.end() ) {
// do something using cur for all but the last iteration
}
}