[libc++] Add a helper class to write code with the strong exception guarantee
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 14 Dec 2021 15:18:19 +0000 (10:18 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Mon, 20 Dec 2021 16:17:29 +0000 (11:17 -0500)
commit37e6bd8bc8da29ad485547a683c6685254d4011d
treed25a005db4f2178894698e5cdf2d2ce511f15267
parente1600db19d6303f84b995acb9340459694e06ea9
[libc++] Add a helper class to write code with the strong exception guarantee

__transaction is a helper class that allows rolling back code in case an
exception is thrown. The main goal is to reduce the clutter when code
needs to be guarded with `#if _LIBCPP_NO_EXCEPTIONS`.

Differential Revision: https://reviews.llvm.org/D115730
libcxx/include/CMakeLists.txt
libcxx/include/__utility/transaction.h [new file with mode: 0644]
libcxx/include/module.modulemap
libcxx/include/utility
libcxx/test/libcxx/diagnostics/detail.headers/utility/transaction.module.verify.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/transaction.pass.cpp [new file with mode: 0644]