Adding the ?. null verification

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 12:50:27 PDT 2014


H. S. Teoh:

> This also allows you to do a complete null check in a single 
> statement:
>
> 	if (maybe(tree).left.right.right.left.right !is null) {

Better with UFCS?

if (tree.perhaps.left.right.right.left.right !is null) {

Bye,
bearophile


More information about the Digitalmars-d mailing list