@@ -65,13 +65,14 @@ concept validate_component_types_c =
6565
6666} // namespace detail
6767
68- template <class T , class U > struct MainModelType ;
68+ template <class T , class U > class MainModelType ;
6969
7070// TODO: discussion on checking dependent types can also be done here.
7171template <class ... ExtraRetrievableType, class ... ComponentType>
7272 requires detail::validate_component_types_c<ComponentList<ComponentType...>>
73- struct MainModelType <ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentList<ComponentType...>> {
73+ class MainModelType <ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentList<ComponentType...>> {
7474
75+ public:
7576 using ComponentContainer = Container<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentType...>;
7677 using MainModelState = main_core::MainModelState<ComponentContainer>;
7778 using ComponentTypesTuple = std::tuple<ComponentType...>;
@@ -116,11 +117,12 @@ struct MainModelType<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLi
116117 std::array{index_of_component<Line>, index_of_component<Link>, index_of_component<Transformer>};
117118 static constexpr auto shunt_param_in_seq_map = std::array{index_of_component<Shunt>};
118119
119- template <class Functor > static constexpr void run_functor_with_all_component_types_return_void (Functor functor) {
120- (functor.template operator ()<ComponentType>(), ...);
120+ template <class Functor > static constexpr void run_functor_with_all_component_types_return_void (Functor&& functor) {
121+ (std::forward<Functor>( functor) .template operator ()<ComponentType>(), ...);
121122 }
122- template <class Functor > static constexpr auto run_functor_with_all_component_types_return_array (Functor functor) {
123- return std::array { functor.template operator ()<ComponentType>()... };
123+ template <class Functor >
124+ static constexpr auto run_functor_with_all_component_types_return_array (Functor&& functor) {
125+ return std::array { std::forward<Functor>(functor).template operator ()<ComponentType>()... };
124126 }
125127};
126128
0 commit comments