C++/D interface: exceptions

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 11 22:01:04 PDT 2014


On 12 Sep 2014 01:35, "Andrei Alexandrescu via Digitalmars-d" <
digitalmars-d at puremagic.com> wrote:
>
> Hello,
>
>
> We are racking our brains to figure out what to do about exceptions
thrown from C++ functions into D code that calls them.
>
> A few levels of Nirvana would go like this:
>
> 0. Undefined behavior - the only advantage to this is we're there already
with no work :o).
>
> 1. C++ exceptions may be caught only by C++ code on the call stack; D
code does the stack unwinding appropriately (dtors, scope statements) but
can't catch stuff.
>

Libunwind + handling foreign exceptions you can do this.  And is beneficial
in that it works with any other languages that use libunwind, such as gccgo.

Iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140912/4e42aa09/attachment.html>


More information about the Digitalmars-d mailing list