diff --git a/common/main/kconfig.h b/common/main/kconfig.h index 19a308aaa..e26a62027 100644 --- a/common/main/kconfig.h +++ b/common/main/kconfig.h @@ -125,7 +125,7 @@ extern fix Cruise_speed; #if MAX_JOYSTICKS template -struct joystick_text_length : tt::integral_constant= 10) ? (joystick_text_length::value + 1) : 1> +struct joystick_text_length : tt::integral_constant::value + (N >= 10)> { }; template <> @@ -134,30 +134,26 @@ struct joystick_text_length<0> : tt::integral_constant }; template -class joystick_text_t +class joystick_text_t : std::vector> { typedef std::vector > vector_type; - typedef typename vector_type::size_type size_type; - typedef typename vector_type::reference reference; - vector_type text; public: - void clear() { text.clear(); } - size_type size() const { return text.size(); } - void resize(size_type s) { text.resize(s); } - reference operator[](size_type s) { return text.at(s); } + using vector_type::clear; + using vector_type::size; + using vector_type::resize; + typename vector_type::reference operator[](typename vector_type::size_type s) + { + return this->at(s); + } }; #if MAX_AXES_PER_JOYSTICK -class joyaxis_text_t : public joystick_text_t::value + joystick_text_length::value> -{ -}; +using joyaxis_text_t = joystick_text_t::value + joystick_text_length::value>; extern joyaxis_text_t joyaxis_text; #endif #if MAX_BUTTONS_PER_JOYSTICK || MAX_HATS_PER_JOYSTICK -class joybutton_text_t : public joystick_text_t::value + joystick_text_length::value> -{ -}; +using joybutton_text_t = joystick_text_t::value + joystick_text_length::value>; extern joybutton_text_t joybutton_text; #endif