Re: Null references and access violation

2016-09-16 Thread Kagamin via Digitalmars-d
http://forum.dlang.org/post/atxyappczlyvqyalv...@forum.dlang.org

Re: Null references and access violation

2016-09-14 Thread pineapple via Digitalmars-d
On Wednesday, 14 September 2016 at 18:36:46 UTC, Jonathan M Davis wrote: If you don't want to have problems with dereferencing null pointers or references, then check for null in the cases where a pointer or reference might be null. - Jonathan M Davis Writing your functions that disallow nul

Re: Null references and access violation

2016-09-14 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, September 14, 2016 16:52:19 Bauss via Digitalmars-d wrote: > Can someone riddle me this, why D gives an access violation > instead of ex. a null reference exception? > > Like let's say you have a field that's a class and you forget to > give it a value. Now that will cause an access v

Re: Null references and access violation

2016-09-14 Thread Marco Leise via Digitalmars-d
Am Wed, 14 Sep 2016 16:52:19 + schrieb Bauss : > Can someone riddle me this, why D gives an access violation > instead of ex. a null reference exception? Access violations cost exactly 0. Noone needs to do anything extra for this check that isn't done by the CPU already. The next step is an