[OT] - C++ exceptions are becoming more and more problematic

IGotD- nise at nise.com
Thu Mar 3 15:43:03 UTC 2022


On Thursday, 3 March 2022 at 12:19:44 UTC, rikki cattermole wrote:
>
> We could do something like this, with both isNull methods and a 
> value type exception. We just need this extra form of catch 
> statement.
>
> Could be a pretty good simple addition to whatever DIP is put 
> forward.
>
> ```diff
> Catch:
> +	"catch" NoScopeNonEmptyStatement
> ```

How is it with value type exceptions, would they need typeinfo as 
well? If it needs typeinfo, then it wouldn't work with better C. 
Actually I would rather omitting typeinfo to be a separate 
compiler switch as typeinfo is such a useful feature you should 
be able to pick if you need it or not.

For those embedded systems that have no space for typeinfo, then 
I'd say that value type exception shouldn't work. In those 
systems you probably want full control and your own error 
handling anyway. For embedded system that has a bit more room, 
then value type exceptions together with typeinfo is a good 
compromise.


More information about the Digitalmars-d mailing list