diff --git a/src/Delegate/DelegateAsync.h b/src/Delegate/DelegateAsync.h index 4384940..8ea024a 100644 --- a/src/Delegate/DelegateAsync.h +++ b/src/Delegate/DelegateAsync.h @@ -36,7 +36,7 @@ class DelegateAsyncMsg : public DelegateMsg /// @param[in] invoker - the invoker instance /// @param[in] args - a parameter pack of all target function arguments DelegateAsyncMsg(std::shared_ptr invoker, Args... args) : DelegateMsg(invoker), - m_args(make_tuple_heap(m_heapMem, m_start, args...)) + m_args(make_tuple_heap(m_heapMem, m_start, std::forward(args)...)) { } @@ -185,7 +185,7 @@ class DelegateFreeAsync : public DelegateFree(Clone()); // Create a new message instance for sending to the destination thread - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); // Dispatch message onto the callback destination thread. DelegateInvoke() // will be called by the destintation thread. @@ -210,7 +210,7 @@ class DelegateFreeAsync : public DelegateFree(args)...); } /// @brief Invoke the delegate function on the destination thread. Called by the @@ -402,7 +402,7 @@ class DelegateMemberAsync : public DelegateMember(Clone()); // Create a new message instance for sending to the destination thread - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); // Dispatch message onto the callback destination thread. DelegateInvoke() // will be called by the destintation thread. @@ -427,7 +427,7 @@ class DelegateMemberAsync : public DelegateMember(args)...); } /// @brief Invoke the delegate function on the destination thread. Called by the @@ -620,7 +620,7 @@ class DelegateMemberSpAsync : public DelegateMemberSp< auto delegate = std::shared_ptr(Clone()); // Create a new message instance for sending to the destination thread - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); // Dispatch message onto the callback destination thread. DelegateInvoke() // will be called by the destintation thread. @@ -645,7 +645,7 @@ class DelegateMemberSpAsync : public DelegateMemberSp< /// @param[in] args The function arguments, if any. /// @return None. Function invoked asynchronously without waiting for completion. void AsyncInvoke(Args... args) { - operator()(args...); + operator()(std::forward(args)...); } /// @brief Invoke the delegate function on the destination thread. Called by the @@ -821,7 +821,7 @@ class DelegateFunctionAsync : public DelegateFunction(Clone()); // Create a new message instance for sending to the destination thread - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); // Dispatch message onto the callback destination thread. DelegateInvoke() // will be called by the destintation thread. @@ -846,7 +846,7 @@ class DelegateFunctionAsync : public DelegateFunction(args)...); } /// @brief Invoke the delegate function on the destination thread. Called by the diff --git a/src/Delegate/DelegateAsyncWait.h b/src/Delegate/DelegateAsyncWait.h index 1a0b44a..1db4647 100644 --- a/src/Delegate/DelegateAsyncWait.h +++ b/src/Delegate/DelegateAsyncWait.h @@ -59,7 +59,7 @@ class DelegateAsyncWaitMsg : public DelegateMsg /// @param[in] invoker - the invoker instance /// @param[in] args - a parameter pack of all target function arguments DelegateAsyncWaitMsg(std::shared_ptr invoker, Args... args) : DelegateMsg(invoker), - m_args(args...) + m_args(std::forward(args)...) { } @@ -243,7 +243,7 @@ class DelegateFreeAsyncWait : public DelegateFreeAsync(Clone()); // Create a new message instance for sending to the destination thread. - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); msg->SetInvokerWaiting(true); // Dispatch message onto the callback destination thread. DelegateInvoke() @@ -489,7 +489,7 @@ class DelegateMemberAsyncWait : public DelegateMemberA auto delegate = std::shared_ptr(Clone()); // Create a new message instance for sending to the destination thread. - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); msg->SetInvokerWaiting(true); // Dispatch message onto the callback destination thread. DelegateInvoke() @@ -735,7 +735,7 @@ class DelegateMemberSpAsyncWait : public DelegateMembe auto delegate = std::shared_ptr(Clone()); // Create a new message instance for sending to the destination thread. - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); msg->SetInvokerWaiting(true); // Dispatch message onto the callback destination thread. DelegateInvoke() @@ -972,7 +972,7 @@ class DelegateFunctionAsyncWait : public DelegateFunctionAsync auto delegate = std::shared_ptr(Clone()); // Create a new message instance for sending to the destination thread. - auto msg = std::make_shared>(delegate, args...); + auto msg = std::make_shared>(delegate, std::forward(args)...); msg->SetInvokerWaiting(true); // Dispatch message onto the callback destination thread. DelegateInvoke()