Hacker News new | past | comments | ask | show | jobs | submit login

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.



My second point is that with exceptions you can't guarantee the assignment of two objects, because the assignment operator can throw.


This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: