[fpc-devel] New feature discussion: for-in loop

Micha Nelissen micha at neli.hopto.org
Tue Oct 20 13:38:40 CEST 2009


Vinzent Höfler wrote:
> Marc Weustink <marc.weustink at cuperus.nl>:
>> loop you are not allowed to modify the loop variable. In this case I can 
>> imagine its not allowed to modify the list.
> 
> But how's the compiler supposed to know which method modifies MyList and which one does not? 

That's why I suggested the use of 'const functions' in other message in 
this thread. IIRC they are also part of C++; const functions are 
functions that never do an assignment (directly or indirectly) to a 
member field.

Regards, Micha



More information about the fpc-devel mailing list