mirror of
https://github.com/dlang/phobos.git
synced 2025-05-05 09:30:49 +03:00
14 lines
367 B
Text
14 lines
367 B
Text
`std.typecons.Ternary.opBinary` supports `bool` operands
|
|
|
|
Now `std.range.Ternary` can be used in bitwise operations with `bool`
|
|
|
|
-----
|
|
import std.typecons : Ternary;
|
|
|
|
Ternary a = Ternary(true);
|
|
assert(a == Ternary.yes);
|
|
assert((a & false) == Ternary.no);
|
|
assert((a | false) == Ternary.yes);
|
|
assert((a ^ true) == Ternary.no);
|
|
assert((a ^ false) == Ternary.yes);
|
|
-----
|