mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
AsyncShaderCompiler: Forward arguments to the specified type's constructor in CreateWorkItem()
As this just hands off the arguments to another type's constructor, perfect forwarding should be used here to preserve any potential move semantics.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -36,9 +37,9 @@ public:
|
||||
virtual ~AsyncShaderCompiler();
|
||||
|
||||
template <typename T, typename... Params>
|
||||
static WorkItemPtr CreateWorkItem(Params... params)
|
||||
static WorkItemPtr CreateWorkItem(Params&&... params)
|
||||
{
|
||||
return std::unique_ptr<WorkItem>(new T(params...));
|
||||
return std::unique_ptr<WorkItem>(new T(std::forward<Params>(params)...));
|
||||
}
|
||||
|
||||
void QueueWorkItem(WorkItemPtr item);
|
||||
|
Reference in New Issue
Block a user