mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-07 02:42:58 +00:00
Squashed 'externals/mcl/' changes from 761b7c05e..0172df743
0172df743 CMakeLists: Only add tests if MASTER_PROJECT 52e8dff62 0.1.11 fc8d745cc container: hmap fixups 5b5c0130d memory: Add overaligned_unique_ptr c7c9bbd17 mcl: Increment version to 0.1.10 678aa32a8 assert: Handle expr strings separately b38a9d2ef tests: Update to Catch 3.0.1 8aeacfe32 mcl: Increment version to 0.1.9 b468a2ab5 mcl: meta_byte: Split off meta_byte_group d3ae1ae47 mcl: ihmap: Implement inline variant of hmap 5cbfe6eed mcl: hmap: Split detail into headers ee7467677 mcl: hmap: Better default hash f1d902ce9 mcl: hash: Add xmrx 322a221f0 mcl: hmap: Bugfix skip_empty_or_tombstone 689f393f7 mcl: hmap: x64 implementation fa6ff746a mcl: hmap: Add generic meta_byte_group implementation 91e3073ad mcl: hmap: Add more member functions 4998335a5 mcl: Install only if master project 7ff4d2549 mcl: hmap prototype 416a2c6b5 mcl: clang-format: Adopt WebKit style bracing d5a46fa70 mcl/assert: Flush stderr e3b6cc79e externals: Update mcl to 0.1.7 190c68475 mcl: Build as PIC git-subtree-dir: externals/mcl git-subtree-split: 0172df74316351868c215f735e5a2538b10d71fb
This commit is contained in:
@@ -20,8 +20,10 @@ template<typename Function>
|
||||
class scope_exit final {
|
||||
public:
|
||||
explicit scope_exit(Function&& fn)
|
||||
: function(std::move(fn)) {}
|
||||
~scope_exit() noexcept {
|
||||
: function(std::move(fn)) {}
|
||||
|
||||
~scope_exit() noexcept
|
||||
{
|
||||
function();
|
||||
}
|
||||
|
||||
@@ -33,8 +35,10 @@ template<typename Function>
|
||||
class scope_fail final {
|
||||
public:
|
||||
explicit scope_fail(Function&& fn)
|
||||
: function(std::move(fn)), exception_count(std::uncaught_exceptions()) {}
|
||||
~scope_fail() noexcept {
|
||||
: function(std::move(fn)), exception_count(std::uncaught_exceptions()) {}
|
||||
|
||||
~scope_fail() noexcept
|
||||
{
|
||||
if (std::uncaught_exceptions() > exception_count) {
|
||||
function();
|
||||
}
|
||||
@@ -49,8 +53,10 @@ template<typename Function>
|
||||
class scope_success final {
|
||||
public:
|
||||
explicit scope_success(Function&& fn)
|
||||
: function(std::move(fn)), exception_count(std::uncaught_exceptions()) {}
|
||||
~scope_success() {
|
||||
: function(std::move(fn)), exception_count(std::uncaught_exceptions()) {}
|
||||
|
||||
~scope_success()
|
||||
{
|
||||
if (std::uncaught_exceptions() <= exception_count) {
|
||||
function();
|
||||
}
|
||||
@@ -64,17 +70,20 @@ private:
|
||||
// We use ->* here as it has the highest precedence of the operators we can use.
|
||||
|
||||
template<typename Function>
|
||||
auto operator->*(scope_exit_tag, Function&& function) {
|
||||
auto operator->*(scope_exit_tag, Function&& function)
|
||||
{
|
||||
return scope_exit<std::decay_t<Function>>{std::forward<Function>(function)};
|
||||
}
|
||||
|
||||
template<typename Function>
|
||||
auto operator->*(scope_fail_tag, Function&& function) {
|
||||
auto operator->*(scope_fail_tag, Function&& function)
|
||||
{
|
||||
return scope_fail<std::decay_t<Function>>{std::forward<Function>(function)};
|
||||
}
|
||||
|
||||
template<typename Function>
|
||||
auto operator->*(scope_success_tag, Function&& function) {
|
||||
auto operator->*(scope_success_tag, Function&& function)
|
||||
{
|
||||
return scope_success<std::decay_t<Function>>{std::forward<Function>(function)};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user