mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
base: forward arguments in unmanaged_singleton
This enables the use of reference types for constructor arguments.
This commit is contained in:
@@ -55,7 +55,7 @@ struct Unmanaged_singleton_constructor
|
||||
* Call the constructor of 'T' with arguments 'args' at 'dst'
|
||||
*/
|
||||
template <typename T, typename... ARGS>
|
||||
static void call(char * const dst, ARGS... args) { new (dst) T(args...); }
|
||||
static void call(char * const dst, ARGS &&... args) { new (dst) T(args...); }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ struct Unmanaged_singleton_constructor
|
||||
* \return object pointer
|
||||
*/
|
||||
template <typename T, int ALIGNMENT = sizeof(Genode::addr_t), typename... ARGS>
|
||||
static inline T * unmanaged_singleton(ARGS... args)
|
||||
static inline T * unmanaged_singleton(ARGS &&... args)
|
||||
{
|
||||
/*
|
||||
* Each instantiation of the function template with a different type 'T'
|
||||
|
||||
Reference in New Issue
Block a user