DMD 0.149 release

Derek Parnell derek at psych.ward
Tue Mar 7 18:42:07 PST 2006


On Tue, 07 Mar 2006 15:41:28 -0800, Sean Kelly wrote:

> Walter Bright wrote:
>> Changed on_scope keywords per the general consensus of the n.g.
>> 
>> The implicit function template instantiation is a bit limited at the moment, 
>> deduction won't work for types derived from templates, and the mechanism to 
>> pick the most specialized template doesn't work.
> 
> Could you clarify this:
> 
> "& | ^ &= |= ^= ! && || ?: are now only operators allowed on bools"
> 
> Did you mean "are now _the_ only operators allowed on bools?" 

It seems that arithmetic operators also work on booleans so I guess the
operator list above is either not correct or this is a bug.

    auto q = true + true + true;
    writefln("%s %s", true + true + true, q);

gives 
   "3 3"

but I was expecting that the form "<expression> <arithmetic-op>
<expression>" where either <expression> is a boolean result would be a
syntax error. Instead, it seems to be implicitly casting the boolean to an
int before the operation is examined.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
8/03/2006 1:36:18 PM



More information about the Digitalmars-d-announce mailing list