Problems with function as parameter

Mike Parker aldacron at gmail.com
Fri Sep 22 03:31:47 UTC 2017


On Friday, 22 September 2017 at 02:32:56 UTC, Josh wrote:

> Why should the binding force nothrow? I don't understand why 
> you HAVE to not throw exceptions. Is it because of the C -> D 
> aspect?

Yes, it's because D exceptions are not guaranteed to propagate 
through the C callstack. It works on some compiler/platforms, but 
not others. I wrote an article at Gamedev.net (which apparently 
no longer picks up the site's stylesheets) which shows one way of 
dealing with it. I've modified my approach since then (and should 
write a better article about it), but the basic idea still holds.

https://www.gamedev.net/articles/programming/general-and-gameplay-programming/d-exceptions-and-c-callbacks-r3323/


More information about the Digitalmars-d-learn mailing list