3 ms·
try { MyType x{args, args}; x.DoSomething(); } catch (SomeException &e) { ... } You can't do much with the x if it didn't construct c
by codebje 8y ago
try {
MyType x{args, args};
x.DoSomething();
} catch (SomeException &e) {
...
}
You can't do much with the x if it didn't construct correctly, so you either need a strategy for a safe default value for x, or you need to bail entirely if an exception occurs.