Re: Is it possible to call a delegate at compile time?

2017-06-22 Thread Andrew Edwards via Digitalmars-d-learn
On Friday, 23 June 2017 at 04:58:07 UTC, ketmar wrote: Andrew Edwards wrote: so no, even if you'll remove `ref`, it will not work. sorry. Okay, got it. Much appreciated.

Re: Is it possible to call a delegate at compile time?

2017-06-22 Thread ketmar via Digitalmars-d-learn
Andrew Edwards wrote: I desire to call foo() at compile... As implemented it does not happen, but it's not immediately clear what I am missing. Or is this simply not possible as yet? What is the proper way to redesign this template so that it will execute at compile time? there are two

Is it possible to call a delegate at compile time?

2017-06-22 Thread Andrew Edwards via Digitalmars-d-learn
auto foo(Args...)(ref Args args) { with (Module!"std.conv") with (Module!"std.stdio") { return () => { string[] s; foreach (i, arg; args) { static if (is(Args[i] == string)) { s ~= arg; } else {