From ebef1e95267e7f1bc37dbe88f8b86ec4ebddae91 Mon Sep 17 00:00:00 2001 From: sal Date: Thu, 12 Oct 2023 02:28:28 -0400 Subject: [PATCH] method binding change to derive variant type traits after using nocvref native godot types --- src/core/function_traits.hpp | 1 + src/util/bind.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/function_traits.hpp b/src/core/function_traits.hpp index 6d54cdc..7229602 100644 --- a/src/core/function_traits.hpp +++ b/src/core/function_traits.hpp @@ -74,6 +74,7 @@ namespace rl::inline utils using return_type = TRet; using class_type = TClass; using arg_types = std::tuple; + using arg_types_nocvref = std::tuple...>; inline static const std::string_view class_name{ typeid(class_type).name() }; static constexpr size_t arg_count = sizeof...(TArgs); }; diff --git a/src/util/bind.hpp b/src/util/bind.hpp index a2bdb69..de6182d 100644 --- a/src/util/bind.hpp +++ b/src/util/bind.hpp @@ -44,7 +44,7 @@ namespace rl::inline utils godot::ClassDB::bind_method(godot::D_METHOD(func_name.data()), Method); else { - const typename traits_t::arg_types func_args{}; + std::tuple func_args = traits_t::arg_types_nocvref(); std::apply( [&](auto&&... args) { godot::ClassDB::bind_method(godot::D_METHOD(func_name.data()), Method,