
10 May
2005
10 May
'05
6:51 p.m.
Thorsten Ottosen wrote:
"Peter Dimov" <pdimov@mmltd.net> wrote in message
| One reasonable extension
perhaps. C++ is typed language.
| would be to allow [type] to be omitted, with | semantics: | | { | decltype(*i) [identifier] = *i; | [statement] | } | | Note that this is not the same as auto.
yep, because auto drops references.
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. That's an important use case, and some allowance should be made for it in the chosen syntax. -- Eric Niebler Boost Consulting www.boost-consulting.com