base: forward arguments in unmanaged_singleton

This enables the use of reference types for constructor arguments.
This commit is contained in:
Christian Helmuth 2016-03-31 12:22:21 +02:00
parent 02f84f98c3
commit 0cacd41823

View File

@ -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'