Skip to content

Commit

Permalink
engine: Get rid of unnecessary templates to get nicer error messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robinlinden committed Nov 14, 2023
1 parent e69b430 commit 78aebd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(protocol::Error)> cb) { on_navigation_failure_ = std::move(cb); }
void set_on_page_loaded(std::function<void()> cb) { on_page_loaded_ = std::move(cb); }
void set_on_layout_updated(std::function<void()> cb) { on_layout_update_ = std::move(cb); }

uri::Uri const &uri() const { return uri_; }
protocol::Response const &response() const { return response_; }
Expand Down

0 comments on commit 78aebd7

Please sign in to comment.