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,