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

@ -39,14 +39,13 @@ struct File_system::Connection : Genode::Connection<Session>, Session_client
*
* \noapi
*/
template <typename FUNC>
auto _retry(FUNC func) -> decltype(func())
auto _retry(auto const &fn) -> decltype(fn())
{
enum { UPGRADE_ATTEMPTS = ~0U };
return Genode::retry<Out_of_ram>(
[&] () {
return Genode::retry<Out_of_caps>(
[&] () { return func(); },
[&] () { return fn(); },
[&] () { File_system::Connection::upgrade_caps(2); },
UPGRADE_ATTEMPTS);
},

View File

@ -248,8 +248,7 @@ class File_system::Packet_descriptor : public Genode::Packet_descriptor
size_t length() const { return _op != Opcode::WRITE_TIMESTAMP ? _length : 0; }
bool succeeded() const { return _success; }
template <typename FN>
void with_timestamp(FN const &fn) const
void with_timestamp(auto const &fn) const
{
if (_op == Opcode::WRITE_TIMESTAMP)
fn(_modification_time);