dereferencing null

Jonathan M Davis jmdavisProg at gmx.com
Fri Mar 2 03:05:59 PST 2012


On Friday, March 02, 2012 11:56:52 Jacob Carlborg wrote:
> I never thought about that.

It's the same in C++. I was quite surprised when I first ran into it. But as 
Daniel points out, the behavior is still defined, just less expected. If you 
actually use this (or any member variable, since that would use this) inside 
of that member function though, you'll get a segfault just like if it had been 
dereferenced before calling the function like it would be with a virtual 
function.

- Jonathan M Davis


More information about the Digitalmars-d mailing list