Revert "Allow push to work with types that inherit from reference"

This reverts commit f2d72f7bb2.
This commit is contained in:
Rapptz 2013-11-26 01:21:53 -05:00
parent c3ca4d9610
commit ecb44462af

View File

@ -84,18 +84,6 @@ inline void push_arithmetic(lua_State* L, T x, std::false_type) {
// T is an floating point type // T is an floating point type
lua_pushnumber(L, x); lua_pushnumber(L, x);
} }
template<typename T>
inline void push_helper(lua_State* L, T& x, std::true_type) {
// T is a reference type
x.push();
}
template<typename T>
inline void push_helper(lua_State* L, T& x, std::false_type) {
// T is a reference type
push_arithmetic<T>(L, x, std::is_integral<T>{});
}
} // detail } // detail
template<typename T> template<typename T>
@ -128,8 +116,8 @@ inline const char* pop<const char*>(lua_State* L) {
} }
template<typename T> template<typename T>
inline void push(lua_State* L, T& t) { inline void push(lua_State* L, T arithmetic) {
detail::push_helper(L, t, std::is_base_of<reference, T>{}); detail::push_arithmetic(L, arithmetic, std::is_integral<T>{});
} }
inline void push(lua_State* L, bool boolean) { inline void push(lua_State* L, bool boolean) {