I dun a DIP, possibly the best DIP ever
Stefan Koch
uplink.coder at googlemail.com
Fri Apr 24 08:49:19 UTC 2020
On Friday, 24 April 2020 at 08:35:53 UTC, Walter Bright wrote:
> On 4/24/2020 1:24 AM, Walter Bright wrote:
>> On 4/23/2020 11:00 PM, Manu wrote:
>>> [...]
>>
>> Fair enough. Though there needs to be a rationale as to why
>> those two particuler cases are needed and critical.
>
> Please keep in mind that the following works today:
>
> void foo(int);
>
> template tuple(T...) { enum tuple = T; }
>
> void test() {
> auto t = tuple!(1, 2, 3);
> static foreach (i, e; t)
> foo(e + i);
> }
>
> and generates:
>
> void test() {
> foo(1); foo(3); foo(5);
> }
Because of implementation issues in static foreach that'll take
forever.
Note: those issues are actually impossible to slove in the
general case.
More information about the Digitalmars-d
mailing list