std.allocator.allocate(0) -> return null or std.allocator.allocate(1)?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat May 16 12:50:07 PDT 2015


On Friday, 15 May 2015 at 20:34:13 UTC, Timon Gehr wrote:
>> I do think think this is what makes sense for us:
>>  - We should throw in case of error, not return null.
>
> - Too much overhead, there might be a fall-back installed.
> - Where do you allocate the exception object?

if (fallbackInstalled) return fallbackAllocate();
else throw OhMyGodException();


More information about the Digitalmars-d mailing list