Skip to content

Commit

Permalink
method binding change to derive variant type traits after using nocvr…
Browse files Browse the repository at this point in the history
…ef native godot types
  • Loading branch information
vorlac committed Oct 12, 2023
1 parent 6b3dc8f commit ebef1e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/function_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace rl::inline utils
using return_type = TRet;
using class_type = TClass;
using arg_types = std::tuple<TArgs...>;
using arg_types_nocvref = std::tuple<std::remove_cvref_t<TArgs>...>;
inline static const std::string_view class_name{ typeid(class_type).name() };
static constexpr size_t arg_count = sizeof...(TArgs);
};
Expand Down
2 changes: 1 addition & 1 deletion src/util/bind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ebef1e9

Please sign in to comment.