From 675d42d28137d9b598a9a1c1d2b0962ef7163165 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 1 Jun 2014 02:10:36 -0400 Subject: [PATCH] Special casing push for types where T is base of reference --- sol/stack.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sol/stack.hpp b/sol/stack.hpp index 4ecc0ede..e6dbfdde 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -188,6 +188,11 @@ struct pusher { lua_settable(L, -3); } } + + template> = 0> + static void push(lua_State*, T& ref) { + ref.push(); + } }; template<> @@ -197,13 +202,6 @@ struct pusher { } }; -template<> -struct pusher { - static void push(lua_State*, reference& r) { - r.push(); - } -}; - template<> struct pusher { static void push(lua_State* L, const nil_t&) {