std.experimental.allocator.make should throw on out-of-memory
Vladimir Panteleev via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 19 18:59:31 PDT 2016
On Tuesday, 19 April 2016 at 22:28:27 UTC, Alex Parrill wrote:
> * It eliminates the incredibly tedious, annoying, and
> easy-to-forget boilerplate after every allocation to check if
> the allocation succeeded.
FWIW, you can turn a false-ish (!value) function call result into
an exception by sticking .enforce() at the end. Perhaps this is
the use case for a Maybe type.
More information about the Digitalmars-d
mailing list