Typed variadic template syntax?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jan 29 08:39:32 PST 2014


On 1/29/14 1:53 AM, Stanislav Blinov wrote:
> On Wednesday, 29 January 2014 at 09:50:13 UTC, Timon Gehr wrote:
>
>> import std.range, std.algorithm;
>> int value(int xs[]...) {
>>     return reduce!((a,b)=>10*a+b)(0,xs.retro);
>> }
>
> Sadly, you can't build a struct (with N int fields) or an enum this way.

mixin

Andrei


More information about the Digitalmars-d mailing list