qiezi 发表于 2013-1-28 13:23:17

DMD 0.140发布

<div class="postText"> Nov 23, 2005
New/Changed Features

   
[*]Added std.string.soundex.   
[*]Added std.string.entab.   
[*]Added std.string.wrap.   
[*]Added std.string.abbrev.   
[*]Added std.windows.charset (thanks to Stewart Gordon, D/28246).   
[*]Added std.demangle to demangle D names.   
[*]Improved promotion of names inside templates.   
[*]Now allows floating point and string literals as template value arguments.   
[*]To support the previous, the name mangling of template instances has changed. This will necessitate recompilation of any code that uses templates.   
[*]std.utf.UtfError is now deprecated. Use std.utf.UtfException instead.
Bugs Fixed

   
[*]Fixed D.bugs/5299   
[*]Fixed D.bugs/5353   
[*]Fixed D.bugs/5360   
[*]Fixed D.bugs/5391   
[*]Fixed D.bugs/5429   
[*]Fixed D.bugs/5464   
[*]Fixed std.string.expandtabs so it handles UTF.

比较感兴趣的是浮点数和字符串常量作为模板值参数,简单测试了一下:

<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);">import std.stdio;

template TFloat (float F)
{
    float value = F;
}

template TString (char[] S)
{
    char[] value = S;
}

void main()
{
    alias TFloat!(3.14f) PI;
    writefln(PI.value);
    writefln(TString!("hello").value);
}
页: [1]
查看完整版本: DMD 0.140发布