foreach loop over retro can crash gdmd

Iain Buclaw ibuclaw at ubuntu.com
Thu Jun 28 11:09:21 PDT 2012


On 28 June 2012 18:16, Joseph Rushton Wakeling
<joseph.wakeling at webdrake.net> wrote:
> Hello all,
>
> The following code crashes my version of GDC (4.6.3) when I try and compile
> it:
>
> ////////////////////////////////////////////////////
> import std.range, std.stdio;
>
> void main()
> {
>      double[] a = [ 0, 1, 2, 3, 4, 5 ];
>
>      foreach(i, x; retro(a))
>            writeln(x);
> }
> ////////////////////////////////////////////////////
>

With this on the latest, I get 'Error: cannot infer argument types', yes.


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list