aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cru_debug.h4
-rw-r--r--src/main.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/cru_debug.h b/src/cru_debug.h
index a9800774..c750e11f 100644
--- a/src/cru_debug.h
+++ b/src/cru_debug.h
@@ -30,13 +30,13 @@ namespace cru::debug
return std::move(result);
}
#else
- inline void DebugTime(Function<void()>&& action, const StringView& hint_message)
+ inline void DebugTime(const std::function<void()>& action, const StringView& hint_message)
{
action();
}
template<typename TReturn>
- TReturn DebugTime(Function<TReturn()>&& action, const StringView& hint_message)
+ TReturn DebugTime(const std::function<TReturn()>& action, const StringView& hint_message)
{
return action();
}
diff --git a/src/main.cpp b/src/main.cpp
index 5fd59ede..f2e65dd2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -101,11 +101,12 @@ int APIENTRY wWinMain(
inner_layout->AddChild(TextBlock::Create(L"Toggle debug border"));
const auto toggle_button = ToggleButton::Create();
+#ifdef CRU_DEBUG_LAYOUT
toggle_button->toggle_event.AddHandler([&window](cru::ui::events::ToggleEventArgs& args)
{
window.SetDebugLayout(args.GetNewState());
});
-
+#endif
inner_layout->AddChild(toggle_button);
layout->AddChild(inner_layout);
}