mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 12:35:27 +00:00
Merge pull request #6003 from lioncash/forward
AsyncShaderCompiler: Forward arguments to the specified type's constructor in CreateWorkItem()
This commit is contained in:
commit
4bf672bb27
@ -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::make_unique<T>(std::forward<Params>(params)...);
|
||||
}
|
||||
|
||||
void QueueWorkItem(WorkItemPtr item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user