November 29, 2007 Re: D2.008 const test doesn't work | ||||
---|---|---|---|---|
| ||||
Extra diagnosis. The following program: import std.stdio; template constType(T) { pragma(msg,T.stringof); static const string constType = T.stringof; } void main() { writefln(constType!(int)); writefln(constType!(const(int))); writefln(constType!(invariant(int))); } Prints "int" (only) at compile time, and three "int"s at runtime. It seems the constness of the template parameter is not being passed into the template. |
Copyright © 1999-2021 by the D Language Foundation