diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index d7e869f9..a9806e1d 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-03-17 13:09:07.758298 UTC -// This header was generated with sol v2.19.5 (revision 947945d) +// Generated 2018-03-19 03:40:57.438213 UTC +// This header was generated with sol v2.19.5 (revision d14345f) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -927,21 +927,22 @@ namespace meta { template struct callable_traits { - typedef R Arg; + typedef std::conditional_t::value, std::add_lvalue_reference_t, R> return_type; + typedef return_type Arg; typedef T object_type; + typedef std::conditional_t::value, std::add_lvalue_reference_t, R> return_type; using signature_type = R(T::*); static const bool is_noexcept = false; static const bool is_member_function = false; static const std::size_t arity = 1; static const std::size_t free_arity = 2; typedef std::tuple args_tuple; - typedef R return_type; typedef types args_list; typedef types free_args_list; - typedef meta::tuple_types returns_list; - typedef R(function_type)(T&, R); - typedef R (*function_pointer_type)(T&, R); - typedef R (*free_function_pointer_type)(T&, R); + typedef meta::tuple_types returns_list; + typedef return_type(function_type)(T&, return_type); + typedef return_type(*function_pointer_type)(T&, Arg); + typedef return_type(*free_function_pointer_type)(T&, Arg); template using arg_at = void_tuple_element_t; }; @@ -11944,6 +11945,11 @@ namespace sol { namespace sol { + namespace detail { + template + using array_return_type = std::conditional_t::value, std::add_lvalue_reference_t, T>; + } + template struct wrapper { typedef lua_bind_traits> traits_type; @@ -12007,7 +12013,7 @@ namespace sol { typedef typename traits_type::returns_list returns_list; template - static decltype(auto) invoke(object_type& mem) { + static auto call(object_type& mem) -> detail::array_return_type { return mem.*fx; } @@ -12017,8 +12023,8 @@ namespace sol { } template - static decltype(auto) call(Fx&& fx, object_type& mem) { - return (mem.*fx); + static auto call(Fx&& fx, object_type& mem) -> detail::array_return_type { + return mem.*fx; } template diff --git a/single/sol/sol_forward.hpp b/single/sol/sol_forward.hpp index 5be85114..8efd233a 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-03-17 13:09:07.970531 UTC -// This header was generated with sol v2.19.5 (revision 947945d) +// Generated 2018-03-19 03:40:57.670830 UTC +// This header was generated with sol v2.19.5 (revision d14345f) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/sol/bind_traits.hpp b/sol/bind_traits.hpp index 5be85240..4cbc2325 100644 --- a/sol/bind_traits.hpp +++ b/sol/bind_traits.hpp @@ -507,21 +507,22 @@ namespace meta { template struct callable_traits { - typedef R Arg; + typedef std::conditional_t::value, std::add_lvalue_reference_t, R> return_type; + typedef return_type Arg; typedef T object_type; + typedef std::conditional_t::value, std::add_lvalue_reference_t, R> return_type; using signature_type = R(T::*); static const bool is_noexcept = false; static const bool is_member_function = false; static const std::size_t arity = 1; static const std::size_t free_arity = 2; typedef std::tuple args_tuple; - typedef R return_type; typedef types args_list; typedef types free_args_list; - typedef meta::tuple_types returns_list; - typedef R(function_type)(T&, R); - typedef R (*function_pointer_type)(T&, R); - typedef R (*free_function_pointer_type)(T&, R); + typedef meta::tuple_types returns_list; + typedef return_type(function_type)(T&, return_type); + typedef return_type(*function_pointer_type)(T&, Arg); + typedef return_type(*free_function_pointer_type)(T&, Arg); template using arg_at = void_tuple_element_t; }; diff --git a/sol/wrapper.hpp b/sol/wrapper.hpp index c390a60b..eabeb3c9 100644 --- a/sol/wrapper.hpp +++ b/sol/wrapper.hpp @@ -28,6 +28,11 @@ namespace sol { + namespace detail { + template + using array_return_type = std::conditional_t::value, std::add_lvalue_reference_t, T>; + } + template struct wrapper { typedef lua_bind_traits> traits_type; @@ -91,7 +96,7 @@ namespace sol { typedef typename traits_type::returns_list returns_list; template - static decltype(auto) invoke(object_type& mem) { + static auto call(object_type& mem) -> detail::array_return_type { return mem.*fx; } @@ -101,8 +106,8 @@ namespace sol { } template - static decltype(auto) call(Fx&& fx, object_type& mem) { - return (mem.*fx); + static auto call(Fx&& fx, object_type& mem) -> detail::array_return_type { + return mem.*fx; } template