based

Opinionated utility library
git clone git://git.dimitrijedobrota.com/based.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

commit e3086e7652c29eab4839561eaa4d77fd3dfe5d80
parent 9eca6e4aef6bd73e894a009f5ab5ee22707d4c50
author Dimitrije Dobrota < mail@dimitrijedobrota.com >
date Tue, 29 Apr 2025 15:04:41 +0200

Workaround so it can compile for now...

Diffstat:
M include/based/template.hpp | ++++
M test/source/scopeguard_test.cpp | ++ ------

2 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/ include/based/template.hpp b/ include/based/template.hpp

@@ -383,10 +383,12 @@ public:

{
}

/*
scopeguard(const Func& func) // NOLINT explicit
: m_func(func)
{
}
*/

scopeguard(const scopeguard&) = delete;
scopeguard& operator=(const scopeguard&) = delete;

@@ -414,10 +416,12 @@ public:

{
}

/*
scopeguard(const Func& func) // NOLINT explicit
: m_func(func)
{
}
*/

scopeguard(const scopeguard&) = delete;
scopeguard& operator=(const scopeguard&) = delete;

diff --git a/ test/source/scopeguard_test.cpp b/ test/source/scopeguard_test.cpp

@@ -55,10 +55,8 @@ TEST_CASE("on success", "[template/scopeguard]")

SECTION("success")
{
int test = 0;
auto func = set(test);

try {
const based::scopeguard_success guard = func;
const based::scopeguard_success guard = set(test);
} catch (...) {
test *= 1;
}

@@ -69,10 +67,8 @@ TEST_CASE("on success", "[template/scopeguard]")

SECTION("failure")
{
int test = 0;
auto func = set(test);

try {
const based::scopeguard_success guard = func;
const based::scopeguard_success guard = set(test);
throw std::runtime_error {"should not leak"};
} catch (...) {
test *= 1;