On Sun, 11 Jan 2009 21:39:55 +1300, Denis Koroskin <2kor...@gmail.com> wrote:

On Sun, 11 Jan 2009 11:04:38 +0300, Tim M <a...@b.com> wrote:

On Sun, 11 Jan 2009 20:31:51 +1300, Denis Koroskin <2kor...@gmail.com> wrote:


Yep that probibly is a slight bug. What I would like to know is why cant I do foreach with primitive types like I can with objects.

You can use foreach to iterate over arrays and tuples, if that's what you mean. Iterating over over primitive types makes little sense.


Just re reading my own question I think it is clear what I meant. I meant array of primitives so yes iterating over an array, but an array of primitives. Dmd handles foreach over SomeObject[] a lot more relaxed than int[].



Example, please? I never noticed any difference.

Ok just did another test. Objects are handled the same way like you said. The "problem" is actually in the opApply where it can work just fine (runs ok not just compiles ok) using the exisiting variable.

Reply via email to