Use C++ exception model in D

Iain Buclaw ibuclaw at gdcproject.org
Tue Apr 8 00:51:15 PDT 2014


On 8 April 2014 07:36, Jacob Carlborg <doob at me.com> wrote:
> How feasible would it be if D moved to using the same exception model as
> C++?
>
> The advantage of this would be that D exceptions would become compatible
> with C++ exceptions. It would also mean that D exceptions would become
> compatible with Objective-C exceptions on OS X 64bit, since they use the
> same exception model as C++. I'm not sure, but if GDC and LDC already use
> the C++ exception model it would probably make their lives easier as well.
>
> The disadvantages are that someone needs to implement it. I'm not sure, but
> it may also break existing code.
>
> Note, I'm mostly interested in Posix 64bit.
>

We use libunwind, which is the same as what the C++ exception model
uses, but we implement our own EH routines on-top of that to handle D
exceptions specifically.  This is typically what all gcc languages
with EH do.


More information about the Digitalmars-d mailing list