From 91065976633dca78470cd3f13698bf5bb3060ac7 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 12 May 2018 01:57:55 -0600 Subject: [PATCH] ensure constness does not infect unique usertypes fix #644 --- single/sol/sol.hpp | 8 +++++--- single/sol/sol_forward.hpp | 4 ++-- sol/stack_push.hpp | 2 +- sol/types.hpp | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index a2cab7c4..19fb277b 100644 --- a/single/sol/sol.hpp +++ b/single/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 2018-05-10 11:31:28.013615 UTC -// This header was generated with sol v2.19.5 (revision fd58e7f) +// Generated 2018-05-12 07:57:02.848130 UTC +// This header was generated with sol v2.20.0 (revision 56fa357) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -4731,6 +4731,7 @@ namespace sol { struct unique_usertype_traits> { typedef T type; typedef std::shared_ptr actual_type; + static const bool value = true; static bool is_null(const actual_type& p) { @@ -4746,6 +4747,7 @@ namespace sol { struct unique_usertype_traits> { typedef T type; typedef std::unique_ptr actual_type; + static const bool value = true; static bool is_null(const actual_type& p) { @@ -9999,7 +10001,7 @@ namespace stack { *fx = detail::usertype_unique_alloc_destroy; detail::default_construct::construct(mem, std::forward(args)...); *pref = unique_usertype_traits::get(*mem); - if (luaL_newmetatable(L, &usertype_traits>::metatable()[0]) == 1) { + if (luaL_newmetatable(L, &usertype_traits>>::metatable()[0]) == 1) { luaL_Reg l[32]{}; int index = 0; auto prop_fx = [](meta_function) { return true; }; diff --git a/single/sol/sol_forward.hpp b/single/sol/sol_forward.hpp index 87207c18..97ec3929 100644 --- a/single/sol/sol_forward.hpp +++ b/single/sol/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 2018-05-10 11:31:28.577066 UTC -// This header was generated with sol v2.19.5 (revision fd58e7f) +// Generated 2018-05-12 07:57:03.097795 UTC +// This header was generated with sol v2.20.0 (revision 56fa357) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/sol/stack_push.hpp b/sol/stack_push.hpp index e08ec99c..829da7d2 100644 --- a/sol/stack_push.hpp +++ b/sol/stack_push.hpp @@ -168,7 +168,7 @@ namespace stack { *fx = detail::usertype_unique_alloc_destroy; detail::default_construct::construct(mem, std::forward(args)...); *pref = unique_usertype_traits::get(*mem); - if (luaL_newmetatable(L, &usertype_traits>::metatable()[0]) == 1) { + if (luaL_newmetatable(L, &usertype_traits>>::metatable()[0]) == 1) { luaL_Reg l[32]{}; int index = 0; auto prop_fx = [](meta_function) { return true; }; diff --git a/sol/types.hpp b/sol/types.hpp index 053c917d..c0a08284 100644 --- a/sol/types.hpp +++ b/sol/types.hpp @@ -172,6 +172,7 @@ namespace sol { struct unique_usertype_traits> { typedef T type; typedef std::shared_ptr actual_type; + static const bool value = true; static bool is_null(const actual_type& p) { @@ -187,6 +188,7 @@ namespace sol { struct unique_usertype_traits> { typedef T type; typedef std::unique_ptr actual_type; + static const bool value = true; static bool is_null(const actual_type& p) {