I dun a DIP, possibly the best DIP ever

Stefan Koch uplink.coder at gmail.com
Thu Apr 23 13:43:18 UTC 2020


On Thursday, 23 April 2020 at 12:43:59 UTC, Simen Kjærås wrote:
> On Wednesday, 22 April 2020 at 12:04:30 UTC, Manu wrote:
>> This DIP single-handedly fixes compile-time issues in programs 
>> I've written by reducing template instantiations by near-100%, 
>> in particular, the expensive ones; recursive instantiations, 
>> usually implementing some form of static map.
>>
>> We should have done this a long time ago.
>
> This is beautiful and awesome (syntax and all).
>
> I was wondering if there's any way to to do a cross product 
> with this, like fun(Xs, Ys)... expand to fun(Xs[0], Ys[0]), 
> fun(Xs[0], Ys[1]), fun(Xs[1], Ys[0]), fun(Xs[1], Ys[1]), but 
> that might very well be rare enough to not warrant special 
> consideration.
>

doing the cartesian product of the tuples was in my first 
implementation.
It's not too useful in the general case though.


More information about the Digitalmars-d mailing list