Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made scope exit class abide rule of 5. #125

Merged
merged 4 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/dependencies/interval_tree.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies/roar.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nui/include/nui/event_system/range_event_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
friend bool operator!=(RangeStateInterval const& lhs, RangeStateInterval const& rhs)
{
Expand Down
21 changes: 19 additions & 2 deletions nui/include/nui/utility/scope_exit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading