Article: D Exceptions and C Callbacks
QAston
qaston at gmail.com
Tue Aug 6 10:54:32 PDT 2013
On Tuesday, 6 August 2013 at 15:05:22 UTC, Mike Parker wrote:
> Shows how I like to deal with throwing exceptions from C
> callbacks in D. Target audience is beginner-level. Uses GLFW to
> demonstrate.
>
> http://www.gamedev.net/page/resources/_/technical/general-programming/d-exceptions-and-c-callbacks-r3323
Good article, thanks.
There's one thing though. You say than relying on coder's
discipline is error prone and I totally agree with that. But your
sollution requires coder to remember to wrap those callbacks in
try-catches. Maybe modifying glfwSetWindowCloseCallback and
similar functions to only accept nothrow functions is a good idea?
More information about the Digitalmars-d-announce
mailing list