mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00: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:
parent
1191280e76
commit
62615c601e
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue