Fix unwanted behavior with universal references (#165)

* Remove forced template

* Remove useless PushInstance overload
This commit is contained in:
S6066
2018-06-06 00:25:59 +02:00
committed by Jérôme Leclercq
parent ba32d700e2
commit f5645833df
2 changed files with 2 additions and 12 deletions

View File

@@ -706,7 +706,7 @@ namespace Nz
template<typename T>
void LuaState::PushField(const char* name, T&& arg, int tableIndex) const
{
Push<T>(std::forward<T>(arg));
Push(std::forward<T>(arg));
SetField(name, tableIndex);
}
@@ -732,7 +732,7 @@ namespace Nz
template<typename T>
void LuaState::PushGlobal(const char* name, T&& arg)
{
Push<T>(std::forward<T>(arg));
Push(std::forward<T>(arg));
SetGlobal(name);
}
@@ -742,15 +742,6 @@ namespace Nz
PushGlobal(name.GetConstBuffer(), std::forward<T>(arg));
}
template<typename T>
void LuaState::PushInstance(const char* tname, const T& instance) const
{
T* userdata = static_cast<T*>(PushUserdata(sizeof(T)));
PlacementNew(userdata, instance);
SetMetatable(tname);
}
template<typename T>
void LuaState::PushInstance(const char* tname, T&& instance) const
{