Compile time data structure

Dicebot public at dicebot.lv
Fri Sep 20 05:25:34 PDT 2013


On Friday, 20 September 2013 at 06:20:09 UTC, Ali Çehreli wrote:
> On 09/19/2013 04:32 AM, Dicebot wrote:
>
> > Some obvious catches:
>
> Thank you. I have made those changes except the following one.
>
> > Variadic template arg chapter should probably mention
> "variadic args of
> > length 1" idiom used to have parameter accepting types,
> values and
> > aliases at once.
>
> Could you please expand on that.
>
> Thank you,
> Ali

Quoting Phobos:

```
template fullyQualifiedName(T...)
     if (T.length == 1)
{
     static if (is(T[0]))
         enum fullyQualifiedName = 
fullyQualifiedNameImplForTypes!(T[0], false, false, false, false);
     else
         enum fullyQualifiedName = 
fullyQualifiedNameImplForSymbols!(T[0]);
}
```

It is a relatively common idiom because there is no other way to 
express a single template parameter that accepts anything.


More information about the Digitalmars-d-learn mailing list