|
<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
比较感兴趣的是浮点数和字符串常量作为模板值参数,简单测试了一下:
<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);
} |
|