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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 18 08:06:46 PST 2021


Mordante accepted this revision as: Mordante.
Mordante added a comment.

LGTM!



================
Comment at: libcxx/include/__utility/transaction.h:52
+struct __transaction {
+    __transaction() = delete;
+
----------------
ldionne wrote:
> Mordante wrote:
> > Why not omit this?
> I like calling out explicitly the properties of types instead of relying too much on the implicit rules, because these rules are pretty complicated. For example, see how I explicitly delete the copy constructor and the assignment operators below -- I could have relied on any number of implicit rules (e.g. the fact that we define a destructor explicitly) to get the same effect, but IMO it forces the reader to be more cleaver than I want.
> 
> LMK if you are not convinced and I'll remove it.
Actually I tend to do the same for copy/move constructor/assignment for the same reasons.
Somehow I never felt the need for the same needs for the default constructor.

So let's keep it.


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