@@ -35,12 +35,13 @@ constexpr auto filter_tuple_types(std::tuple<std::type_identity<Types>...> /*unu
3535
3636} // namespace detail
3737
38- template <class T , class U > struct MainModelType ;
38+ template <class T , class U > class MainModelType ;
3939
4040// TODO: discussion on checking dependent types can also be done here.
4141template <class ... ExtraRetrievableType, class ... ComponentType>
42- struct MainModelType <ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentList<ComponentType...>> {
42+ class MainModelType <ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentList<ComponentType...>> {
4343
44+ public:
4445 using ComponentContainer = Container<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentType...>;
4546 using MainModelState = main_core::MainModelState<ComponentContainer>;
4647 using ComponentTypesTuple = std::tuple<ComponentType...>;
@@ -80,11 +81,12 @@ struct MainModelType<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLi
8081 using SequenceIdxRefWrappers = std::array<std::reference_wrapper<std::vector<Idx2D> const >, n_types>;
8182 using ComponentFlags = std::array<bool , n_types>;
8283
83- template <class Functor > static constexpr void run_functor_with_all_component_types_return_void (Functor functor) {
84- (functor.template operator ()<ComponentType>(), ...);
84+ template <class Functor > static constexpr void run_functor_with_all_component_types_return_void (Functor&& functor) {
85+ (std::forward<Functor>( functor) .template operator ()<ComponentType>(), ...);
8586 }
86- template <class Functor > static constexpr auto run_functor_with_all_component_types_return_array (Functor functor) {
87- return std::array { functor.template operator ()<ComponentType>()... };
87+ template <class Functor >
88+ static constexpr auto run_functor_with_all_component_types_return_array (Functor&& functor) {
89+ return std::array { std::forward<Functor>(functor).template operator ()<ComponentType>()... };
8890 }
8991};
9092
0 commit comments