From 0cacd418234ca55f8daf2b411212c9f9021030c0 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 31 Mar 2016 12:22:21 +0200 Subject: [PATCH] base: forward arguments in unmanaged_singleton This enables the use of reference types for constructor arguments. --- repos/base/src/include/base/internal/unmanaged_singleton.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/base/src/include/base/internal/unmanaged_singleton.h b/repos/base/src/include/base/internal/unmanaged_singleton.h index e56d9302e0..b140f6abe1 100644 --- a/repos/base/src/include/base/internal/unmanaged_singleton.h +++ b/repos/base/src/include/base/internal/unmanaged_singleton.h @@ -55,7 +55,7 @@ struct Unmanaged_singleton_constructor * Call the constructor of 'T' with arguments 'args' at 'dst' */ template - 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 -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'