NULL indicator in Variant

Kagamin spam at here.lot
Thu Oct 27 22:00:28 PDT 2011


Steve Teale Wrote:

> > Any reason making a custom NULL type wouldn't work? i.e:
> > 
> > struct NULL {}
> > 
> > Variant var = NULL;
> > 
> > assert(var.type == typeof(NULL));
> 
> I don't think that is any improvement on hasValue(). It would tell you 
> the particular value was null, but would not tell you what type it was. 
> In a typical situation you need to tell the database server the type of 
> the parameter, even if it is null.

SQL uses `NULL` for all types.

Did you try Algebraic - type-restricted version of Variant?


More information about the Digitalmars-d mailing list