Skip to content
Permalink
Browse files
Merge pull request #6003 from lioncash/forward
AsyncShaderCompiler: Forward arguments to the specified type's constructor in CreateWorkItem()
  • Loading branch information
degasus committed Sep 2, 2017
2 parents 1191280 + 6f97e3f commit 4bf672b
Showing 1 changed file 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 @@ class AsyncShaderCompiler
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);

0 comments on commit 4bf672b

Please sign in to comment.