45 using ModelInputs = mp_filter<IsInputArgument, ModelArgs>;
46 using ModelOutputs = mp_filter<IsOutputArgument, ModelArgs>;
48 using ModelInputsWrapped = mp_transform<mp_identity, ModelInputs>;
51 bool all_inputs_computed =
true;
52 mp_for_each<ModelInputsWrapped>(
54 &all_inputs_computed]<
typename Input>(mp_identity<Input>)
56 if (!computed_data.contains(std::type_index{typeid(Input)}))
58 ERR(
"Input {} of model {} has not been computed/set before the "
62 all_inputs_computed =
false;
65 if (!all_inputs_computed)
70 using ModelOutputsWrapped = mp_transform<mp_identity, ModelOutputs>;
73 bool no_output_precomputed =
true;
74 mp_for_each<ModelOutputsWrapped>(
76 &no_output_precomputed]<
typename Output>(mp_identity<Output>)
78 auto const [it, emplaced] = computed_data.emplace(
typeid(
Output));
82 ERR(
"Output {} of model {} is computed more than once.",
85 no_output_precomputed =
false;
89 return no_output_precomputed;
113 static_assert(mp_is_list<Models>::value);
114 static_assert(mp_is_list<Inputs>::value);
117 using InputsWrapped = mp_transform<mp_identity, Inputs>;
121 std::unordered_set<std::type_index> computed_data;
124 mp_for_each<InputsWrapped>(
125 [&computed_data]<
typename Input>(mp_identity<Input>)
126 { computed_data.emplace(
typeid(Input)); });
129 std::move(computed_data));