Vinzent Höfler wrote:
Marc Weustink <marc.weust...@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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to