Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-05-10 14:37:50


Eric Niebler wrote:

> But users might reasonably expect this:
>
> int i = 0;
> for( i : vect )
> {
> }
> // maybe use i here
>
> to use the pre-declared i as a loop variable instead of introducing a
> new variable.

Good point.

> That's an important use case, ...

I don't believe that it is an important use case at all, but it is
nevertheless a showstopper. It would be very confusing to overload 'for' in
a way that is not consistent with its traditional semantics. We'll have to
live with auto or auto&, as appropriate.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk