Bracketed expression == convert?

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Sun Jul 2 07:53:45 PDT 2006


Yossarian wrote:
> consider following code:
> 
> import std.stdio;
> const int t = 0;
> void main()
> {
>     writefln("%d", (t) - 1);
> }
> 
> (i think it's completelly legal, but compiler explains:
> C style cast illegal, use cast(t)-1
> 
> is it a bug, or a feature?

That compiles fine here, with DMD .162 .

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list