mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
base: forward arguments in unmanaged_singleton
This enables the use of reference types for constructor arguments.
This commit is contained in:
parent
02f84f98c3
commit
0cacd41823
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user