Get the name of a function and the parameters?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Apr 28 14:18:16 PDT 2009


On Tue, Apr 28, 2009 at 3:07 PM, grauzone <none at example.net> wrote:
>
> I'd like to pass several functions at once. Is there a way to make this
> variadic? The obvious approach (writing "NameOfFunc(alias f...)") fails with
> a syntax error.

Sure, you'd just make it NameOfFunc(f...) and then recursively
instantiate, converting one item at a time to its name until f.length
== 0.

Alternatively, you can write a compile-time map and use NameOfFunc as
the mapping predicate.


More information about the Digitalmars-d-learn mailing list