六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 29|回复: 0

DMD 0.140发布

[复制链接]

升级  98%

158

主题

158

主题

158

主题

举人

Rank: 3Rank: 3

积分
494
 楼主| 发表于 2013-1-28 13:23:17 | 显示全部楼层 |阅读模式
<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);
}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表