Throwing D exceptions through C++ call stack

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Feb 20 21:04:13 UTC 2018


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,
etc.?

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?


T

-- 
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


More information about the Digitalmars-d mailing list