Safe navigation operator

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Feb 19 18:00:08 PST 2012


Hmm.. safe, but what about void methods? Silently not invoking methods
seems like a bad idea to me.

crypto?.encrypt(password)
Oops! :P

The Elvis operator looks kind of neat though. Although in D it's a bit
challenging since cast(bool) doesn't always do what you want. E.g. it
returns false on non-initialized string, true on zero-length
initialized string.


More information about the Digitalmars-d mailing list