Special casing push for types where T is base of reference

This commit is contained in:
Rapptz 2014-06-01 02:10:36 -04:00
parent 6eac584c2c
commit 675d42d281

View File

@ -188,6 +188,11 @@ struct pusher {
lua_settable(L, -3);
}
}
template<typename U = T, EnableIf<std::is_base_of<reference, U>> = 0>
static void push(lua_State*, T& ref) {
ref.push();
}
};
template<>
@ -197,13 +202,6 @@ struct pusher<bool> {
}
};
template<>
struct pusher<reference> {
static void push(lua_State*, reference& r) {
r.push();
}
};
template<>
struct pusher<nil_t> {
static void push(lua_State* L, const nil_t&) {