On Friday, 12 September 2014 at 20:37:44 UTC, Ali Çehreli wrote:
On 09/12/2014 12:44 PM, MrSmith wrote:

> Given the following program:
>
> ---------------------------------
> import std.stdio;
>
> template first(string s)
> {
>      string first(string par)
>      {
>          if (par == s)
>              return "true";
>          else
>              return "false";
>      }
> }
>
> template second(alias firstInstance)
> {

TemplateArgsOf:

        import std.traits;
        foreach (i, arg; TemplateArgsOf!firstInstance) {
            writefln("arg %s: %s", i, arg);
        }

Prints:

arg 0: str

Ali

P.S. We want to see these topics over at the D.learn newsgroup. ;)

Thank you, Ali. I will try to not mismatch open tabs next time =)

Reply via email to