AliasSeq!() deletes item in type list

data pulverizer data.pulverizer at gmail.com
Sat Aug 22 21:45:35 UTC 2020


Hi all,

just wandering if this is a bug, I certainly didn't expect the 
output:

```d
alias AliasSeq(T...) = T;
alias Nothing = AliasSeq!();

template MyTemplate(S, Args...)
{
   pragma(msg, "Args: ", Args);
}

void main()
{
   alias types = AliasSeq!(bool, string, ubyte, short, ushort);
   alias x = MyTemplate!(Nothing, types);
}
```

Output (first item is gone):

```terminal
Args: (string, ubyte, short, ushort)
```

If I do:

```d
alias y = AliasSeq!(Nothing, types);
pragma(msg, "y: ", y);
```

I'd get expected behaviour:

```terminal
y: (bool, string, ubyte, short, ushort)
```

Any added insights as to why this happens would be be much 
appreciated.

Thanks in advance.


More information about the Digitalmars-d-learn mailing list