From b62ee333181bad56423ae75e795b0c6aca8b3412 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 12 May 2020 00:19:48 -0400 Subject: [PATCH] Improves constness of Joystick interface. --- Inputs/Joystick.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Inputs/Joystick.hpp b/Inputs/Joystick.hpp index 49f20dfcf..3d0313f78 100644 --- a/Inputs/Joystick.hpp +++ b/Inputs/Joystick.hpp @@ -98,7 +98,7 @@ class Joystick { }; /// @returns The list of all inputs defined on this joystick. - virtual std::vector &get_inputs() = 0; + virtual const std::vector &get_inputs() = 0; /*! Sets the digital value of @c input. This may have direct effect or @@ -170,7 +170,7 @@ class ConcreteJoystick: public Joystick { } } - std::vector &get_inputs() final { + const std::vector &get_inputs() final { return inputs_; } @@ -223,7 +223,7 @@ class ConcreteJoystick: public Joystick { } private: - std::vector inputs_; + const std::vector inputs_; enum class StickType { Digital,