From 93d27519cada6906d853ff97f6ab3102b143ecb2 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 17 Jan 2023 10:35:01 -0500 Subject: [PATCH] Make functions const ref --- include/blt/window/window.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/blt/window/window.h b/include/blt/window/window.h index c097a1b..0589589 100644 --- a/include/blt/window/window.h +++ b/include/blt/window/window.h @@ -57,11 +57,11 @@ class window { virtual inline bool isKeyDown(int key) const { return keysDown.at(key); } virtual inline bool isMouseDown(int button) const {return mouseDown.at(button);}; // Function signature is window pointer to this, key press, pressed/released (true/false) - virtual inline void registerKeyListener(std::function listener) { + virtual inline void registerKeyListener(const std::function& listener) { keyListeners.push_back(listener); } // Function signature is window pointer to this, mouse button press, pressed/released (true/false) - virtual inline void registerMouseListener(std::function listener) { + virtual inline void registerMouseListener(const std::function& listener) { mouseListeners.push_back(listener); } };