base-*: use C++20 function template syntax

Issue #5227
This commit is contained in:
Norman Feske
2024-06-28 16:05:26 +02:00
parent b5c9107465
commit a2b0553c51
51 changed files with 170 additions and 253 deletions

View File

@ -54,9 +54,8 @@ struct Core::Pager_entrypoint
{
Pager_entrypoint(Rpc_cap_factory &) { }
template <typename FUNC>
auto apply(Pager_capability, FUNC f) -> decltype(f(nullptr)) {
return f(nullptr); }
auto apply(Pager_capability, auto const &fn) -> decltype(fn(nullptr)) {
return fn(nullptr); }
Pager_capability manage(Pager_object &) { return Pager_capability(); }

View File

@ -89,8 +89,7 @@ class Genode::Capability_space_tpl : Noncopyable
*/
struct Tree_managed_data : Data, Avl_node<Tree_managed_data>
{
template <typename... ARGS>
Tree_managed_data(ARGS... args) : Data(args...) { }
Tree_managed_data(auto &&... args) : Data(args...) { }
Tree_managed_data() { }
@ -142,8 +141,7 @@ class Genode::Capability_space_tpl : Noncopyable
* The arguments are passed to the constructor of the
* 'Native_capability::Data' type.
*/
template <typename... ARGS>
Native_capability::Data &_create_capability_unsynchronized(ARGS &&... args)
Native_capability::Data &_create_capability_unsynchronized(auto &&... args)
{
addr_t const index = _alloc.alloc();

View File

@ -80,8 +80,7 @@ class Genode::Native_thread
/*
* Execute functor 'fn' in the context of the 'poll' method.
*/
template <typename FN>
void _exec_control(FN const &);
void _exec_control(auto const &fn);
public:

View File

@ -114,8 +114,7 @@ class Genode::Region_map_mmap : public Region_map, public Dataspace
Region_map_mmap(bool sub_rm, size_t size = ~0)
: _sub_rm(sub_rm), _size(size), _base(0) { }
template <typename FN>
void with_attached_sub_rm_base_ptr(FN const &fn)
void with_attached_sub_rm_base_ptr(auto const &fn)
{
if (_sub_rm && _is_attached())
fn((void *)_base);