Commit 50b260db authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

core: replace template with function_ref

parent ffde95a6
Pipeline #28047 passed with stage
in 1 minute and 39 seconds
......@@ -5855,8 +5855,8 @@ struct simulation
});
}
template<typename Function>
void for_all_input_port(const model& mdl, Function f)
void for_all_input_port(const model& mdl,
function_ref<void(input_port&, input_port_id)> f)
{
dispatch(
mdl.type, [this, &f, dyn_id = mdl.id]<typename T>(T& dyn_models) {
......@@ -5873,8 +5873,8 @@ struct simulation
});
}
template<typename Function>
void for_all_output_port(const model& mdl, Function f)
void for_all_output_port(const model& mdl,
function_ref<void(output_port&, output_port_id)> f)
{
dispatch(
mdl.type, [this, &f, dyn_id = mdl.id]<typename T>(T& dyn_models) {
......
......@@ -410,7 +410,8 @@ protected:
return rc;
}
std::streambuf::int_type pbackfail(std::streambuf::int_type c) override final
std::streambuf::int_type pbackfail(
std::streambuf::int_type c) override final
{
if (traits_type::eq_int_type(c, traits_type::to_int_type('\n'))) {
--m_line_number;
......@@ -502,8 +503,8 @@ public:
return status::success;
}
template<typename CallBackFunction>
status operator()(simulation& sim, CallBackFunction f) noexcept
status operator()(simulation& sim,
function_ref<void(const model_id)> f) noexcept
{
irt_return_if_bad(do_read_model_number());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment