Default value of class

Dave Dave_member at pathlink.com
Sat May 19 19:28:59 PDT 2007


David B. Held wrote:
> Can anyone tell me the expected runtime behavior of this program?
> 
> class Foo
> { }
> 
> void main()
> {
>     Foo foo;
>     assert(foo == null);
> }
> 
> It's certainly not what I expected, and I want to know if I should file 
> a bug report or not.
> 
> Dave

Try 'assert(foo is null);'



More information about the Digitalmars-d mailing list