Consider following two examples.
class ClassOne
{
//class definition is here
};
std::vector< ClassOne > myListOfObjects;
std::vector< ClassOne >::const_iterator iter = myListOfObjects.begin();
Example 1:
for( ; iter < myListOfObjects.end(); **++iter**)
{
//some operations
}
OR
Example 2:
for( ; iter < myListOfObjects.end(); **iter++**)
{
//some operations
}
Which one is faster ? ++iter or iter++ in the context of loop.
Reason Fro Closure:
Copied from Brian's Post (to make the question more succinct).
You could also try one of these similar questions: here or here or here or here.