|
Boost : |
From: Russell Hind (rhind_at_[hidden])
Date: 2003-10-13 03:34:36
Eric Niebler wrote:
>
> That's not a good idea -- putting the type there is more explicit, and
> it makes it look more like a for(;;) loop. Besides, you might want a
> conversion to occur; for example, BOOST_FOREACH( int i, vector_of_bools
> ). Also it's impossible to achieve without typeof() AFAICT.
>
>
>> BOOST_FOREACH(i, int_list)
>
>
> This syntax is reserved for when you have predeclared the loop variable,
> as in:
>
Thats fair enough.
I was merely commenting from your example in that if you wish to modify
the elements, then if you don't declare it as a reference, your example as
i += 20;
Won't work as you are modifying a local, not a reference to the elemnt
itself.
Thanks
Russell
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk