Fix unwanted behavior with universal references (#165)
* Remove forced template * Remove useless PushInstance overload
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user