nothrow by default

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jan 9 20:39:57 UTC 2020


On Thu, Jan 09, 2020 at 07:05:24PM -0000, Johannes Pfau via Digitalmars-d wrote:
> Am Thu, 09 Jan 2020 08:02:16 -0800 schrieb H. S. Teoh:
[...]
> I think everyone who wants to move away from exceptions really wants
> to move away from two things:
> 
> 1) Stack unwinding and the overhead it involves (memory,
>    implementation complexity, ...)
> 2) (Forced) dynamic allocation of error state. How often do you
>    actually use more than 1 word of error state? 

What can you practically throw, though, if you only have 1 word of error
state? I suppose you could store a pointer to some exception object in
there, but then that brings us back to issue (2). Unless you have some
kind of thread-local global for storing exception objects?


> That's basically what Sutter proposes for C++, what I summarized in
> https://forum.dlang.org/post/qusdvn$635$1@digitalmars.com and what you
> quickly summarized in your idea.
> 
> AFAICS nobody (few people?) wants to get rid of the high-level
> try-catch exception semantics.
[...]

That's also my suspicion.  It's not really the exceptions themselves
that people object to, but the associated implementation issues.


T

-- 
Just because you can, doesn't mean you should.


More information about the Digitalmars-d mailing list