DMD2, Phobos: striding range

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Mon Mar 8 04:00:58 PST 2010


Mihail Strashun wrote:
> Following simple program fails to compile with latest DMD 2.041 (In fact 
> it fails to compile with any dmd2 version i have tried):
> 
> "test.d"
>  > import std.stdio;
>  > import std.range;
>  > import std.algorithm;
>  >
>  > int main()
>  > {
>  >   auto test = stride( iota(0,10,1) , 2 );
>  >   return 0;
>  > }
> 
> Output:
> [mist at mistwork d]$ dmd -run test.d
> /usr/include/d/std/range.d(716): Error: this._input.front() is not an 
> lvalue
> /usr/include/d/std/range.d(724): Error: this._input.back() is not an lvalue
> 
> 
> Is it a bug? I managed to get stride working only on arrays. If it is 
> the supposed way to work, how can be similar filtering done on ranges?


It's definitely a bug.  I've reported it:

http://d.puremagic.com/issues/show_bug.cgi?id=3894

-Lars


More information about the Digitalmars-d-learn mailing list