array operations and ranges

via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 27 01:59:02 PDT 2015


On Monday, 27 April 2015 at 06:52:11 UTC, Manu wrote:
> On 27 April 2015 at 15:58, Vlad Levenfeld via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>>> Phobos containers already support the first line, and it 
>>> would be a
>>> natural extension to make them support the second.
>>
>>
>> Sure, it's not complicated. It's something I had done in this 
>> other code and
>> showing for example.
>
>
> Yeah, see I don't feel making a simple thing like an array into
> something more complex by wrapping it in templates is ever a 
> good
> thing to do.
> I just think it's a missed opportunity that the compiler doesn't
> support any of this in the language.
>
> It would appear at face value to be a great opportunity for 
> lowering.
> Assignment can lower to .copy(), operators can lower to 
> map!(...)

It's similar to foreach, which already recognizes input ranges, 
so why not...


More information about the Digitalmars-d mailing list