mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Revert "Allow push to work with types that inherit from reference"
This reverts commit f2d72f7bb2
.
This commit is contained in:
parent
c3ca4d9610
commit
ecb44462af
|
@ -84,18 +84,6 @@ inline void push_arithmetic(lua_State* L, T x, std::false_type) {
|
|||
// T is an floating point type
|
||||
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
|
||||
|
||||
template<typename T>
|
||||
|
@ -128,8 +116,8 @@ inline const char* pop<const char*>(lua_State* L) {
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
inline void push(lua_State* L, T& t) {
|
||||
detail::push_helper(L, t, std::is_base_of<reference, T>{});
|
||||
inline void push(lua_State* L, T arithmetic) {
|
||||
detail::push_arithmetic(L, arithmetic, std::is_integral<T>{});
|
||||
}
|
||||
|
||||
inline void push(lua_State* L, bool boolean) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user