Tristate - wanna?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 26 18:11:17 PDT 2013


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.

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




More information about the Digitalmars-d mailing list