From 2f7b69d6d4cf18ca9ca04d9a44aaa6871ce51160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 7 Sep 2022 00:40:26 +0200 Subject: Improve error handling. --- c/util.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'c/util.h') diff --git a/c/util.h b/c/util.h index 668d040..561e232 100644 --- a/c/util.h +++ b/c/util.h @@ -13,13 +13,6 @@ #define CONCAT(a, b) CONCAT_IMPL(a, b) #define _ CONCAT(unused_, __LINE__) -#define SET_TERMINATE \ - std::set_terminate([]() noexcept \ - { \ - EBMessageBox(What(), L"Fatal Error", MB_ICONERROR); \ - _Exit(1); \ - }) - /* Scope guard. */ template struct Finally @@ -98,12 +91,12 @@ struct UniqueOk T v; UniqueOk(Unique&& u) : v(std::move(u.v)) { - assert(u.ok, "UniqueOk may not be constructed from non-ok Unique"); + assert(u.ok); u.ok = false; } UniqueOk& operator =(Unique&& u) { - assert(u.ok, "UniqueOk may not be constructed from non-ok Unique"); + assert(u.ok); F(v); v = std::move(u.v); u.ok = false; -- cgit v1.2.3