[OT] ISO C++ 17 changes

Dukc via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 3 22:04:04 PDT 2017


On Monday, 3 April 2017 at 21:43:41 UTC, Meta wrote:
> On Monday, 3 April 2017 at 21:33:20 UTC, Timon Gehr wrote:
> Any suggestions as to how to get something similar working?

auto fold(string op, Args...)(Args args)
{
     foreach(e; args[1 .. $]) args[0] += e;
     return args[0];
}

void main()
{
     import std.stdio;
     fold!"+"(1, 2, 3).writeln; //6
}




More information about the Digitalmars-d mailing list