Re: Type Inference and Try Blocks

2020-01-22 Thread Henry Claesson via Digitalmars-d-learn
Thank you for the help and input, Adam and Mitacha. I don't know why I thought I must use `try` with every throwable function call instead "bundling" those calls into one `try` block. Not "bundling" defeats one of the benefits of exceptions. Also, `ifThrown` is quite interesting. Again, thank

Type Inference and Try Blocks

2020-01-20 Thread Henry Claesson via Digitalmars-d-learn
This isn't a D-specific "problem", but there may be D-specific solutions. I have a function `doSomething()` that returns a Voldemort type, and this same function also throws. So, there's this: try { auto foo = doSomething(); } catch (AnException e) { // Do stuff } The problem that I'm