how convert the range to slice ?

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 28 15:19:49 PST 2015


On Wednesday, 28 January 2015 at 22:43:36 UTC, bearophile wrote:
> It's such a fundamental part of D+Phobos that newbies are 
> forced to learn this quickly. On the other hand an informative 
> error message could be useful...
>
> What error message do you suggest?

Something like:

     ..., expression of type (SomeRange!T) must be 
converted/transformed to T[] through .array.

I have no idea if DMD could figure this out by intercepting array 
assignment somehow. DMD must at least be aware of the Range 
concept throught its duck type members when generating code for 
foreach, right?


More information about the Digitalmars-d-learn mailing list