diff --git a/include/sol/stack_get_unqualified.hpp b/include/sol/stack_get_unqualified.hpp index 9495bcd5..2197757c 100644 --- a/include/sol/stack_get_unqualified.hpp +++ b/include/sol/stack_get_unqualified.hpp @@ -153,6 +153,10 @@ namespace sol { namespace stack { Real* mem = static_cast(memory); return *mem; } + else if constexpr(std::is_pointer_v && std::is_void_v>) { + tracking.use(1); + return lua_touserdata(L, index); + } else { return stack_detail::unchecked_unqualified_get>(L, index, tracking); } @@ -835,22 +839,6 @@ namespace sol { namespace stack { } }; - template <> - struct unqualified_getter { - static void* get(lua_State* L, int index, record& tracking) { - tracking.use(1); - return lua_touserdata(L, index); - } - }; - - template <> - struct unqualified_getter { - static const void* get(lua_State* L, int index, record& tracking) { - tracking.use(1); - return lua_touserdata(L, index); - } - }; - template struct unqualified_getter> { static T* get_no_lua_nil(lua_State* L, int index, record& tracking) { diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index 8fe61e3e..0bb1b83a 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -451,7 +451,7 @@ namespace sol { namespace u_detail { base_result = self_index_call(bases(), L, base_storage); #else optional&> maybe_base_storage = maybe_get_usertype_storage(L); - if (maybe_base_storage.has_value()) { + if (static_cast(maybe_base_storage)) { base_result = self_index_call(bases(), L, *maybe_base_storage); keep_going = base_result == base_walking_failed_index; } diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index b6525bd9..b21c5843 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-04-14 14:15:43.853979 UTC -// This header was generated with sol v3.0.1-beta2 (revision b47997f) +// Generated 2019-04-23 14:18:30.819548 UTC +// This header was generated with sol v3.0.1-beta2 (revision 47bc7f6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index 21dcf76b..e03f2425 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-04-14 14:15:43.586702 UTC -// This header was generated with sol v3.0.1-beta2 (revision b47997f) +// Generated 2019-04-23 14:18:30.519015 UTC +// This header was generated with sol v3.0.1-beta2 (revision 47bc7f6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -11590,6 +11590,10 @@ namespace sol { namespace stack { Real* mem = static_cast(memory); return *mem; } + else if constexpr(std::is_pointer_v && std::is_void_v>) { + tracking.use(1); + return lua_touserdata(L, index); + } else { return stack_detail::unchecked_unqualified_get>(L, index, tracking); } @@ -12272,22 +12276,6 @@ namespace sol { namespace stack { } }; - template <> - struct unqualified_getter { - static void* get(lua_State* L, int index, record& tracking) { - tracking.use(1); - return lua_touserdata(L, index); - } - }; - - template <> - struct unqualified_getter { - static const void* get(lua_State* L, int index, record& tracking) { - tracking.use(1); - return lua_touserdata(L, index); - } - }; - template struct unqualified_getter> { static T* get_no_lua_nil(lua_State* L, int index, record& tracking) { @@ -21021,7 +21009,7 @@ namespace sol { namespace u_detail { base_result = self_index_call(bases(), L, base_storage); #else optional&> maybe_base_storage = maybe_get_usertype_storage(L); - if (maybe_base_storage.has_value()) { + if (static_cast(maybe_base_storage)) { base_result = self_index_call(bases(), L, *maybe_base_storage); keep_going = base_result == base_walking_failed_index; }