On 9/24/14, 9:05 AM, Sean Kelly wrote:
On Wednesday, 24 September 2014 at 15:07:05 UTC, Andrei Alexandrescu wrote:
On 9/24/14, 5:12 AM, Iain Buclaw via Digitalmars-d wrote:

Is there plans to catching C++ exceptions in D?

I'd say no to such an idea.

I understand the difficulty of it. However, we should look into it
closely. Preventing D code from catching C++ exceptions forces one to
implement the driver/event loop/etc in C++, which is quite unpleasant.
It essentially takes C++ compatibility a few good notches down.

If C++ code can execute D delegates, perhaps an intermediate step would
be to create a wrapper in C++ that calls the delegate wrapped in an
appropriate try/catch block.  Syntax would be a bit weird as you'd have
to specify a callback for each exception type you wanted to catch, but
it seems doable.

That's a good idea, thanks. -- Andrei

Reply via email to