dereferencing null

Daniel Murphy yebblies at nospamgmail.com
Fri Mar 2 02:01:30 PST 2012


"Peter Alexander" <peter.alexander.au at gmail.com> wrote in message 
news:vicaibqyaerogseqsjbe at forum.dlang.org...
>>
>> It's defined. The operating system protects you. You get a segfault on 
>> *nix and
>> an access violation on Windows.
>
> False.
>
> [snip]
>
> You only get an error if there is a memory access involved (vtable, member 
> data etc.)
>

It _is_ defined, you get an access violation whenever there's a dereference. 
Yes, you can call some types of member functions without any dereferences, 
but this is alse well defined and sometimes quite useful. 




More information about the Digitalmars-d mailing list