[Issue 24842] No ability to overload unary logial not operator
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 4 23:37:50 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24842
--- Comment #4 from Dominikus Dittes Scherkl <dominikus at scherkl.de> ---
This is the reason some operators are convoluted - to prevent someone from
shooting himself in the feat by implementing them inconsistently.
Everybody expects the ! operator to return a boolean, not some "boolish"
object.
This is because it is used in conditions, where nothing else then the logical
value is needed. Any other information is not evaluated in a condition, so why
keep it?
If you want something different, write some other member function which returns
something "not-ish".
--
More information about the Digitalmars-d-bugs
mailing list