Use move semantics to support NonCopyable types
This commit is contained in:
parent
b702bd00f4
commit
3592ba18a0
|
@ -44,7 +44,7 @@ namespace lol
|
||||||
* @return A shared pointer to the newly constructed object
|
* @return A shared pointer to the newly constructed object
|
||||||
*/
|
*/
|
||||||
template<typename T, typename... Args>
|
template<typename T, typename... Args>
|
||||||
std::shared_ptr<T> Create(unsigned int id, Args... args)
|
std::shared_ptr<T> Create(unsigned int id, Args&&... args)
|
||||||
{
|
{
|
||||||
std::shared_ptr<T> object = std::make_shared<T>(args...);
|
std::shared_ptr<T> object = std::make_shared<T>(args...);
|
||||||
objects.insert({id, object});
|
objects.insert({id, object});
|
||||||
|
|
Loading…
Reference in a new issue