I want this so badly, please implement

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 7 11:14:59 PDT 2016


On Thursday, 7 April 2016 at 17:55:20 UTC, Steven Schveighoffer 
wrote:
> Can't you throw a segfault in the handler? The information is 
> still there on the stack, no?

Yes, of course, I can also printf the indexes myself. But the 
error could also carry a bit more useful information by default - 
and practically for free!


I'm even actually almost sold on the null pointer exception 
people ask for. It has more cost than a RangeError with index 
(seriously, the index and length are *already loaded* in 
registers for the comparison, it really is as close to free as 
you can get), but the convenience of the message by default is 
nice - and you can still get the nice segfault when actually 
running in the debugger by breaking on the handler or whatever.


More information about the Digitalmars-d mailing list