Adding the ?. null verification
logicchains via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 18 20:10:48 PDT 2014
On Thursday, 19 June 2014 at 00:36:23 UTC, H. S. Teoh via
Digitalmars-d wrote:
> I decided to run some tests on the compiled code to see how
> performant
> However, with gdc -O3 -finline, all of the opDispatch calls got
> inlined,
> and the assembly is the direct equivalent of:
>
> if (tree !is null)
> if (tree.left !is null)
> ...
> writeln(tree.left.right. ... .val);
>
Somebody should blog on this or put it on the front page or
something; how many other languages allow a cost-free maybe monad
to be implemented in library code?
More information about the Digitalmars-d
mailing list