Re: apply function to parameters

2013-08-06 Thread Artur Skawina
On 08/06/13 18:03, Dicebot wrote: > On Tuesday, 6 August 2013 at 15:51:28 UTC, Jack Applegame wrote: >> On Tuesday, 6 August 2013 at 14:44:18 UTC, bearophile wrote: >>> Take a look at std.typetuple.staticMap >> staticMap works with types, and I don't know how it can help. > > Not really. Anything

Re: apply function to parameters

2013-08-06 Thread Jack Applegame
On Tuesday, 6 August 2013 at 16:03:07 UTC, Dicebot wrote: On Tuesday, 6 August 2013 at 15:51:28 UTC, Jack Applegame wrote: On Tuesday, 6 August 2013 at 14:44:18 UTC, bearophile wrote: Take a look at std.typetuple.staticMap staticMap works with types, and I don't know how it can help. Not rea

Re: apply function to parameters

2013-08-06 Thread Dicebot
On Tuesday, 6 August 2013 at 15:51:28 UTC, Jack Applegame wrote: On Tuesday, 6 August 2013 at 14:44:18 UTC, bearophile wrote: Take a look at std.typetuple.staticMap staticMap works with types, and I don't know how it can help. Not really. Anything that can be provided to template argument li

Re: apply function to parameters

2013-08-06 Thread Jack Applegame
On Tuesday, 6 August 2013 at 14:44:18 UTC, bearophile wrote: Take a look at std.typetuple.staticMap staticMap works with types, and I don't know how it can help.

Re: apply function to parameters

2013-08-06 Thread bearophile
Jack Applegame: In other words, I need something like this: foo(magicTemplate!(f, a1, a2, a3...)) === foo(f(a1), f(a2), f(a3)...) Sorry, your second post was not yet present and I misunderstood your question. Take a look at std.typetuple.staticMap Bye, bearophile

Re: apply function to parameters

2013-08-06 Thread bearophile
Jack Applegame: Is there a simple way to do this in D? somefunc(process(args)); Bye, bearophile

Re: apply function to parameters

2013-08-06 Thread Jack Applegame
In other words, I need something like this: foo(magicTemplate!(f, a1, a2, a3...)) === foo(f(a1), f(a2), f(a3)...)

apply function to parameters

2013-08-06 Thread Jack Applegame
In C++11 we can write: template void somefunc(Args... args { ... } template T process(T p) { ... } template void foo(Args... args) { somefunc(process(args)...); } Is there a simple way to do this in D?