From b7c220a63075b81c527972790fe4b57cf52d6c97 Mon Sep 17 00:00:00 2001 From: Tim Ebbeke Date: Sat, 23 Nov 2024 21:39:14 +0100 Subject: [PATCH 1/4] Made scope exit class abide rule of 5. --- cmake/dependencies/interval_tree.cmake | 2 +- nui/include/nui/utility/scope_exit.hpp | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cmake/dependencies/interval_tree.cmake b/cmake/dependencies/interval_tree.cmake index 343dd8b9..023f1321 100644 --- a/cmake/dependencies/interval_tree.cmake +++ b/cmake/dependencies/interval_tree.cmake @@ -1,6 +1,6 @@ option(NUI_FETCH_INTERVAL_TREE "Fetch interval tree" ON) set(NUI_INTERVAL_TREE_GIT_REPOSITORY "https://github.com/5cript/interval-tree.git" CACHE STRING "interval tree git repository") -set(NUI_INTERVAL_TREE_GIT_TAG "v2.2.4" CACHE STRING "interval tree git tag") +set(NUI_INTERVAL_TREE_GIT_TAG "v2.3.2" CACHE STRING "interval tree git tag") if(NUI_FETCH_INTERVAL_TREE) include(FetchContent) diff --git a/nui/include/nui/utility/scope_exit.hpp b/nui/include/nui/utility/scope_exit.hpp index e013ed99..7324812b 100644 --- a/nui/include/nui/utility/scope_exit.hpp +++ b/nui/include/nui/utility/scope_exit.hpp @@ -16,11 +16,28 @@ namespace Nui {} ~ScopeExit() { - onExit_(); + if (onExit_) + onExit_(); } + ScopeExit(ScopeExit&& other) + : onExit_(std::move(other.onExit_)) + { + other.onExit_ = {}; + } + ScopeExit& operator=(ScopeExit&& other) + { + if (this != &other) + { + onExit_ = std::move(other.onExit_); + other.onExit_ = {}; + } + return *this; + } + ScopeExit(const ScopeExit&) = delete; + ScopeExit& operator=(const ScopeExit&) = delete; void disarm() { - onExit_ = [] {}; + onExit_ = {}; } private: From d357e0adbdd0c29bcb79a3b459490ba8eac68243 Mon Sep 17 00:00:00 2001 From: 5cript Date: Sat, 23 Nov 2024 22:08:50 +0100 Subject: [PATCH 2/4] Updated roar. --- cmake/dependencies/roar.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/dependencies/roar.cmake b/cmake/dependencies/roar.cmake index 94f326f7..a5022868 100644 --- a/cmake/dependencies/roar.cmake +++ b/cmake/dependencies/roar.cmake @@ -1,6 +1,6 @@ option(NUI_FETCH_ROAR "Fetch roar" ON) set(NUI_ROAR_REPOSITORY "https://github.com/5cript/roar.git" CACHE STRING "roar repository") -set(NUI_ROAR_TAG "2781a88fcd1fce9af1a697673e26fd3ad55817e9" CACHE STRING "roar tag") +set(NUI_ROAR_TAG "a8eda5bc6d4800a8f389a3007e793eb233ea6192" CACHE STRING "roar tag") if(NUI_FETCH_ROAR) include(FetchContent) From 5bb460a586c22ae9c825492eb7e75a1755ae5fff Mon Sep 17 00:00:00 2001 From: 5cript Date: Sat, 23 Nov 2024 22:50:03 +0100 Subject: [PATCH 3/4] Fixed wrong members used. --- nui/include/nui/event_system/range_event_context.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nui/include/nui/event_system/range_event_context.hpp b/nui/include/nui/event_system/range_event_context.hpp index f1b1c745..805d4bd7 100644 --- a/nui/include/nui/event_system/range_event_context.hpp +++ b/nui/include/nui/event_system/range_event_context.hpp @@ -45,7 +45,7 @@ namespace Nui } friend bool operator==(RangeStateInterval const& lhs, RangeStateInterval const& rhs) { - return lhs.start_ == rhs.start_ && lhs.end_ == rhs.end_ && lhs.type_ == rhs.type_; + return lhs.low_ == rhs.low_ && lhs.high_ == rhs.high_ && lhs.type_ == rhs.type_; } friend bool operator!=(RangeStateInterval const& lhs, RangeStateInterval const& rhs) { From e21953c7a4278c02afa789b3e4a50b598f01a228 Mon Sep 17 00:00:00 2001 From: 5cript Date: Sat, 23 Nov 2024 22:58:22 +0100 Subject: [PATCH 4/4] Removed check for missing member. --- nui/include/nui/event_system/range_event_context.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nui/include/nui/event_system/range_event_context.hpp b/nui/include/nui/event_system/range_event_context.hpp index 805d4bd7..95685191 100644 --- a/nui/include/nui/event_system/range_event_context.hpp +++ b/nui/include/nui/event_system/range_event_context.hpp @@ -45,7 +45,7 @@ namespace Nui } friend bool operator==(RangeStateInterval const& lhs, RangeStateInterval const& rhs) { - return lhs.low_ == rhs.low_ && lhs.high_ == rhs.high_ && lhs.type_ == rhs.type_; + return lhs.low_ == rhs.low_ && lhs.high_ == rhs.high_; } friend bool operator!=(RangeStateInterval const& lhs, RangeStateInterval const& rhs) {