mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Special casing push for types where T is base of reference
This commit is contained in:
parent
6eac584c2c
commit
675d42d281
|
@ -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&) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user