Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2003-11-23 19:02:38

>>Just to stick my two cents in why bother with a ++
>>operator in the for loop the increment is implied
>>so you could write something like the following
>>for (; r; )
>> *r;
>>increment and test makes more sense for a range object
>> within the of a loop. Right :-)
> I disagree.
> Code should not be a short as possible, it should be as meaningful as
> possible.
> The intent is obvious with the idiom "for(; r; ++r)" and it should be.

Indeed ;)
Also, what if you need to dereference twice?

for ( ; r; ++r) {
    r->first_name = r->last_name; // dereferencing twice


Boost list run by bdawes at, gregod at, cpdaniel at, john at