A little of coordination for Rosettacode

Jos van Uden usernet at fwend.com
Tue Feb 26 06:53:10 PST 2013


On Tuesday, 26 February 2013 at 14:10:04 UTC, bearophile wrote:
>> With functions like this my last version will become simpler, 
>> and it's equally statically type safe:
>>
>> bool xor(in bool[2] args) pure nothrow {
>>    return b[0] != b[1];
>> }
>
> This third version is much simpler and it seems good enough for
> Rosettacode:
>
> http://codepad.org/YJjb1t91

Yes, it's much nicer than the heavily templated one. We may be 
able to update it if/when std.reflection comes through.

I'd prefer the more conventional notation (i & (1 << j)) != 0, 
rather than the double negative.


More information about the Digitalmars-d-learn mailing list