null assignment to bit variable

Sean Kelly sean at f4.ca
Mon Aug 14 18:34:20 PDT 2006


Peter Thomassen wrote:
> Hi,
> 
> the following doesn't work:
> 
> bit test; 
> test = null; 
>  
> I understand that this is not possible, but coming from the PHP world, I'm
> looking for a way to define that "test" hasn't got a value yet, not even
> true or false.
> 
> Is that possible? Is there a workaround?

     bool* test = null;

     test = new bool;

(note that bit has been replaced by bool in recent versions of D)


Sean



More information about the Digitalmars-d mailing list