Generic memory allocation in D

Dom DiSc dominikus at scherkl.de
Mon Mar 4 11:40:30 UTC 2024


On Monday, 4 March 2024 at 09:53:17 UTC, Walter Bright wrote:
> On 3/4/2024 12:06 AM, Dom DiSc wrote:
>> 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;
>     }

That's a very weak argument.
Normally if one calls a function, the if-part is where the result 
is worked with (the main path) and the else part is for 
error-handling. This is especially true for ReadFile().
That in this specific case only an error handling part exists is 
the exception, not the rule.


More information about the Digitalmars-d mailing list