Generic memory allocation in D
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Mon Mar 4 14:16:17 UTC 2024
On 04/03/2024 10:53 PM, Walter Bright wrote:
> On 3/4/2024 12:06 AM, Dom DiSc wrote:
>> But why does it now return true on failure and false on success?
>> Isn't this exacly the bad re-definition of boolean you advised us not
>> to use?
>
>
> It means I don't have to use ! in:
>
> if (foo())
> {
> error();
> return;
> }
As others have suggested, the truthiness here kinda matters and very
much goes against the grain of pretty much what everyone does.
It is going to cause readers a problem (and yourself!) in the future.
More information about the Digitalmars-d
mailing list