Reducing variadic template combinatorics (C++ was onto something)

Steven Schveighoffer schveiguy at gmail.com
Tue Oct 14 15:22:59 UTC 2025


On Tuesday, 14 October 2025 at 06:54:24 UTC, Daniel N wrote:
> On Tuesday, 14 October 2025 at 04:30:49 UTC, Steven 
> Schveighoffer wrote:
>>
>> Now, how does this look?
>>
>> ```d
>> writelines2(1)(2)(3)(4);
>> ```
>>
>
> It's probably not what you want...
> [1,2,3,4].writeln;
> ... but I think the syntax is sufficiently nice.

So this won't work if the types are different.

```d
writelines("value", 1);
writelines2("value")(1);
// ["value", 1].writeln; // does not work
```

-Steve


More information about the Digitalmars-d mailing list