DIP1001: Exception Handling Extensions

Chris Wright via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Jul 10 14:43:08 PDT 2016


On Sun, 10 Jul 2016 19:55:37 +0000, Superstar64 wrote:

> link: https://github.com/dlang/DIPs/pull/9 file:
> https://github.com/Superstar64/DIPs/blob/exception_extensions/DIPs/
DIP1001.md

So if my function calls any runtime functions -- it allocates memory, 
slices an array, etc -- I can't use C-style exception handling. Unless I 
manually do something like:

struct ThrowableWrapper {
  Throwable error;
}
int[] foo(int i) {
  try {
    return [i];
  } catch (Throwable t) {
    throw ThrowableWrapper(t);
  }
}


More information about the Digitalmars-d-announce mailing list