os/include: use C++20 function template syntax

Issue #5227
This commit is contained in:
Norman Feske
2024-05-22 17:22:53 +02:00
committed by Christian Helmuth
parent 5e862b2cd3
commit cfd013a01a
32 changed files with 183 additions and 293 deletions

View File

@ -56,17 +56,16 @@ class Input::Session_client : public Genode::Rpc_client<Session>
/**
* Flush and apply functor to pending events
*
* \param func functor in the form of f(Event const &e)
* \param fn functor in the form of f(Event const &e)
* \return number of events processed
*/
template <typename FUNC>
void for_each_event(FUNC const &func)
void for_each_event(auto const &fn)
{
Genode::size_t const n = Genode::min((Genode::size_t)call<Rpc_flush>(), _max_events);
Event const *ev_buf = _event_ds.local_addr<const Event>();
for (Genode::size_t i = 0; i < n; ++i)
func(ev_buf[i]);
fn(ev_buf[i]);
}
};