51 using ModelInputs = mp_filter<IsInputArgument, ModelArgs>;
52 using ModelOutputs = mp_filter<IsOutputArgument, ModelArgs>;
54 using ModelInputsWrapped = mp_transform<mp_identity, ModelInputs>;
57 bool all_inputs_computed =
true;
58 mp_for_each<ModelInputsWrapped>(
60 &all_inputs_computed]<
typename Input>(mp_identity<Input>)
62 if (!computed_data.contains(std::type_index{typeid(Input)}))
64 ERR(
"Input {} of model {} has not been computed/set before the "
66 typeid(Input).name(), typeid(Model).name());
67 all_inputs_computed = false;
70 if (!all_inputs_computed)
75 using ModelOutputsWrapped = mp_transform<mp_identity, ModelOutputs>;
78 bool no_output_precomputed =
true;
79 mp_for_each<ModelOutputsWrapped>(
81 &no_output_precomputed]<
typename Output>(mp_identity<Output>)
83 auto const [it, emplaced] = computed_data.emplace(
typeid(
Output));
87 ERR(
"Output {} of model {} is computed more than once.",
89 typeid(Model).name());
90 no_output_precomputed =
false;
94 return no_output_precomputed;
118 static_assert(mp_is_list<Models>::value);
119 static_assert(mp_is_list<Inputs>::value);
122 using InputsWrapped = mp_transform<mp_identity, Inputs>;
126 std::unordered_set<std::type_index> computed_data;
129 mp_for_each<InputsWrapped>(
130 [&computed_data]<
typename Input>(mp_identity<Input>)
131 { computed_data.emplace(
typeid(Input)); });
134 std::move(computed_data));