Tristate - wanna?

Timon Gehr timon.gehr at gmx.ch
Sun Oct 27 03:07:04 PDT 2013


On 10/27/2013 02:11 AM, Andrei Alexandrescu wrote:
> On 10/26/13 5:13 PM, Timon Gehr wrote:
>> The following implementation does not use conditionals; probably not
>> minimal.
>
> Thanks! Fixed two minor bugs:
>
>>      this(bool b) { value = b; }
>>
>>      void opAssign(bool b) { value = b; }
>
> These should shift b so it becomes 2 if true.
> ...

Good point.

> Pushed your code with the fixes and a full truth table unittest:
>
> https://github.com/andralex/phobos/blob/allocator/std/allocator.d#L236
>
> Nice work. I'd say this is nontrivial enough to be put in the standard
> library.
>
>
> Andrei
>
>

Thanks!


More information about the Digitalmars-d mailing list