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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 20 13:09:29 PST 2021


Quuxplusone added a comment.

@ldionne: I'd still prefer the version I showed in https://reviews.llvm.org/D115730?id=394248#inline-1106466 where the object doesn't have a `completed` data member at all (so it would better be named `__on_scope_exit` rather than `__transaction`). I'd also be interested in seeing a godbolt or something showing which approach gives better codegen. Naïvely, I would expect my preferred version would be no worse, and maybe a tiny bit better, because it gives the optimizer more freedom to rearrange the stack frame. But the reason I prefer it is for simplicity/readability: I think the `set_completed`/`__complete` thing is easy to mess up.


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