[libcxx-commits] [PATCH] D115730: [libc++] Add a helper class to write code with the strong exception guarantee

Daniel McIntosh via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 14 16:13:47 PST 2021


DanielMcIntosh-IBM added inline comments.


================
Comment at: libcxx/include/__utility/transaction.h:80
+    _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__transaction() {
+        if (!__completed_)
+            __rollback_();
----------------
Would it be possible to get rid of `__complete()` by replacing this with something like `if (std::uncaught_exceptions() > initial_exception_count)` and initializing `initial_exception_count = std::uncaught_exceptions()` in the constructor?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115730/new/

https://reviews.llvm.org/D115730



More information about the libcxx-commits mailing list