NULL indicator in Variant

Alex Rønne Petersen xtzgzorex at gmail.com
Thu Oct 27 06:42:07 PDT 2011


On 27-10-2011 15:12, Steve Teale wrote:
> How big a deal would it be to add a NULL indicator to the VariantN struct.
>
> I use the term NULL as opposed to null deliberately. Variant already
> provides the hasValue() method, which can serve as a null indicator. But
> in using it as a parameter in database modules, it would be useful to be
> able to give a Variant instance a type, as in v = "", but also to set it
> explicitly as NULL with setNull() or whatever.
>
> Could this fly without breaking existing code?
>
> Steve

I'm not sure having three possible states in Variant is a good idea, but 
maybe I'm not quite following.

Doesn't it already carry type information when not set to a value?

- Alex


More information about the Digitalmars-d mailing list