Why D const is annoying

bearophile bearophileHUGS at lycos.com
Sat Dec 10 02:45:11 PST 2011


Timon Gehr:

> Just slice the const array to get a range. The specialization for ranges 
> does not have the bug.
> 
> import std.algorithm;
> void main() {
>      const arr = [1, 2, 3];
>      reduce!"a*b"(arr[]);   // It works.
> }

Wasn't arr a range already?

Bye,
bearophile


More information about the Digitalmars-d mailing list