3 ms·
You are just using the worng pattern. Use Computation a; Computation b; use(a, b); Then if the computation aborts in b, then computation a will be cleaned up a
by konstmonst 10y ago
You are just using the worng pattern. Use
Computation a;
Computation b;
use(a, b);
Then if the computation aborts in b, then computation a will be cleaned up as intended.
- pjc50 10y agoMy second point is that with exceptions you can't guarantee the assignment of two objects, because the assignment operator can throw.
- plorkyeran 10y agoThis was somewhat of a problem in C++03 because writing a copy assignment operator that can't fail is sometimes impossible, but I have never encountered a scenario where I was unable to make move assignment noexcept.