From 78aebd7b86bcc380bad350f42d0a9cdecc19b210 Mon Sep 17 00:00:00 2001 From: Robin Linden Date: Wed, 15 Nov 2023 00:22:36 +0100 Subject: [PATCH] engine: Get rid of unnecessary templates to get nicer error messages Now, instead of getting an error in the setter when we try to assign to the mismatching type, we get an error in the code calling the setter with the wrong type. --- engine/engine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/engine.h b/engine/engine.h index 265dd5c05..bc6b414ca 100644 --- a/engine/engine.h +++ b/engine/engine.h @@ -31,9 +31,9 @@ class Engine { void set_layout_width(int width); - void set_on_navigation_failure(auto cb) { on_navigation_failure_ = std::move(cb); } - void set_on_page_loaded(auto cb) { on_page_loaded_ = std::move(cb); } - void set_on_layout_updated(auto cb) { on_layout_update_ = std::move(cb); } + void set_on_navigation_failure(std::function cb) { on_navigation_failure_ = std::move(cb); } + void set_on_page_loaded(std::function cb) { on_page_loaded_ = std::move(cb); } + void set_on_layout_updated(std::function cb) { on_layout_update_ = std::move(cb); } uri::Uri const &uri() const { return uri_; } protocol::Response const &response() const { return response_; }