www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Throwing D exceptions through C++ call stack

I'm piecewise migrating one of my old C++ projects to D, and one of the
major issues right now is exception handling.

What's the state of C++ exception support right now?  Is it safe for a D
function (called from C++ code) to throw an exception, and have the
stack unwind through the C++ call stack and caught by D code at the
bottom of the stack?  Or will it potentially interact badly with the C++
part of the call stack?  I'm guessing C++ dtors may not get called,

Conversely, is it safe for C++ code to throw an exception that unwinds
through D functions in the call stack, and caught by a C++ catch block?


Elegant or ugly code as well as fine or rude sentences have something in
common: they don't depend on the language. -- Luca De Vitis
Feb 20 2018