Initialization vs Assignment

jerro a at a.com
Sun Nov 3 08:01:43 PST 2013


> Now we can't have an A as a member of X? (it would free a null 
> pointer)

Actually, there is nothing wrong with calling free on a null 
pointer.
 From the C 89 standard:

> The free function causes the space pointed to by ptr to be 
> deallocated, that is, made available for further allocation. If 
> ptr is a null pointer, no action occurs.


More information about the Digitalmars-d mailing list