I dun a DIP, possibly the best DIP ever
Steven Schveighoffer
schveiguy at gmail.com
Wed Apr 22 16:49:58 UTC 2020
On 4/22/20 10:37 AM, Manu wrote:
> I think efficient implementation here would depend on a static fold,
> which I plan for a follow-up, and it's a very trivial expansion from
> this DIP.
> Static reduce would allow `...` as an argument to a BinOp
> Ie; `Tup + ...` would expand `Tup[0] + Tup[1] + Tup[2] + ...`
> You could do `is(FindType == Tup) || ...`, and it would evaluate true if
> FindType exists in Tup, with no junk template instantiations!
This is awesome, and I'm not seeing why you would save it for later.
In general, couldn't this DIP be done just strictly on binary operators
and do what this DIP does with commas?
i.e.
foo(T) , ... expands to foo(T[0]), foo(T[1]), ..., foo(T[n])
-Steve
More information about the Digitalmars-d
mailing list