Hello,
So in my experience the biggest issue I had with using try-catch is for example when I try to construct a reference within try-catch - in order to capture only the exception that could occur there:
try {
auto &ref = func();
}
catch(...) {
}
Problem here is:
You either have to use reference wrapper or something like that if you want to handle only the exception that could potentially be thrown by func. And still it would be ugly.
What I'm proposing is something similar as in Java:
Where you could do:
try (auto &ref = func()) {
} catch(...) {
}
Similar way as in if statement and such.
Thanks
(And also additionally I'm sure someone has proposed this so yeah - you can just send me the reference then)