The new ?? and ??? operators

Rioshin an'Harthen rharth75 at hotmail.com
Mon Sep 24 05:04:47 PDT 2007


"Arlen Albert Keshabyan" <arlen.albert at gmail.com> kirjoitti viestissä 
news:fd7rir$2u8a$1 at digitalmars.com...
> ?? operator should handle only object references, I think. Nothing more 
> than that.

I can't begin to count how many times I've written code like

    long id = data.GetLong("ID") ?? 0;

or

    long? id = data.GetLong("ID");

and then later accessing the value with

    id ?? 0

at some other point when doing DB coding with C#.

The ?? operator, as well as the nullable ? types, are quite nice to have 
when interfacing with the database. 




More information about the Digitalmars-d mailing list