Can't create immutable type in template

Timon Gehr timon.gehr at gmx.ch
Mon Jul 16 14:51:19 PDT 2012


On 07/16/2012 01:38 AM, Nick Gurrola wrote:
> import std.stdio;
>
> void main()
> {
>     writeln(typeid(Test!int));
> }
>
> template Test(T...)
> {
>     alias immutable(T[0]) Test;
> }
>
>
> This prints "int" instead of "immutable(int)" like I would expect. Is
> this a bug, or is that what is supposed to happen?

This is a known issue.
http://d.puremagic.com/issues/show_bug.cgi?id=6966
The bug report also contains a simple workaround.


More information about the Digitalmars-d-learn mailing list