Skip to content

Commit 04535cc

Browse files
author
Vano
committed
Merge branch 'next'
2 parents 46fdf5d + fe8eb73 commit 04535cc

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

src/cppscript_bindings.h

+19-22
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,34 @@ struct is_supported_type {
2525
// MSVC needs this for no reason
2626
template<class T>
2727
struct is_supported_type<godot::BitField<T>> {
28-
static constexpr bool value = is_defined<godot::GetTypeInfo<int64_t>>::value;
28+
static constexpr bool value = true;
2929
};
30-
//
31-
32-
template<class T>
33-
static constexpr bool is_supported_type_v = is_supported_type<T>::value;
3430

35-
// And this
3631
template<>
37-
static constexpr bool is_supported_type_v<godot::Variant**> = true;
32+
struct is_supported_type<godot::Variant**> {
33+
static constexpr bool value = true;
34+
};
3835

3936
template<>
40-
static constexpr bool is_supported_type_v<const godot::Variant**> = true;
37+
struct is_supported_type<const godot::Variant**> {
38+
static constexpr bool value = true;
39+
};
4140

4241
template<>
43-
static constexpr bool is_supported_type_v<GDExtensionCallError&> = true;
42+
struct is_supported_type<GDExtensionCallError&> {
43+
static constexpr bool value = true;
44+
};
4445
//
4546

4647
template<class T>
4748
struct assert_is_supported_type {
48-
static constexpr bool value = is_supported_type_v<T>;
49-
static_assert(is_supported_type_v<T>, "Type not supported. If it's your custom class, either it had complilation errors, or maybe you forgot to register it with GCLASS()");
49+
static constexpr bool value = is_supported_type<T>::value;
50+
static_assert(is_supported_type<T>::value, "Type not supported. If it's your custom class, either it had complilation errors, or maybe you forgot to register it with GCLASS()");
5051
};
5152

52-
template<class T>
53-
static constexpr bool assert_is_supported_type_v = assert_is_supported_type<T>::value;
54-
55-
5653
template<class T>
5754
struct assert_is_ret_supported {
58-
static constexpr bool value = assert_is_supported_type_v<T>;
55+
static constexpr bool value = assert_is_supported_type<T>::value;
5956
};
6057
template<>
6158
struct assert_is_ret_supported<void> {
@@ -67,20 +64,20 @@ struct MemberSignature;
6764

6865
template <typename Class, typename Ret, typename... Args>
6966
struct MemberSignature<Ret (Class::*)(Args...) const> {
70-
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type_v<Args> && ...);
67+
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type<Args>::value && ...);
7168
};
7269

7370
template <typename Class, typename Ret, typename... Args>
7471
struct MemberSignature<Ret (Class::*)(Args...)> {
75-
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type_v<Args> && ...);
72+
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type<Args>::value && ...);
7673
};
7774

7875
template <typename Ret, typename... Args>
7976
struct FunctionSignature;
8077

8178
template <typename Ret, typename... Args>
8279
struct FunctionSignature<Ret (*)(Args...)> {
83-
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type_v<Args> && ...);
80+
static constexpr bool value = assert_is_ret_supported<Ret>::value && (assert_is_supported_type<Args>::value && ...);
8481
};
8582

8683

@@ -172,13 +169,13 @@ _FORCE_INLINE_ void destroy_object(T& obj) {
172169

173170
template<class T, class ...Args>
174171
_FORCE_INLINE_ godot::PropertyInfo MakePropertyInfo(Args&&... args) {
175-
static_assert(impl::assert_is_supported_type_v<T>, "Property of this type is not supported");
172+
static_assert(impl::assert_is_supported_type<T>::value, "Property of this type is not supported");
176173

177174
using IsResource = impl::IsResourceProperty<T>;
178175
if constexpr(sizeof...(Args) == 1 && IsResource::value) {
179-
return impl::BindCheck<impl::assert_is_supported_type_v<T>>::template MakePropertyInfo<T>(std::forward<Args>(args)..., godot::PROPERTY_HINT_RESOURCE_TYPE, IsResource::type::get_class_static());
176+
return impl::BindCheck<impl::assert_is_supported_type<T>::value>::template MakePropertyInfo<T>(std::forward<Args>(args)..., godot::PROPERTY_HINT_RESOURCE_TYPE, IsResource::type::get_class_static());
180177
} else {
181-
return impl::BindCheck<impl::assert_is_supported_type_v<T>>::template MakePropertyInfo<T>(std::forward<Args>(args)...);
178+
return impl::BindCheck<impl::assert_is_supported_type<T>::value>::template MakePropertyInfo<T>(std::forward<Args>(args)...);
182179
}
183180
}
184181

0 commit comments

Comments
 (0)