https://issues.dlang.org/show_bug.cgi?id=14210

--- Comment #4 from Kenji Hara <[email protected]> ---
(In reply to Ketmar Dark from comment #3)
> this is CTFE wrapper generator, and with merging like now *each* registered
> delegate with the same parameter types will get the same default values.
> this kills the whole CTFE wrapper generation idea.

Unfortunately the code does not work as you expected. Default arguments won't
be encoded in type, so you cannot capture them via type.

Instead of that, you need to handle a function symbol.

void foo(alias f)()
{
    import std.traits;
    pragma(msg, ParameterDefaultValueTuple!f);  // directly give a function
symbol
}
void main()
{
    foo!((int a=40) => a+2); // tuple(40)
    foo!((int a) => a+2);    // (void)
}

--

Reply via email to