diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 56cc43fe5e..bbaa695511 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -158,7 +158,7 @@ class Engine final : public TriggerStateListener { * Slightly shorter helper function to keep the code looking clean. */ template - auto & module() { + constexpr auto & module() { return engineModules.get(); } diff --git a/firmware/util/containers/type_list.h b/firmware/util/containers/type_list.h index e9fa6e85e0..47f260eeef 100644 --- a/firmware/util/containers/type_list.h +++ b/firmware/util/containers/type_list.h @@ -63,13 +63,13 @@ struct type_list { * The return type is type_list or type_list> */ template - auto get() -> std::enable_if_t(), + constexpr auto get() -> std::enable_if_t(), decltype(first.template get())> { return first.template get(); } template - auto get() -> std::enable_if_t(), + constexpr auto get() -> std::enable_if_t(), decltype(others.template get())> { return others.template get(); } @@ -111,19 +111,19 @@ struct type_list { } template()>> - auto & get() { + constexpr auto & get() { return *this; } - auto & unmock() { + constexpr auto & unmock() { return me; } - base_t * operator->() { + constexpr base_t * operator->() { return &me; } - base_t & operator*() { + constexpr base_t & operator*() { return me; } }; @@ -170,7 +170,7 @@ struct type_list> { } template()>> - auto & get() { + constexpr auto & get() { return *this; } @@ -186,11 +186,11 @@ struct type_list> { } } - auto * operator->() { + constexpr auto * operator->() { return cur; } - auto & operator*() { + constexpr auto & operator*() { return *cur; }