diff --git a/core/io/dir_access.h b/core/io/dir_access.h index d175235b988..e9c864c56bd 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -70,7 +70,7 @@ protected: AccessType get_access_type() const; virtual String fix_path(const String &p_path) const; - template + template static Ref _create_builtin() { return memnew(T); } @@ -130,7 +130,7 @@ public: static Ref create(AccessType p_access); static Error get_open_error(); - template + template static void make_default(AccessType p_access) { create_func[p_access] = _create_builtin; } diff --git a/core/io/file_access.h b/core/io/file_access.h index 7d346ca2f4f..122ae3b1903 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -114,7 +114,7 @@ private: AccessType _access_type = ACCESS_FILESYSTEM; static CreateFunc create_func[ACCESS_MAX]; /** default file access creation function for a platform */ - template + template static Ref _create_builtin() { return memnew(T); } @@ -226,7 +226,7 @@ public: static PackedByteArray _get_file_as_bytes(const String &p_path) { return get_file_as_bytes(p_path, &last_file_open_error); } static String _get_file_as_string(const String &p_path) { return get_file_as_string(p_path, &last_file_open_error); } - template + template static void make_default(AccessType p_access) { create_func[p_access] = _create_builtin; } diff --git a/core/io/image.cpp b/core/io/image.cpp index b094290ac8a..c454f06d670 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -679,7 +679,7 @@ static double _bicubic_interp_kernel(double x) { return bc; } -template +template static void _scale_cubic(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) { // get source image size int width = p_src_width; @@ -766,7 +766,7 @@ static void _scale_cubic(const uint8_t *__restrict p_src, uint8_t *__restrict p_ } } -template +template static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) { enum { FRAC_BITS = 8, @@ -856,7 +856,7 @@ static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict } } -template +template static void _scale_nearest(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) { for (uint32_t i = 0; i < p_dst_height; i++) { uint32_t src_yofs = i * p_src_height / p_dst_height; @@ -883,7 +883,7 @@ static float _lanczos(float p_x) { return Math::abs(p_x) >= LANCZOS_TYPE ? 0 : Math::sincn(p_x) * Math::sincn(p_x / LANCZOS_TYPE); } -template +template static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) { int32_t src_width = p_src_width; int32_t src_height = p_src_height; @@ -1665,7 +1665,7 @@ bool Image::_can_modify(Format p_format) const { return p_format <= FORMAT_RGBE9995; } -template static void _generate_po2_mipmap(const Component *p_src, Component *p_dst, uint32_t p_width, uint32_t p_height) { diff --git a/core/math/bvh.h b/core/math/bvh.h index 8fbbd8e7fdf..4815466e896 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -57,7 +57,7 @@ #define BVHTREE_CLASS BVH_Tree #define BVH_LOCKED_FUNCTION BVHLockedFunction _lock_guard(&_mutex, BVH_THREAD_SAFE &&_thread_safe); -template , class USER_CULL_TEST_FUNCTION = BVH_DummyCullTestFunction, class BOUNDS = AABB, class POINT = Vector3, bool BVH_THREAD_SAFE = true> +template , typename USER_CULL_TEST_FUNCTION = BVH_DummyCullTestFunction, typename BOUNDS = AABB, typename POINT = Vector3, bool BVH_THREAD_SAFE = true> class BVH_Manager { public: // note we are using uint32_t instead of BVHHandle, losing type safety, but this diff --git a/core/math/bvh_abb.h b/core/math/bvh_abb.h index fb0207e0bd7..cec3dc90dbe 100644 --- a/core/math/bvh_abb.h +++ b/core/math/bvh_abb.h @@ -32,7 +32,7 @@ #define BVH_ABB_H // special optimized version of axis aligned bounding box -template +template struct BVH_ABB { struct ConvexHull { // convex hulls (optional) diff --git a/core/math/bvh_tree.h b/core/math/bvh_tree.h index ce296668dba..0faa50555fb 100644 --- a/core/math/bvh_tree.h +++ b/core/math/bvh_tree.h @@ -106,7 +106,7 @@ struct BVHHandle { }; // helper class to make iterative versions of recursive functions -template +template class BVH_IterativeInfo { public: enum { @@ -152,7 +152,7 @@ public: } }; -template +template class BVH_DummyPairTestFunction { public: static bool user_collision_check(T *p_a, T *p_b) { @@ -161,7 +161,7 @@ public: } }; -template +template class BVH_DummyCullTestFunction { public: static bool user_cull_check(T *p_a, T *p_b) { @@ -170,7 +170,7 @@ public: } }; -template , class USER_CULL_TEST_FUNCTION = BVH_DummyCullTestFunction, bool USE_PAIRS = false, class BOUNDS = AABB, class POINT = Vector3> +template , typename USER_CULL_TEST_FUNCTION = BVH_DummyCullTestFunction, bool USE_PAIRS = false, typename BOUNDS = AABB, typename POINT = Vector3> class BVH_Tree { friend class BVH; diff --git a/core/math/disjoint_set.h b/core/math/disjoint_set.h index 2ece991fea5..4348da992d2 100644 --- a/core/math/disjoint_set.h +++ b/core/math/disjoint_set.h @@ -35,7 +35,7 @@ #include "core/templates/vector.h" /* This DisjointSet class uses Find with path compression and Union by rank */ -template , class AL = DefaultAllocator> +template , typename AL = DefaultAllocator> class DisjointSet { struct Element { T object; @@ -65,14 +65,14 @@ public: /* FUNCTIONS */ -template +template DisjointSet::~DisjointSet() { for (KeyValue &E : elements) { memdelete_allocator(E.value); } } -template +template typename DisjointSet::Element *DisjointSet::get_parent(Element *element) { if (element->parent != element) { element->parent = get_parent(element->parent); @@ -81,7 +81,7 @@ typename DisjointSet::Element *DisjointSet::get_parent return element->parent; } -template +template typename DisjointSet::Element *DisjointSet::insert_or_get(T object) { typename MapT::Iterator itr = elements.find(object); if (itr != nullptr) { @@ -96,7 +96,7 @@ typename DisjointSet::Element *DisjointSet::insert_or_ return new_element; } -template +template void DisjointSet::create_union(T a, T b) { Element *x = insert_or_get(a); Element *y = insert_or_get(b); @@ -121,7 +121,7 @@ void DisjointSet::create_union(T a, T b) { } } -template +template void DisjointSet::get_representatives(Vector &out_representatives) { for (KeyValue &E : elements) { Element *element = E.value; @@ -131,7 +131,7 @@ void DisjointSet::get_representatives(Vector &out_representative } } -template +template void DisjointSet::get_members(Vector &out_members, T representative) { typename MapT::Iterator rep_itr = elements.find(representative); ERR_FAIL_NULL(rep_itr); diff --git a/core/math/dynamic_bvh.h b/core/math/dynamic_bvh.h index 9b49fcc3c80..f586b845c38 100644 --- a/core/math/dynamic_bvh.h +++ b/core/math/dynamic_bvh.h @@ -305,11 +305,11 @@ public: virtual ~DefaultQueryResult() {} }; - template + template _FORCE_INLINE_ void aabb_query(const AABB &p_aabb, QueryResult &r_result); - template + template _FORCE_INLINE_ void convex_query(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count, QueryResult &r_result); - template + template _FORCE_INLINE_ void ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResult &r_result); void set_index(uint32_t p_index); @@ -318,7 +318,7 @@ public: ~DynamicBVH(); }; -template +template void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) { if (!bvh_root) { return; @@ -363,7 +363,7 @@ void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) { } while (depth > 0); } -template +template void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count, QueryResult &r_result) { if (!bvh_root) { return; @@ -420,7 +420,7 @@ void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Ve } } while (depth > 0); } -template +template void DynamicBVH::ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResult &r_result) { if (!bvh_root) { return; diff --git a/core/math/expression.h b/core/math/expression.h index c6ad1bd6347..46bc3618df0 100644 --- a/core/math/expression.h +++ b/core/math/expression.h @@ -243,7 +243,7 @@ private: } }; - template + template T *alloc_node() { T *node = memnew(T); node->next = nodes; diff --git a/core/math/projection.h b/core/math/projection.h index a7adc9017ed..b98f6363447 100644 --- a/core/math/projection.h +++ b/core/math/projection.h @@ -34,7 +34,7 @@ #include "core/math/vector3.h" #include "core/math/vector4.h" -template +template class Vector; struct AABB; diff --git a/core/math/random_pcg.h b/core/math/random_pcg.h index fd0934b24ab..6bad70059f7 100644 --- a/core/math/random_pcg.h +++ b/core/math/random_pcg.h @@ -59,7 +59,7 @@ static int __bsr_clz32(uint32_t x) { #define LDEXPF(s, e) ldexp(s, e) #endif -template +template class Vector; class RandomPCG { diff --git a/core/object/callable_method_pointer.h b/core/object/callable_method_pointer.h index f8e8c4d7e90..7fc33b92bd7 100644 --- a/core/object/callable_method_pointer.h +++ b/core/object/callable_method_pointer.h @@ -77,7 +77,7 @@ public: virtual uint32_t hash() const; }; -template +template class CallableCustomMethodPointer : public CallableCustomMethodPointerBase { struct Data { T *instance; @@ -107,7 +107,7 @@ public: } }; -template +template Callable create_custom_callable_function_pointer(T *p_instance, #ifdef DEBUG_METHODS_ENABLED const char *p_func_text, @@ -123,7 +123,7 @@ Callable create_custom_callable_function_pointer(T *p_instance, // VERSION WITH RETURN -template +template class CallableCustomMethodPointerRet : public CallableCustomMethodPointerBase { struct Data { T *instance; @@ -154,7 +154,7 @@ public: } }; -template +template Callable create_custom_callable_function_pointer(T *p_instance, #ifdef DEBUG_METHODS_ENABLED const char *p_func_text, @@ -170,7 +170,7 @@ Callable create_custom_callable_function_pointer(T *p_instance, // CONST VERSION WITH RETURN -template +template class CallableCustomMethodPointerRetC : public CallableCustomMethodPointerBase { struct Data { T *instance; @@ -201,7 +201,7 @@ public: } }; -template +template Callable create_custom_callable_function_pointer(T *p_instance, #ifdef DEBUG_METHODS_ENABLED const char *p_func_text, @@ -223,7 +223,7 @@ Callable create_custom_callable_function_pointer(T *p_instance, // STATIC VERSIONS -template +template class CallableCustomStaticMethodPointer : public CallableCustomMethodPointerBase { struct Data { void (*method)(P...); @@ -250,7 +250,7 @@ public: } }; -template +template Callable create_custom_callable_static_function_pointer( #ifdef DEBUG_METHODS_ENABLED const char *p_func_text, @@ -264,7 +264,7 @@ Callable create_custom_callable_static_function_pointer( return Callable(ccmp); } -template +template class CallableCustomStaticMethodPointerRet : public CallableCustomMethodPointerBase { struct Data { R(*method) @@ -291,7 +291,7 @@ public: } }; -template +template Callable create_custom_callable_static_function_pointer( #ifdef DEBUG_METHODS_ENABLED const char *p_func_text, diff --git a/core/object/class_db.h b/core/object/class_db.h index 7f117b4a9bb..1fb570427b3 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -140,7 +140,7 @@ public: ~ClassInfo() {} }; - template + template static Object *creator() { return memnew(T); } @@ -187,12 +187,12 @@ private: public: // DO NOT USE THIS!!!!!! NEEDS TO BE PUBLIC BUT DO NOT USE NO MATTER WHAT!!! - template + template static void _add_class() { _add_class2(T::get_class_static(), T::get_parent_class_static()); } - template + template static void register_class(bool p_virtual = false) { GLOBAL_LOCK_FUNCTION; static_assert(types_are_same_v, "Class not declared properly, please use GDCLASS."); @@ -207,7 +207,7 @@ public: T::register_custom_data_to_otdb(); } - template + template static void register_abstract_class() { GLOBAL_LOCK_FUNCTION; static_assert(types_are_same_v, "Class not declared properly, please use GDCLASS."); @@ -220,7 +220,7 @@ public: //nothing } - template + template static void register_internal_class() { GLOBAL_LOCK_FUNCTION; static_assert(types_are_same_v, "Class not declared properly, please use GDCLASS."); @@ -235,7 +235,7 @@ public: T::register_custom_data_to_otdb(); } - template + template static void register_runtime_class() { GLOBAL_LOCK_FUNCTION; static_assert(types_are_same_v, "Class not declared properly, please use GDCLASS."); @@ -255,12 +255,12 @@ public: static void register_extension_class(ObjectGDExtension *p_extension); static void unregister_extension_class(const StringName &p_class, bool p_free_method_binds = true); - template + template static Object *_create_ptr_func() { return T::create(); } - template + template static void register_custom_instance_class() { GLOBAL_LOCK_FUNCTION; static_assert(types_are_same_v, "Class not declared properly, please use GDCLASS."); @@ -314,7 +314,7 @@ public: using return_type = R; }; - template + template static MethodBind *bind_method(N p_method_name, M p_method, VarArgs... p_args) { Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported. const Variant *argptrs[sizeof...(p_args) + 1]; @@ -328,7 +328,7 @@ public: return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); } - template + template static MethodBind *bind_static_method(const StringName &p_class, N p_method_name, M p_method, VarArgs... p_args) { Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported. const Variant *argptrs[sizeof...(p_args) + 1]; @@ -343,7 +343,7 @@ public: return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); } - template + template static MethodBind *bind_compatibility_method(N p_method_name, M p_method, VarArgs... p_args) { Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported. const Variant *argptrs[sizeof...(p_args) + 1]; @@ -357,7 +357,7 @@ public: return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); } - template + template static MethodBind *bind_compatibility_static_method(const StringName &p_class, N p_method_name, M p_method, VarArgs... p_args) { Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported. const Variant *argptrs[sizeof...(p_args) + 1]; @@ -372,7 +372,7 @@ public: return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); } - template + template static MethodBind *bind_vararg_method(uint32_t p_flags, const StringName &p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector &p_default_args = Vector(), bool p_return_nil_is_variant = true) { GLOBAL_LOCK_FUNCTION; @@ -385,7 +385,7 @@ public: return _bind_vararg_method(bind, p_name, p_default_args, false); } - template + template static MethodBind *bind_compatibility_vararg_method(uint32_t p_flags, const StringName &p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector &p_default_args = Vector(), bool p_return_nil_is_variant = true) { GLOBAL_LOCK_FUNCTION; @@ -497,13 +497,13 @@ _FORCE_INLINE_ void errarray_add_str(Vector &arr, const Error &p_err) { arr.push_back(p_err); } -template +template _FORCE_INLINE_ void errarray_add_str(Vector &arr, const Error &p_err, P... p_args) { arr.push_back(p_err); errarray_add_str(arr, p_args...); } -template +template _FORCE_INLINE_ Vector errarray(P... p_args) { Vector arr; errarray_add_str(arr, p_args...); diff --git a/core/object/method_bind.h b/core/object/method_bind.h index 88b867a1ca3..e97f4abc6a2 100644 --- a/core/object/method_bind.h +++ b/core/object/method_bind.h @@ -140,7 +140,7 @@ public: }; // MethodBindVarArg base CRTP -template +template class MethodBindVarArgBase : public MethodBind { protected: R(T::*method) @@ -219,7 +219,7 @@ private: }; // variadic, no return -template +template class MethodBindVarArgT : public MethodBindVarArgBase, T, void, false> { friend class MethodBindVarArgBase, T, void, false>; @@ -245,7 +245,7 @@ private: } }; -template +template MethodBind *create_vararg_method_bind(void (T::*p_method)(const Variant **, int, Callable::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { MethodBind *a = memnew((MethodBindVarArgT)(p_method, p_info, p_return_nil_is_variant)); a->set_instance_class(T::get_class_static()); @@ -253,7 +253,7 @@ MethodBind *create_vararg_method_bind(void (T::*p_method)(const Variant **, int, } // variadic, return -template +template class MethodBindVarArgTR : public MethodBindVarArgBase, T, R, true> { friend class MethodBindVarArgBase, T, R, true>; @@ -287,7 +287,7 @@ private: } }; -template +template MethodBind *create_vararg_method_bind(R (T::*p_method)(const Variant **, int, Callable::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { MethodBind *a = memnew((MethodBindVarArgTR)(p_method, p_info, p_return_nil_is_variant)); a->set_instance_class(T::get_class_static()); @@ -305,9 +305,9 @@ class __UnexistingClass; // no return, not const #ifdef TYPED_METHOD_BIND -template +template #else -template +template #endif class MethodBindT : public MethodBind { void (MB_T::*method)(P...); @@ -375,7 +375,7 @@ public: } }; -template +template MethodBind *create_method_bind(void (T::*p_method)(P...)) { #ifdef TYPED_METHOD_BIND MethodBind *a = memnew((MethodBindT)(p_method)); @@ -389,9 +389,9 @@ MethodBind *create_method_bind(void (T::*p_method)(P...)) { // no return, const #ifdef TYPED_METHOD_BIND -template +template #else -template +template #endif class MethodBindTC : public MethodBind { void (MB_T::*method)(P...) const; @@ -460,7 +460,7 @@ public: } }; -template +template MethodBind *create_method_bind(void (T::*p_method)(P...) const) { #ifdef TYPED_METHOD_BIND MethodBind *a = memnew((MethodBindTC)(p_method)); @@ -474,9 +474,9 @@ MethodBind *create_method_bind(void (T::*p_method)(P...) const) { // return, not const #ifdef TYPED_METHOD_BIND -template +template #else -template +template #endif class MethodBindTR : public MethodBind { R(MB_T::*method) @@ -555,7 +555,7 @@ public: } }; -template +template MethodBind *create_method_bind(R (T::*p_method)(P...)) { #ifdef TYPED_METHOD_BIND MethodBind *a = memnew((MethodBindTR)(p_method)); @@ -570,9 +570,9 @@ MethodBind *create_method_bind(R (T::*p_method)(P...)) { // return, const #ifdef TYPED_METHOD_BIND -template +template #else -template +template #endif class MethodBindTRC : public MethodBind { R(MB_T::*method) @@ -652,7 +652,7 @@ public: } }; -template +template MethodBind *create_method_bind(R (T::*p_method)(P...) const) { #ifdef TYPED_METHOD_BIND MethodBind *a = memnew((MethodBindTRC)(p_method)); @@ -667,7 +667,7 @@ MethodBind *create_method_bind(R (T::*p_method)(P...) const) { // no return -template +template class MethodBindTS : public MethodBind { void (*function)(P...); @@ -717,7 +717,7 @@ public: } }; -template +template MethodBind *create_static_method_bind(void (*p_method)(P...)) { MethodBind *a = memnew((MethodBindTS)(p_method)); return a; @@ -725,7 +725,7 @@ MethodBind *create_static_method_bind(void (*p_method)(P...)) { // return -template +template class MethodBindTRS : public MethodBind { R(*function) (P...); @@ -784,7 +784,7 @@ public: } }; -template +template MethodBind *create_static_method_bind(R (*p_method)(P...)) { MethodBind *a = memnew((MethodBindTRS)(p_method)); return a; diff --git a/core/object/object.h b/core/object/object.h index cb1495296dd..526c45b3480 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -796,12 +796,12 @@ public: void detach_from_objectdb(); _FORCE_INLINE_ ObjectID get_instance_id() const { return _instance_id; } - template + template static T *cast_to(Object *p_object) { return p_object ? dynamic_cast(p_object) : nullptr; } - template + template static const T *cast_to(const Object *p_object) { return p_object ? dynamic_cast(p_object) : nullptr; } diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h index 10be27b8795..5b358135c44 100644 --- a/core/object/ref_counted.h +++ b/core/object/ref_counted.h @@ -53,7 +53,7 @@ public: ~RefCounted() {} }; -template +template class Ref { T *reference = nullptr; @@ -117,7 +117,7 @@ public: ref(p_from); } - template + template void operator=(const Ref &p_from) { RefCounted *refb = const_cast(static_cast(p_from.ptr())); if (!refb) { @@ -149,7 +149,7 @@ public: } } - template + template void reference_ptr(T_Other *p_ptr) { if (reference == p_ptr) { return; @@ -166,7 +166,7 @@ public: ref(p_from); } - template + template Ref(const Ref &p_from) { RefCounted *refb = const_cast(static_cast(p_from.ptr())); if (!refb) { @@ -240,7 +240,7 @@ public: WeakRef() {} }; -template +template struct PtrToArg> { _FORCE_INLINE_ static Ref convert(const void *p_ptr) { if (p_ptr == nullptr) { @@ -258,7 +258,7 @@ struct PtrToArg> { } }; -template +template struct PtrToArg &> { typedef Ref EncodeT; @@ -271,7 +271,7 @@ struct PtrToArg &> { } }; -template +template struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; @@ -281,7 +281,7 @@ struct GetTypeInfo> { } }; -template +template struct GetTypeInfo &> { static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; @@ -291,13 +291,13 @@ struct GetTypeInfo &> { } }; -template +template struct VariantInternalAccessor> { static _FORCE_INLINE_ Ref get(const Variant *v) { return Ref(*VariantInternal::get_object(v)); } static _FORCE_INLINE_ void set(Variant *v, const Ref &p_ref) { VariantInternal::refcounted_object_assign(v, p_ref.ptr()); } }; -template +template struct VariantInternalAccessor &> { static _FORCE_INLINE_ Ref get(const Variant *v) { return Ref(*VariantInternal::get_object(v)); } static _FORCE_INLINE_ void set(Variant *v, const Ref &p_ref) { VariantInternal::refcounted_object_assign(v, p_ref.ptr()); } diff --git a/core/object/worker_thread_pool.h b/core/object/worker_thread_pool.h index c9921c808da..fdddc9a647f 100644 --- a/core/object/worker_thread_pool.h +++ b/core/object/worker_thread_pool.h @@ -157,7 +157,7 @@ private: TaskID _add_task(const Callable &p_callable, void (*p_func)(void *), void *p_userdata, BaseTemplateUserdata *p_template_userdata, bool p_high_priority, const String &p_description); GroupID _add_group_task(const Callable &p_callable, void (*p_func)(void *, uint32_t), void *p_userdata, BaseTemplateUserdata *p_template_userdata, int p_elements, int p_tasks, bool p_high_priority, const String &p_description); - template + template struct TaskUserData : public BaseTemplateUserdata { C *instance; M method; @@ -167,7 +167,7 @@ private: } }; - template + template struct GroupUserData : public BaseTemplateUserdata { C *instance; M method; @@ -181,7 +181,7 @@ protected: static void _bind_methods(); public: - template + template TaskID add_template_task(C *p_instance, M p_method, U p_userdata, bool p_high_priority = false, const String &p_description = String()) { typedef TaskUserData TUD; TUD *ud = memnew(TUD); @@ -196,7 +196,7 @@ public: bool is_task_completed(TaskID p_task_id) const; Error wait_for_task_completion(TaskID p_task_id); - template + template GroupID add_template_group_task(C *p_instance, M p_method, U p_userdata, int p_elements, int p_tasks = -1, bool p_high_priority = false, const String &p_description = String()) { typedef GroupUserData GroupUD; GroupUD *ud = memnew(GroupUD); diff --git a/core/os/condition_variable.h b/core/os/condition_variable.h index 2b6b272e18d..fa1355e98c7 100644 --- a/core/os/condition_variable.h +++ b/core/os/condition_variable.h @@ -54,7 +54,7 @@ class ConditionVariable { mutable THREADING_NAMESPACE::condition_variable condition; public: - template + template _ALWAYS_INLINE_ void wait(const MutexLock &p_lock) const { condition.wait(const_cast &>(p_lock.lock)); } @@ -72,7 +72,7 @@ public: class ConditionVariable { public: - template + template void wait(const MutexLock &p_lock) const {} void notify_one() const {} void notify_all() const {} diff --git a/core/os/memory.h b/core/os/memory.h index 6f3f6fed399..d03e08d7858 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -92,7 +92,7 @@ void operator delete(void *p_mem, void *p_pointer, size_t check, const char *p_d _ALWAYS_INLINE_ void postinitialize_handler(void *) {} -template +template _ALWAYS_INLINE_ T *_post_initialize(T *p_obj) { postinitialize_handler(p_obj); return p_obj; @@ -107,7 +107,7 @@ _ALWAYS_INLINE_ bool predelete_handler(void *) { return true; } -template +template void memdelete(T *p_class) { if (!predelete_handler(p_class)) { return; // doesn't want to be deleted @@ -119,7 +119,7 @@ void memdelete(T *p_class) { Memory::free_static(p_class, false); } -template +template void memdelete_allocator(T *p_class) { if (!predelete_handler(p_class)) { return; // doesn't want to be deleted @@ -213,10 +213,10 @@ struct _GlobalNilClass { static _GlobalNil _nil; }; -template +template class DefaultTypedAllocator { public: - template + template _FORCE_INLINE_ T *new_allocation(const Args &&...p_args) { return memnew(T(p_args...)); } _FORCE_INLINE_ void delete_allocation(T *p_allocation) { memdelete(p_allocation); } }; diff --git a/core/os/mutex.h b/core/os/mutex.h index a4eab0cd860..3e7aa81bc1a 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -45,10 +45,10 @@ #ifdef THREADS_ENABLED -template +template class MutexLock; -template +template class MutexImpl { friend class MutexLock>; @@ -70,7 +70,7 @@ public: } }; -template +template class MutexLock { friend class ConditionVariable; @@ -100,7 +100,7 @@ public: bool try_lock() const { return true; } }; -template +template class MutexLock { public: MutexLock(const MutexT &p_mutex) {} diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 1d279330160..a7e12138f2f 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -2459,7 +2459,7 @@ bool String::is_numeric() const { return true; // TODO: Use the parser below for this instead } -template +template static double built_in_strtod( /* A decimal ASCII floating-point number, * optionally preceded by white space. Must diff --git a/core/string/ustring.h b/core/string/ustring.h index 468a0153029..0fb72fccd2a 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -43,7 +43,7 @@ /* CharProxy */ /*************************************************************************/ -template +template class CharProxy { friend class Char16String; friend class CharString; @@ -602,13 +602,13 @@ _FORCE_INLINE_ void sarray_add_str(Vector &arr, const String &p_str) { arr.push_back(p_str); } -template +template _FORCE_INLINE_ void sarray_add_str(Vector &arr, const String &p_str, P... p_args) { arr.push_back(p_str); sarray_add_str(arr, p_args...); } -template +template _FORCE_INLINE_ Vector sarray(P... p_args) { Vector arr; sarray_add_str(arr, p_args...); diff --git a/core/templates/bin_sorted_array.h b/core/templates/bin_sorted_array.h index 500d1f13779..30c1fefbbd0 100644 --- a/core/templates/bin_sorted_array.h +++ b/core/templates/bin_sorted_array.h @@ -34,7 +34,7 @@ #include "core/templates/local_vector.h" #include "core/templates/paged_array.h" -template +template class BinSortedArray { PagedArray array; LocalVector bin_limits; diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h index b1010f7f43c..40561198517 100644 --- a/core/templates/command_queue_mt.h +++ b/core/templates/command_queue_mt.h @@ -207,41 +207,41 @@ #define ARG(N) p##N #define PARAM(N) P##N p##N -#define TYPE_PARAM(N) class P##N +#define TYPE_PARAM(N) typename P##N #define PARAM_DECL(N) typename GetSimpleTypeT::type_t p##N -#define DECL_CMD(N) \ - template \ - struct Command##N : public CommandBase { \ - T *instance; \ - M method; \ - SEMIC_SEP_LIST(PARAM_DECL, N); \ - virtual void call() override { \ - (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ - } \ +#define DECL_CMD(N) \ + template \ + struct Command##N : public CommandBase { \ + T *instance; \ + M method; \ + SEMIC_SEP_LIST(PARAM_DECL, N); \ + virtual void call() override { \ + (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ + } \ }; -#define DECL_CMD_RET(N) \ - template \ - struct CommandRet##N : public SyncCommand { \ - R *ret; \ - T *instance; \ - M method; \ - SEMIC_SEP_LIST(PARAM_DECL, N); \ - virtual void call() override { \ - *ret = (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ - } \ +#define DECL_CMD_RET(N) \ + template \ + struct CommandRet##N : public SyncCommand { \ + R *ret; \ + T *instance; \ + M method; \ + SEMIC_SEP_LIST(PARAM_DECL, N); \ + virtual void call() override { \ + *ret = (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ + } \ }; -#define DECL_CMD_SYNC(N) \ - template \ - struct CommandSync##N : public SyncCommand { \ - T *instance; \ - M method; \ - SEMIC_SEP_LIST(PARAM_DECL, N); \ - virtual void call() override { \ - (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ - } \ +#define DECL_CMD_SYNC(N) \ + template \ + struct CommandSync##N : public SyncCommand { \ + T *instance; \ + M method; \ + SEMIC_SEP_LIST(PARAM_DECL, N); \ + virtual void call() override { \ + (instance->*method)(COMMA_SEP_LIST(ARG, N)); \ + } \ }; #define TYPE_ARG(N) P##N @@ -249,7 +249,7 @@ #define CMD_ASSIGN_PARAM(N) cmd->p##N = p##N #define DECL_PUSH(N) \ - template \ + template \ void push(T *p_instance, M p_method COMMA(N) COMMA_SEP_LIST(PARAM, N)) { \ CMD_TYPE(N) *cmd = allocate_and_lock(); \ cmd->instance = p_instance; \ @@ -263,7 +263,7 @@ #define CMD_RET_TYPE(N) CommandRet##N #define DECL_PUSH_AND_RET(N) \ - template \ + template \ void push_and_ret(T *p_instance, M p_method, COMMA_SEP_LIST(PARAM, N) COMMA(N) R *r_ret) { \ SyncSemaphore *ss = _alloc_sync_sem(); \ CMD_RET_TYPE(N) *cmd = allocate_and_lock(); \ @@ -282,7 +282,7 @@ #define CMD_SYNC_TYPE(N) CommandSync##N #define DECL_PUSH_AND_SYNC(N) \ - template \ + template \ void push_and_sync(T *p_instance, M p_method COMMA(N) COMMA_SEP_LIST(PARAM, N)) { \ SyncSemaphore *ss = _alloc_sync_sem(); \ CMD_SYNC_TYPE(N) *cmd = allocate_and_lock(); \ @@ -343,7 +343,7 @@ class CommandQueueMT { Semaphore *sync = nullptr; uint64_t flush_read_ptr = 0; - template + template T *allocate() { // alloc size is size+T+safeguard uint32_t alloc_size = ((sizeof(T) + 8 - 1) & ~(8 - 1)); @@ -354,7 +354,7 @@ class CommandQueueMT { return cmd; } - template + template T *allocate_and_lock() { lock(); T *ret = allocate(); diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index 466658951ec..f22ae1f1d37 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -38,12 +38,12 @@ #include #include -template +template class Vector; class String; class Char16String; class CharString; -template +template class VMap; static_assert(std::is_trivially_destructible_v>); @@ -54,14 +54,14 @@ static_assert(std::is_trivially_destructible_v>); #pragma GCC diagnostic ignored "-Wplacement-new" #endif -template +template class CowData { - template + template friend class Vector; friend class String; friend class Char16String; friend class CharString; - template + template friend class VMap; public: @@ -241,7 +241,7 @@ public: _FORCE_INLINE_ CowData(CowData &p_from) { _ref(p_from); }; }; -template +template void CowData::_unref(void *p_data) { if (!p_data) { return; @@ -268,7 +268,7 @@ void CowData::_unref(void *p_data) { Memory::free_static(((uint8_t *)p_data) - DATA_OFFSET, false); } -template +template typename CowData::USize CowData::_copy_on_write() { if (!_ptr) { return 0; @@ -308,7 +308,7 @@ typename CowData::USize CowData::_copy_on_write() { return rc; } -template +template template Error CowData::resize(Size p_size) { ERR_FAIL_COND_V(p_size < 0, ERR_INVALID_PARAMETER); @@ -401,7 +401,7 @@ Error CowData::resize(Size p_size) { return OK; } -template +template typename CowData::Size CowData::find(const T &p_val, Size p_from) const { Size ret = -1; @@ -419,7 +419,7 @@ typename CowData::Size CowData::find(const T &p_val, Size p_from) const { return ret; } -template +template typename CowData::Size CowData::rfind(const T &p_val, Size p_from) const { const Size s = size(); @@ -438,7 +438,7 @@ typename CowData::Size CowData::rfind(const T &p_val, Size p_from) const { return -1; } -template +template typename CowData::Size CowData::count(const T &p_val) const { Size amount = 0; for (Size i = 0; i < size(); i++) { @@ -449,12 +449,12 @@ typename CowData::Size CowData::count(const T &p_val) const { return amount; } -template +template void CowData::_ref(const CowData *p_from) { _ref(*p_from); } -template +template void CowData::_ref(const CowData &p_from) { if (_ptr == p_from._ptr) { return; // self assign, do nothing. @@ -472,7 +472,7 @@ void CowData::_ref(const CowData &p_from) { } } -template +template CowData::~CowData() { _unref(_ptr); } diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h index e1745110d7f..a3e8c2c788c 100644 --- a/core/templates/hash_map.h +++ b/core/templates/hash_map.h @@ -51,7 +51,7 @@ * The assignment operator copy the pairs from one map to the other. */ -template +template struct HashMapElement { HashMapElement *next = nullptr; HashMapElement *prev = nullptr; @@ -61,10 +61,10 @@ struct HashMapElement { data(p_key, p_value) {} }; -template , - class Allocator = DefaultTypedAllocator>> +template , + typename Allocator = DefaultTypedAllocator>> class HashMap { public: static constexpr uint32_t MIN_CAPACITY_INDEX = 2; // Use a prime. diff --git a/core/templates/hash_set.h b/core/templates/hash_set.h index 00f4acbc9c8..295b07e5e7c 100644 --- a/core/templates/hash_set.h +++ b/core/templates/hash_set.h @@ -46,9 +46,9 @@ * */ -template > +template > class HashSet { public: static constexpr uint32_t MIN_CAPACITY_INDEX = 2; // Use a prime. diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index a16f6555249..fc7a78bcf53 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -248,7 +248,7 @@ static _FORCE_INLINE_ uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev return ((p_prev << 5) + p_prev) + hash_one_uint64(u.i); } -template +template static _FORCE_INLINE_ uint32_t hash_make_uint32_t(T p_in) { union { T t; @@ -281,7 +281,7 @@ static _FORCE_INLINE_ uint64_t hash_djb2_one_64(uint64_t p_in, uint64_t p_prev = return ((p_prev << 5) + p_prev) ^ p_in; } -template +template static _FORCE_INLINE_ uint64_t hash_make_uint64_t(T p_in) { union { T t; @@ -293,15 +293,15 @@ static _FORCE_INLINE_ uint64_t hash_make_uint64_t(T p_in) { return _u._u64; } -template +template class Ref; struct HashMapHasherDefault { // Generic hash function for any type. - template + template static _FORCE_INLINE_ uint32_t hash(const T *p_pointer) { return hash_one_uint64((uint64_t)p_pointer); } - template + template static _FORCE_INLINE_ uint32_t hash(const Ref &p_ref) { return hash_one_uint64((uint64_t)p_ref.operator->()); } static _FORCE_INLINE_ uint32_t hash(const String &p_string) { return p_string.hash(); } @@ -387,7 +387,7 @@ struct HashMapHasherDefault { }; // TODO: Fold this into HashMapHasherDefault once C++20 concepts are allowed -template +template struct HashableHasher { static _FORCE_INLINE_ uint32_t hash(const T &hashable) { return hashable.hash(); } }; diff --git a/core/templates/list.h b/core/templates/list.h index 354e826a432..b4d4beb9300 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -43,7 +43,7 @@ * from the iterator. */ -template +template class List { struct _Data; @@ -410,7 +410,7 @@ public: /** * find an element in the list, */ - template + template Element *find(const T_v &p_val) { Element *it = front(); while (it) { @@ -646,7 +646,7 @@ public: sort_custom>(); } - template + template void sort_custom_inplace() { if (size() < 2) { return; @@ -693,7 +693,7 @@ public: _data->last = to; } - template + template struct AuxiliaryComparator { C compare; _FORCE_INLINE_ bool operator()(const Element *a, const Element *b) const { @@ -701,7 +701,7 @@ public: } }; - template + template void sort_custom() { //this version uses auxiliary memory for speed. //if you don't want to use auxiliary memory, use the in_place version @@ -764,7 +764,7 @@ public: } }; -template +template void List::Element::transfer_to_back(List *p_dst_list) { // Detach from current. diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 17ddbf61611..6478297fd19 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -41,7 +41,7 @@ // If tight, it grows strictly as much as needed. // Otherwise, it grows exponentially (the default and what you want in most cases). -template +template class LocalVector { private: U count = 0; @@ -248,7 +248,7 @@ public: return -1; } - template + template void sort_custom() { U len = count; if (len == 0) { @@ -322,7 +322,7 @@ public: } }; -template +template using TightLocalVector = LocalVector; #endif // LOCAL_VECTOR_H diff --git a/core/templates/lru.h b/core/templates/lru.h index aecb735c48c..919c5605aa5 100644 --- a/core/templates/lru.h +++ b/core/templates/lru.h @@ -35,7 +35,7 @@ #include "hash_map.h" #include "list.h" -template > +template > class LRUCache { private: struct Pair { diff --git a/core/templates/oa_hash_map.h b/core/templates/oa_hash_map.h index 752e264a498..7afb58b7c2e 100644 --- a/core/templates/oa_hash_map.h +++ b/core/templates/oa_hash_map.h @@ -50,9 +50,9 @@ * * The assignment operator copy the pairs from one map to the other. */ -template > +template > class OAHashMap { private: TValue *values = nullptr; diff --git a/core/templates/paged_allocator.h b/core/templates/paged_allocator.h index 48110d37e5f..4854e1b8668 100644 --- a/core/templates/paged_allocator.h +++ b/core/templates/paged_allocator.h @@ -40,7 +40,7 @@ #include #include -template +template class PagedAllocator { T **page_pool = nullptr; T ***available_pool = nullptr; @@ -53,7 +53,7 @@ class PagedAllocator { SpinLock spin_lock; public: - template + template T *alloc(Args &&...p_args) { if (thread_safe) { spin_lock.lock(); @@ -95,7 +95,7 @@ public: } } - template + template T *new_allocation(Args &&...p_args) { return alloc(p_args...); } void delete_allocation(T *p_mem) { free(p_mem); } diff --git a/core/templates/paged_array.h b/core/templates/paged_array.h index 21053dd0334..1aa8fa24852 100644 --- a/core/templates/paged_array.h +++ b/core/templates/paged_array.h @@ -41,7 +41,7 @@ // PageArrayPool manages central page allocation in a thread safe matter -template +template class PagedArrayPool { T **page_pool = nullptr; uint32_t pages_allocated = 0; @@ -134,7 +134,7 @@ public: // It does so by allocating pages from a PagedArrayPool. // It is safe to use multiple PagedArrays from different threads, sharing a single PagedArrayPool -template +template class PagedArray { PagedArrayPool *page_pool = nullptr; diff --git a/core/templates/pair.h b/core/templates/pair.h index ff093a58e68..fd774641c23 100644 --- a/core/templates/pair.h +++ b/core/templates/pair.h @@ -33,7 +33,7 @@ #include "core/templates/hashfuncs.h" #include "core/typedefs.h" -template +template struct Pair { F first; S second; @@ -49,17 +49,17 @@ struct Pair { } }; -template +template bool operator==(const Pair &pair, const Pair &other) { return (pair.first == other.first) && (pair.second == other.second); } -template +template bool operator!=(const Pair &pair, const Pair &other) { return (pair.first != other.first) || (pair.second != other.second); } -template +template struct PairSort { bool operator()(const Pair &A, const Pair &B) const { if (A.first != B.first) { @@ -69,7 +69,7 @@ struct PairSort { } }; -template +template struct PairHash { static uint32_t hash(const Pair &P) { uint64_t h1 = HashMapHasherDefault::hash(P.first); @@ -78,7 +78,7 @@ struct PairHash { } }; -template +template struct KeyValue { const K key; V value; @@ -94,17 +94,17 @@ struct KeyValue { } }; -template +template bool operator==(const KeyValue &pair, const KeyValue &other) { return (pair.key == other.key) && (pair.value == other.value); } -template +template bool operator!=(const KeyValue &pair, const KeyValue &other) { return (pair.key != other.key) || (pair.value != other.value); } -template +template struct KeyValueSort { bool operator()(const KeyValue &A, const KeyValue &B) const { return A.key < B.key; diff --git a/core/templates/pooled_list.h b/core/templates/pooled_list.h index 0d96bbb2393..0e7048732e2 100644 --- a/core/templates/pooled_list.h +++ b/core/templates/pooled_list.h @@ -55,7 +55,7 @@ #include "core/templates/local_vector.h" -template +template class PooledList { LocalVector list; LocalVector freelist; @@ -128,7 +128,7 @@ public: }; // a pooled list which automatically keeps a list of the active members -template +template class TrackedPooledList { public: U pool_used_size() const { return _pool.used_size(); } diff --git a/core/templates/rb_map.h b/core/templates/rb_map.h index 152fddd0118..ef555e4a161 100644 --- a/core/templates/rb_map.h +++ b/core/templates/rb_map.h @@ -38,7 +38,7 @@ // based on the very nice implementation of rb-trees by: // https://web.archive.org/web/20120507164830/https://web.mit.edu/~emin/www/source_code/red_black_tree/index.html -template , class A = DefaultAllocator> +template , typename A = DefaultAllocator> class RBMap { enum Color { RED, diff --git a/core/templates/rb_set.h b/core/templates/rb_set.h index 0fc88709e4d..ac7a8df36a3 100644 --- a/core/templates/rb_set.h +++ b/core/templates/rb_set.h @@ -37,7 +37,7 @@ // based on the very nice implementation of rb-trees by: // https://web.archive.org/web/20120507164830/https://web.mit.edu/~emin/www/source_code/red_black_tree/index.html -template , class A = DefaultAllocator> +template , typename A = DefaultAllocator> class RBSet { enum Color { RED, diff --git a/core/templates/rid_owner.h b/core/templates/rid_owner.h index f92e0f41626..86304d3c73e 100644 --- a/core/templates/rid_owner.h +++ b/core/templates/rid_owner.h @@ -67,7 +67,7 @@ public: virtual ~RID_AllocBase() {} }; -template +template class RID_Alloc : public RID_AllocBase { T **chunks = nullptr; uint32_t **free_list_chunks = nullptr; @@ -364,7 +364,7 @@ public: } }; -template +template class RID_PtrOwner { RID_Alloc alloc; @@ -423,7 +423,7 @@ public: alloc(p_target_chunk_byte_size) {} }; -template +template class RID_Owner { RID_Alloc alloc; diff --git a/core/templates/safe_list.h b/core/templates/safe_list.h index 79457db24c2..60ccdd94234 100644 --- a/core/templates/safe_list.h +++ b/core/templates/safe_list.h @@ -48,7 +48,7 @@ // This is used in very specific areas of the engine where it's critical that these guarantees are held. -template +template class SafeList { struct SafeListNode { std::atomic next = nullptr; diff --git a/core/templates/safe_refcount.h b/core/templates/safe_refcount.h index 7bbceadc8db..637b068da9b 100644 --- a/core/templates/safe_refcount.h +++ b/core/templates/safe_refcount.h @@ -59,7 +59,7 @@ static_assert(sizeof(SafeFlag) == sizeof(bool)); \ static_assert(alignof(SafeFlag) == alignof(bool)); -template +template class SafeNumeric { std::atomic value; diff --git a/core/templates/search_array.h b/core/templates/search_array.h index 9c3f5273235..835bcd63a60 100644 --- a/core/templates/search_array.h +++ b/core/templates/search_array.h @@ -33,7 +33,7 @@ #include -template > +template > class SearchArray { public: Comparator compare; diff --git a/core/templates/self_list.h b/core/templates/self_list.h index afa0501c75c..a04972594e4 100644 --- a/core/templates/self_list.h +++ b/core/templates/self_list.h @@ -34,7 +34,7 @@ #include "core/error/error_macros.h" #include "core/typedefs.h" -template +template class SelfList { public: class List { @@ -109,7 +109,7 @@ public: sort_custom>(); } - template + template void sort_custom() { if (_first == _last) { return; diff --git a/core/templates/simple_type.h b/core/templates/simple_type.h index 3950158c5a5..b2ae0110e25 100644 --- a/core/templates/simple_type.h +++ b/core/templates/simple_type.h @@ -33,22 +33,22 @@ /* Batch of specializations to obtain the actual simple type */ -template +template struct GetSimpleTypeT { typedef T type_t; }; -template +template struct GetSimpleTypeT { typedef T type_t; }; -template +template struct GetSimpleTypeT { typedef T type_t; }; -template +template struct GetSimpleTypeT { typedef T type_t; }; diff --git a/core/templates/sort_array.h b/core/templates/sort_array.h index 45aeaf15792..e7eaf8ee818 100644 --- a/core/templates/sort_array.h +++ b/core/templates/sort_array.h @@ -40,7 +40,7 @@ break; \ } -template +template struct _DefaultComparator { _FORCE_INLINE_ bool operator()(const T &a, const T &b) const { return (a < b); } }; @@ -51,7 +51,7 @@ struct _DefaultComparator { #define SORT_ARRAY_VALIDATE_ENABLED false #endif -template , bool Validate = SORT_ARRAY_VALIDATE_ENABLED> +template , bool Validate = SORT_ARRAY_VALIDATE_ENABLED> class SortArray { enum { INTROSORT_THRESHOLD = 16 diff --git a/core/templates/vector.h b/core/templates/vector.h index 0de6a34ced4..52c10eea68f 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -45,7 +45,7 @@ #include #include -template +template class VectorWriteProxy { public: _FORCE_INLINE_ T &operator[](typename CowData::Size p_index) { @@ -55,7 +55,7 @@ public: } }; -template +template class Vector { friend class VectorWriteProxy; @@ -108,7 +108,7 @@ public: sort_custom<_DefaultComparator>(); } - template + template void sort_custom(Args &&...args) { Size len = _cowdata.size(); if (len == 0) { @@ -124,7 +124,7 @@ public: return bsearch_custom<_DefaultComparator>(p_value, p_before); } - template + template Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) { SearchArray search{ args... }; return search.bisect(ptrw(), size(), p_value, p_before); @@ -291,7 +291,7 @@ public: _FORCE_INLINE_ ~Vector() {} }; -template +template void Vector::reverse() { for (Size i = 0; i < size() / 2; i++) { T *p = ptrw(); @@ -299,7 +299,7 @@ void Vector::reverse() { } } -template +template void Vector::append_array(const Vector &p_other) { const Size ds = p_other.size(); if (ds == 0) { @@ -312,7 +312,7 @@ void Vector::append_array(const Vector &p_other) { } } -template +template bool Vector::push_back(T p_elem) { Error err = resize(size() + 1); ERR_FAIL_COND_V(err, true); @@ -321,7 +321,7 @@ bool Vector::push_back(T p_elem) { return false; } -template +template void Vector::fill(T p_elem) { T *p = ptrw(); for (Size i = 0; i < size(); i++) { diff --git a/core/templates/vmap.h b/core/templates/vmap.h index 5620bd37722..2ad074942b3 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -34,7 +34,7 @@ #include "core/templates/cowdata.h" #include "core/typedefs.h" -template +template class VMap { public: struct Pair { diff --git a/core/templates/vset.h b/core/templates/vset.h index a4886ca965a..614d0e1e5f3 100644 --- a/core/templates/vset.h +++ b/core/templates/vset.h @@ -34,7 +34,7 @@ #include "core/templates/vector.h" #include "core/typedefs.h" -template +template class VSet { Vector _data; diff --git a/core/typedefs.h b/core/typedefs.h index 8807ee3c99e..2b90a911cdb 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -132,7 +132,7 @@ constexpr auto CLAMP(const T m_a, const T2 m_min, const T3 m_max) { // Generic swap template. #ifndef SWAP #define SWAP(m_x, m_y) __swap_tmpl((m_x), (m_y)) -template +template inline void __swap_tmpl(T &x, T &y) { T aux = x; x = y; @@ -186,7 +186,7 @@ static inline int get_shift_from_power_of_2(unsigned int p_bits) { return -1; } -template +template static _FORCE_INLINE_ T nearest_power_of_2_templated(T x) { --x; @@ -256,7 +256,7 @@ static inline uint64_t BSWAP64(uint64_t x) { #endif // Generic comparator used in Map, List, etc. -template +template struct Comparator { _ALWAYS_INLINE_ bool operator()(const T &p_a, const T &p_b) const { return (p_a < p_b); } }; diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h index a44b9383955..0fe4518b0f0 100644 --- a/core/variant/binder_common.h +++ b/core/variant/binder_common.h @@ -47,7 +47,7 @@ // Variant cannot define an implicit cast operator for every Object subclass, so the // casting is done here, to allow binding methods with parameters more specific than Object * -template +template struct VariantCaster { static _FORCE_INLINE_ T cast(const Variant &p_variant) { using TStripped = std::remove_pointer_t; @@ -59,7 +59,7 @@ struct VariantCaster { } }; -template +template struct VariantCaster { static _FORCE_INLINE_ T cast(const Variant &p_variant) { using TStripped = std::remove_pointer_t; @@ -71,7 +71,7 @@ struct VariantCaster { } }; -template +template struct VariantCaster { static _FORCE_INLINE_ T cast(const Variant &p_variant) { using TStripped = std::remove_pointer_t; @@ -249,7 +249,7 @@ struct VariantObjectClassChecker &> { #ifdef DEBUG_METHODS_ENABLED -template +template struct VariantCasterAndValidate { static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { Variant::Type argtype = GetTypeInfo::VARIANT_TYPE; @@ -264,7 +264,7 @@ struct VariantCasterAndValidate { } }; -template +template struct VariantCasterAndValidate { static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { Variant::Type argtype = GetTypeInfo::VARIANT_TYPE; @@ -279,7 +279,7 @@ struct VariantCasterAndValidate { } }; -template +template struct VariantCasterAndValidate { static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { Variant::Type argtype = GetTypeInfo::VARIANT_TYPE; @@ -296,7 +296,7 @@ struct VariantCasterAndValidate { #endif // DEBUG_METHODS_ENABLED -template +template void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -308,7 +308,7 @@ void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), con (void)(p_args); //avoid warning } -template +template void call_with_variant_argsc_helper(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -320,87 +320,87 @@ void call_with_variant_argsc_helper(T *p_instance, void (T::*p_method)(P...) con (void)(p_args); //avoid warning } -template +template void call_with_ptr_args_helper(T *p_instance, void (T::*p_method)(P...), const void **p_args, IndexSequence) { (p_instance->*p_method)(PtrToArg

::convert(p_args[Is])...); } -template +template void call_with_ptr_argsc_helper(T *p_instance, void (T::*p_method)(P...) const, const void **p_args, IndexSequence) { (p_instance->*p_method)(PtrToArg

::convert(p_args[Is])...); } -template +template void call_with_ptr_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const void **p_args, void *r_ret, IndexSequence) { PtrToArg::encode((p_instance->*p_method)(PtrToArg

::convert(p_args[Is])...), r_ret); } -template +template void call_with_ptr_args_retc_helper(T *p_instance, R (T::*p_method)(P...) const, const void **p_args, void *r_ret, IndexSequence) { PtrToArg::encode((p_instance->*p_method)(PtrToArg

::convert(p_args[Is])...), r_ret); } -template +template void call_with_ptr_args_static_helper(T *p_instance, void (*p_method)(T *, P...), const void **p_args, IndexSequence) { p_method(p_instance, PtrToArg

::convert(p_args[Is])...); } -template +template void call_with_ptr_args_static_retc_helper(T *p_instance, R (*p_method)(T *, P...), const void **p_args, void *r_ret, IndexSequence) { PtrToArg::encode(p_method(p_instance, PtrToArg

::convert(p_args[Is])...), r_ret); } -template +template void call_with_ptr_args_static_method_ret_helper(R (*p_method)(P...), const void **p_args, void *r_ret, IndexSequence) { PtrToArg::encode(p_method(PtrToArg

::convert(p_args[Is])...), r_ret); } -template +template void call_with_ptr_args_static_method_helper(void (*p_method)(P...), const void **p_args, IndexSequence) { p_method(PtrToArg

::convert(p_args[Is])...); } -template +template void call_with_validated_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, IndexSequence) { (p_instance->*p_method)((VariantInternalAccessor::type_t>::get(p_args[Is]))...); } -template +template void call_with_validated_variant_argsc_helper(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, IndexSequence) { (p_instance->*p_method)((VariantInternalAccessor::type_t>::get(p_args[Is]))...); } -template +template void call_with_validated_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant *r_ret, IndexSequence) { VariantInternalAccessor::type_t>::set(r_ret, (p_instance->*p_method)((VariantInternalAccessor::type_t>::get(p_args[Is]))...)); } -template +template void call_with_validated_variant_args_retc_helper(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, Variant *r_ret, IndexSequence) { VariantInternalAccessor::type_t>::set(r_ret, (p_instance->*p_method)((VariantInternalAccessor::type_t>::get(p_args[Is]))...)); } -template +template void call_with_validated_variant_args_static_retc_helper(T *p_instance, R (*p_method)(T *, P...), const Variant **p_args, Variant *r_ret, IndexSequence) { VariantInternalAccessor::type_t>::set(r_ret, p_method(p_instance, (VariantInternalAccessor::type_t>::get(p_args[Is]))...)); } -template +template void call_with_validated_variant_args_static_helper(T *p_instance, void (*p_method)(T *, P...), const Variant **p_args, IndexSequence) { p_method(p_instance, (VariantInternalAccessor::type_t>::get(p_args[Is]))...); } -template +template void call_with_validated_variant_args_static_method_ret_helper(R (*p_method)(P...), const Variant **p_args, Variant *r_ret, IndexSequence) { VariantInternalAccessor::type_t>::set(r_ret, p_method((VariantInternalAccessor::type_t>::get(p_args[Is]))...)); } -template +template void call_with_validated_variant_args_static_method_helper(void (*p_method)(P...), const Variant **p_args, IndexSequence) { p_method((VariantInternalAccessor::type_t>::get(p_args[Is]))...); } -template +template void call_with_variant_args(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -418,7 +418,7 @@ void call_with_variant_args(T *p_instance, void (T::*p_method)(P...), const Vari call_with_variant_args_helper(p_instance, p_method, p_args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_dv(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -451,7 +451,7 @@ void call_with_variant_args_dv(T *p_instance, void (T::*p_method)(P...), const V call_with_variant_args_helper(p_instance, p_method, args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_argsc(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -469,7 +469,7 @@ void call_with_variant_argsc(T *p_instance, void (T::*p_method)(P...) const, con call_with_variant_args_helper(p_instance, p_method, p_args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_argsc_dv(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -502,7 +502,7 @@ void call_with_variant_argsc_dv(T *p_instance, void (T::*p_method)(P...) const, call_with_variant_argsc_helper(p_instance, p_method, args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_ret_dv(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -535,7 +535,7 @@ void call_with_variant_args_ret_dv(T *p_instance, R (T::*p_method)(P...), const call_with_variant_args_ret_helper(p_instance, p_method, args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_retc_dv(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -568,111 +568,111 @@ void call_with_variant_args_retc_dv(T *p_instance, R (T::*p_method)(P...) const, call_with_variant_args_retc_helper(p_instance, p_method, args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_ptr_args(T *p_instance, void (T::*p_method)(P...), const void **p_args) { call_with_ptr_args_helper(p_instance, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_ptr_argsc(T *p_instance, void (T::*p_method)(P...) const, const void **p_args) { call_with_ptr_argsc_helper(p_instance, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_ptr_args_ret(T *p_instance, R (T::*p_method)(P...), const void **p_args, void *r_ret) { call_with_ptr_args_ret_helper(p_instance, p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_ptr_args_retc(T *p_instance, R (T::*p_method)(P...) const, const void **p_args, void *r_ret) { call_with_ptr_args_retc_helper(p_instance, p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_ptr_args_static(T *p_instance, void (*p_method)(T *, P...), const void **p_args) { call_with_ptr_args_static_helper(p_instance, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_ptr_args_static_retc(T *p_instance, R (*p_method)(T *, P...), const void **p_args, void *r_ret) { call_with_ptr_args_static_retc_helper(p_instance, p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_ptr_args_static_method_ret(R (*p_method)(P...), const void **p_args, void *r_ret) { call_with_ptr_args_static_method_ret_helper(p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_ptr_args_static_method(void (*p_method)(P...), const void **p_args) { call_with_ptr_args_static_method_helper(p_method, p_args, BuildIndexSequence{}); } // Validated -template +template void call_with_validated_variant_args(Variant *base, void (T::*p_method)(P...), const Variant **p_args) { call_with_validated_variant_args_helper(VariantGetInternalPtr::get_ptr(base), p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_ret(Variant *base, R (T::*p_method)(P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_ret_helper(VariantGetInternalPtr::get_ptr(base), p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_retc(Variant *base, R (T::*p_method)(P...) const, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_retc_helper(VariantGetInternalPtr::get_ptr(base), p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_static(Variant *base, void (*p_method)(T *, P...), const Variant **p_args) { call_with_validated_variant_args_static_helper(VariantGetInternalPtr::get_ptr(base), p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_static_retc(Variant *base, R (*p_method)(T *, P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_retc_helper(VariantGetInternalPtr::get_ptr(base), p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_static_method(void (*p_method)(P...), const Variant **p_args) { call_with_validated_variant_args_static_method_helper(p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_variant_args_static_method_ret(R (*p_method)(P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_method_ret_helper(p_method, p_args, r_ret, BuildIndexSequence{}); } // Validated Object -template +template void call_with_validated_object_instance_args(T *base, void (T::*p_method)(P...), const Variant **p_args) { call_with_validated_variant_args_helper(base, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_object_instance_argsc(T *base, void (T::*p_method)(P...) const, const Variant **p_args) { call_with_validated_variant_argsc_helper(base, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_object_instance_args_ret(T *base, R (T::*p_method)(P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_ret_helper(base, p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_validated_object_instance_args_retc(T *base, R (T::*p_method)(P...) const, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_retc_helper(base, p_method, p_args, r_ret, BuildIndexSequence{}); } -template +template void call_with_validated_object_instance_args_static(T *base, void (*p_method)(T *, P...), const Variant **p_args) { call_with_validated_variant_args_static_helper(base, p_method, p_args, BuildIndexSequence{}); } -template +template void call_with_validated_object_instance_args_static_retc(T *base, R (*p_method)(T *, P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_retc_helper(base, p_method, p_args, r_ret, BuildIndexSequence{}); } @@ -684,7 +684,7 @@ void call_with_validated_object_instance_args_static_retc(T *base, R (*p_method) #pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #endif -template +template void call_get_argument_type_helper(int p_arg, int &index, Variant::Type &type) { if (p_arg == index) { type = GetTypeInfo::VARIANT_TYPE; @@ -692,7 +692,7 @@ void call_get_argument_type_helper(int p_arg, int &index, Variant::Type &type) { index++; } -template +template Variant::Type call_get_argument_type(int p_arg) { Variant::Type type = Variant::NIL; int index = 0; @@ -704,7 +704,7 @@ Variant::Type call_get_argument_type(int p_arg) { return type; } -template +template void call_get_argument_type_info_helper(int p_arg, int &index, PropertyInfo &info) { if (p_arg == index) { info = GetTypeInfo::get_class_info(); @@ -712,7 +712,7 @@ void call_get_argument_type_info_helper(int p_arg, int &index, PropertyInfo &inf index++; } -template +template void call_get_argument_type_info(int p_arg, PropertyInfo &info) { int index = 0; // I think rocket science is simpler than modern C++. @@ -723,7 +723,7 @@ void call_get_argument_type_info(int p_arg, PropertyInfo &info) { } #ifdef DEBUG_METHODS_ENABLED -template +template void call_get_argument_metadata_helper(int p_arg, int &index, GodotTypeInfo::Metadata &md) { if (p_arg == index) { md = GetTypeInfo::METADATA; @@ -731,7 +731,7 @@ void call_get_argument_metadata_helper(int p_arg, int &index, GodotTypeInfo::Met index++; } -template +template GodotTypeInfo::Metadata call_get_argument_metadata(int p_arg) { GodotTypeInfo::Metadata md = GodotTypeInfo::METADATA_NONE; @@ -748,7 +748,7 @@ GodotTypeInfo::Metadata call_get_argument_metadata(int p_arg) { ////////////////////// -template +template void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -759,7 +759,7 @@ void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), co #endif } -template +template void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -770,7 +770,7 @@ void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_ar #endif } -template +template void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -781,7 +781,7 @@ void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_arg #endif } -template +template void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -799,7 +799,7 @@ void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Var call_with_variant_args_ret_helper(p_instance, p_method, p_args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_retc_helper(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -811,7 +811,7 @@ void call_with_variant_args_retc_helper(T *p_instance, R (T::*p_method)(P...) co (void)p_args; } -template +template void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -829,7 +829,7 @@ void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_ar call_with_variant_args_static_ret(p_method, p_args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_static_ret(void (*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -847,7 +847,7 @@ void call_with_variant_args_static_ret(void (*p_method)(P...), const Variant **p call_with_variant_args_static(p_method, p_args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_retc(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) { #ifdef DEBUG_METHODS_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -865,7 +865,7 @@ void call_with_variant_args_retc(T *p_instance, R (T::*p_method)(P...) const, co call_with_variant_args_retc_helper(p_instance, p_method, p_args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_retc_static_helper(T *p_instance, R (*p_method)(T *, P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -878,7 +878,7 @@ void call_with_variant_args_retc_static_helper(T *p_instance, R (*p_method)(T *, (void)p_args; } -template +template void call_with_variant_args_retc_static_helper_dv(T *p_instance, R (*p_method)(T *, P...), const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &default_values, Callable::CallError &r_error) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -911,7 +911,7 @@ void call_with_variant_args_retc_static_helper_dv(T *p_instance, R (*p_method)(T call_with_variant_args_retc_static_helper(p_instance, p_method, args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_static_helper(T *p_instance, void (*p_method)(T *, P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; @@ -924,7 +924,7 @@ void call_with_variant_args_static_helper(T *p_instance, void (*p_method)(T *, P (void)p_args; } -template +template void call_with_variant_args_static_helper_dv(T *p_instance, void (*p_method)(T *, P...), const Variant **p_args, int p_argcount, const Vector &default_values, Callable::CallError &r_error) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -957,7 +957,7 @@ void call_with_variant_args_static_helper_dv(T *p_instance, void (*p_method)(T * call_with_variant_args_static_helper(p_instance, p_method, args, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_static_ret_dv(R (*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { @@ -990,7 +990,7 @@ void call_with_variant_args_static_ret_dv(R (*p_method)(P...), const Variant **p call_with_variant_args_static_ret(p_method, args, r_ret, r_error, BuildIndexSequence{}); } -template +template void call_with_variant_args_static_dv(void (*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error, const Vector &default_values) { #ifdef DEBUG_ENABLED if ((size_t)p_argcount > sizeof...(P)) { diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h index 1be54ba3fde..123f2067e24 100644 --- a/core/variant/method_ptrcall.h +++ b/core/variant/method_ptrcall.h @@ -35,7 +35,7 @@ #include "core/typedefs.h" #include "core/variant/variant.h" -template +template struct PtrToArg {}; #define MAKE_PTRARG(m_type) \ @@ -156,7 +156,7 @@ MAKE_PTRARG_BY_REFERENCE(Variant); // This is for Object. -template +template struct PtrToArg { _FORCE_INLINE_ static T *convert(const void *p_ptr) { if (p_ptr == nullptr) { @@ -170,7 +170,7 @@ struct PtrToArg { } }; -template +template struct PtrToArg { _FORCE_INLINE_ static const T *convert(const void *p_ptr) { if (p_ptr == nullptr) { diff --git a/core/variant/native_ptr.h b/core/variant/native_ptr.h index 9199b128458..33ba0381327 100644 --- a/core/variant/native_ptr.h +++ b/core/variant/native_ptr.h @@ -35,7 +35,7 @@ #include "core/variant/method_ptrcall.h" #include "core/variant/type_info.h" -template +template struct GDExtensionConstPtr { const T *data = nullptr; GDExtensionConstPtr(const T *p_assign) { data = p_assign; } @@ -44,7 +44,7 @@ struct GDExtensionConstPtr { operator Variant() const { return uint64_t(data); } }; -template +template struct GDExtensionPtr { T *data = nullptr; GDExtensionPtr(T *p_assign) { data = p_assign; } @@ -95,7 +95,7 @@ struct GDExtensionPtr { static _FORCE_INLINE_ void set(Variant *v, const GDExtensionPtr &p_value) { *VariantInternal::get_int(v) = uint64_t(p_value.data); } \ }; -template +template struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::NIL; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; @@ -104,7 +104,7 @@ struct GetTypeInfo> { } }; -template +template struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::NIL; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; @@ -113,7 +113,7 @@ struct GetTypeInfo> { } }; -template +template struct PtrToArg> { _FORCE_INLINE_ static GDExtensionConstPtr convert(const void *p_ptr) { return GDExtensionConstPtr(reinterpret_cast(p_ptr)); @@ -123,7 +123,7 @@ struct PtrToArg> { *((const T **)p_ptr) = p_val.data; } }; -template +template struct PtrToArg> { _FORCE_INLINE_ static GDExtensionPtr convert(const void *p_ptr) { return GDExtensionPtr(reinterpret_cast(p_ptr)); diff --git a/core/variant/type_info.h b/core/variant/type_info.h index 49c4db82291..32c410463b4 100644 --- a/core/variant/type_info.h +++ b/core/variant/type_info.h @@ -80,7 +80,7 @@ enum Metadata { // If 'T' is a class that inherits 'Object', make sure it can see the actual class declaration // instead of a forward declaration. You can always forward declare 'T' in a header file, and then // include the actual declaration of 'T' in the source file where 'GetTypeInfo' is instantiated. -template +template struct GetTypeInfo; #define MAKE_TYPE_INFO(m_type, m_var_type) \ @@ -278,7 +278,7 @@ inline StringName __constant_get_enum_name(T param, const String &p_constant) { return GetTypeInfo::get_class_info().class_name; } -template +template class BitField { int64_t value = 0; diff --git a/core/variant/typed_array.h b/core/variant/typed_array.h index ed973b9daa0..0befd198648 100644 --- a/core/variant/typed_array.h +++ b/core/variant/typed_array.h @@ -38,7 +38,7 @@ #include "core/variant/type_info.h" #include "core/variant/variant.h" -template +template class TypedArray : public Array { public: _FORCE_INLINE_ void operator=(const Array &p_array) { @@ -56,12 +56,12 @@ public: } }; -template +template struct VariantInternalAccessor> { static _FORCE_INLINE_ TypedArray get(const Variant *v) { return *VariantInternal::get_array(v); } static _FORCE_INLINE_ void set(Variant *v, const TypedArray &p_array) { *VariantInternal::get_array(v) = p_array; } }; -template +template struct VariantInternalAccessor &> { static _FORCE_INLINE_ TypedArray get(const Variant *v) { return *VariantInternal::get_array(v); } static _FORCE_INLINE_ void set(Variant *v, const TypedArray &p_array) { *VariantInternal::get_array(v) = p_array; } @@ -136,7 +136,7 @@ MAKE_TYPED_ARRAY(PackedVector3Array, Variant::PACKED_VECTOR3_ARRAY) MAKE_TYPED_ARRAY(PackedColorArray, Variant::PACKED_COLOR_ARRAY) MAKE_TYPED_ARRAY(IPAddress, Variant::STRING) -template +template struct PtrToArg> { _FORCE_INLINE_ static TypedArray convert(const void *p_ptr) { return TypedArray(*reinterpret_cast(p_ptr)); @@ -147,7 +147,7 @@ struct PtrToArg> { } }; -template +template struct PtrToArg &> { typedef Array EncodeT; _FORCE_INLINE_ static TypedArray convert(const void *p_ptr) { @@ -155,7 +155,7 @@ struct PtrToArg &> { } }; -template +template struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::ARRAY; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; @@ -164,7 +164,7 @@ struct GetTypeInfo> { } }; -template +template struct GetTypeInfo &> { static const Variant::Type VARIANT_TYPE = Variant::ARRAY; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index ce5423fafcf..89c22c05ddf 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -1697,7 +1697,7 @@ String stringify_variant_clean(const Variant &p_variant, int recursion_count) { return s; } -template +template String stringify_vector(const T &vec, int recursion_count) { String str("["); for (int i = 0; i < vec.size(); i++) { @@ -2188,7 +2188,7 @@ Variant::operator Signal() const { } } -template +template inline DA _convert_array(const SA &p_array) { DA da; da.resize(p_array.size()); @@ -2200,7 +2200,7 @@ inline DA _convert_array(const SA &p_array) { return da; } -template +template inline DA _convert_array_from_variant(const Variant &p_variant) { switch (p_variant.get_type()) { case Variant::ARRAY: { diff --git a/core/variant/variant.h b/core/variant/variant.h index c358559c9b6..e8eec8171b0 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -204,7 +204,7 @@ private: _FORCE_INLINE_ virtual ~PackedArrayRefBase() {} //needs virtual destructor, but make inline }; - template + template struct PackedArrayRef : public PackedArrayRefBase { Vector array; static _FORCE_INLINE_ PackedArrayRef *create() { diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 060ea007ff4..58c04822417 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -43,329 +43,329 @@ typedef void (*VariantFunc)(Variant &r_ret, Variant &p_self, const Variant **p_args); typedef void (*VariantConstructFunc)(Variant &r_ret, const Variant **p_args); -template +template static _FORCE_INLINE_ void vc_static_method_call(R (*method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_static_ret_dv(method, p_args, p_argcount, r_ret, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_static_method_call(void (*method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_static_dv(method, p_args, p_argcount, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_method_call(R (T::*method)(P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_ret_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, r_ret, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_method_call(R (T::*method)(P...) const, Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_retc_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, r_ret, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_method_call(void (T::*method)(P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { VariantInternal::clear(&r_ret); call_with_variant_args_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_method_call(void (T::*method)(P...) const, Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { VariantInternal::clear(&r_ret); call_with_variant_argsc_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_convert_method_call(R (T::*method)(P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_variant_args_ret_dv(&converted, method, p_args, p_argcount, r_ret, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_convert_method_call(R (T::*method)(P...) const, Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_variant_args_retc_dv(&converted, method, p_args, p_argcount, r_ret, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_convert_method_call(void (T::*method)(P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_variant_args_dv(&converted, method, p_args, p_argcount, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_convert_method_call(void (T::*method)(P...) const, Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_variant_argsc_dv(&converted, method, p_args, p_argcount, r_error, p_defvals); } -template +template static _FORCE_INLINE_ void vc_method_call_static(R (*method)(T *, P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_retc_static_helper_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, r_ret, p_defvals, r_error); } -template +template static _FORCE_INLINE_ void vc_method_call_static(void (*method)(T *, P...), Variant *base, const Variant **p_args, int p_argcount, Variant &r_ret, const Vector &p_defvals, Callable::CallError &r_error) { call_with_variant_args_static_helper_dv(VariantGetInternalPtr::get_ptr(base), method, p_args, p_argcount, p_defvals, r_error); } -template +template static _FORCE_INLINE_ void vc_validated_call(R (T::*method)(P...), Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_ret(base, method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_validated_call(R (T::*method)(P...) const, Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_retc(base, method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_validated_call(void (T::*method)(P...), Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args(base, method, p_args); } -template +template static _FORCE_INLINE_ void vc_validated_call(void (T::*method)(P...) const, Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_argsc(base, method, p_args); } -template +template static _FORCE_INLINE_ void vc_convert_validated_call(R (T::*method)(P...), Variant *base, const Variant **p_args, Variant *r_ret) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_validated_variant_args_ret_helper(&converted, method, p_args, r_ret, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void vc_convert_validated_call(R (T::*method)(P...) const, Variant *base, const Variant **p_args, Variant *r_ret) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_validated_variant_args_retc_helper(&converted, method, p_args, r_ret, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void vc_convert_validated_call(void (T::*method)(P...), Variant *base, const Variant **p_args, Variant *r_ret) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_validated_variant_args_helper(&converted, method, p_args, r_ret, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void vc_convert_validated_call(void (T::*method)(P...) const, Variant *base, const Variant **p_args, Variant *r_ret) { T converted(static_cast(*VariantGetInternalPtr::get_ptr(base))); call_with_validated_variant_argsc_helper(&converted, method, p_args, r_ret, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void vc_validated_call_static(R (*method)(T *, P...), Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_retc(base, method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_validated_call_static(void (*method)(T *, P...), Variant *base, const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static(base, method, p_args); } -template +template static _FORCE_INLINE_ void vc_validated_static_call(R (*method)(P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_method_ret(method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_validated_static_call(void (*method)(P...), const Variant **p_args, Variant *r_ret) { call_with_validated_variant_args_static_method(method, p_args); } -template +template static _FORCE_INLINE_ void vc_ptrcall(R (T::*method)(P...), void *p_base, const void **p_args, void *r_ret) { call_with_ptr_args_ret(reinterpret_cast(p_base), method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_ptrcall(R (T::*method)(P...) const, void *p_base, const void **p_args, void *r_ret) { call_with_ptr_args_retc(reinterpret_cast(p_base), method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_ptrcall(void (T::*method)(P...), void *p_base, const void **p_args, void *r_ret) { call_with_ptr_args(reinterpret_cast(p_base), method, p_args); } -template +template static _FORCE_INLINE_ void vc_ptrcall(void (T::*method)(P...) const, void *p_base, const void **p_args, void *r_ret) { call_with_ptr_argsc(reinterpret_cast(p_base), method, p_args); } -template +template static _FORCE_INLINE_ void vc_convert_ptrcall(R (T::*method)(P...), void *p_base, const void **p_args, void *r_ret) { T converted(*reinterpret_cast(p_base)); call_with_ptr_args_ret(&converted, method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_convert_ptrcall(R (T::*method)(P...) const, void *p_base, const void **p_args, void *r_ret) { T converted(*reinterpret_cast(p_base)); call_with_ptr_args_retc(&converted, method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_convert_ptrcall(void (T::*method)(P...), void *p_base, const void **p_args, void *r_ret) { T converted(*reinterpret_cast(p_base)); call_with_ptr_args(&converted, method, p_args); } -template +template static _FORCE_INLINE_ void vc_convert_ptrcall(void (T::*method)(P...) const, void *p_base, const void **p_args, void *r_ret) { T converted(*reinterpret_cast(p_base)); call_with_ptr_argsc(&converted, method, p_args); } -template +template static _FORCE_INLINE_ int vc_get_argument_count(R (T::*method)(P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ int vc_get_argument_count(R (T::*method)(P...) const) { return sizeof...(P); } -template +template static _FORCE_INLINE_ int vc_get_argument_count(void (T::*method)(P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ int vc_get_argument_count(void (T::*method)(P...) const) { return sizeof...(P); } -template +template static _FORCE_INLINE_ int vc_get_argument_count(R (*method)(T *, P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ int vc_get_argument_count_static(R (*method)(P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type(R (T::*method)(P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type(R (T::*method)(P...) const, int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type(void (T::*method)(P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type(void (T::*method)(P...) const, int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type(R (*method)(T *, P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_argument_type_static(R (*method)(P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(R (T::*method)(P...)) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(R (T::*method)(P...) const) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(void (T::*method)(P...)) { return Variant::NIL; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(void (T::*method)(P...) const) { return Variant::NIL; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(R (*method)(P...)) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_return_type(void (*method)(P...)) { return Variant::NIL; } -template +template static _FORCE_INLINE_ bool vc_has_return_type(R (T::*method)(P...)) { return true; } -template +template static _FORCE_INLINE_ bool vc_has_return_type(R (T::*method)(P...) const) { return true; } -template +template static _FORCE_INLINE_ bool vc_has_return_type(void (T::*method)(P...)) { return false; } -template +template static _FORCE_INLINE_ bool vc_has_return_type(void (T::*method)(P...) const) { return false; } -template +template static _FORCE_INLINE_ bool vc_has_return_type_static(void (*method)(P...)) { return false; } -template +template static _FORCE_INLINE_ bool vc_has_return_type_static(R (*method)(P...)) { return true; } -template +template static _FORCE_INLINE_ bool vc_is_const(R (T::*method)(P...)) { return false; } -template +template static _FORCE_INLINE_ bool vc_is_const(R (T::*method)(P...) const) { return true; } -template +template static _FORCE_INLINE_ bool vc_is_const(void (T::*method)(P...)) { return false; } -template +template static _FORCE_INLINE_ bool vc_is_const(void (T::*method)(P...) const) { return true; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_base_type(R (T::*method)(P...)) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_base_type(R (T::*method)(P...) const) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_base_type(void (T::*method)(P...)) { return GetTypeInfo::VARIANT_TYPE; } -template +template static _FORCE_INLINE_ Variant::Type vc_get_base_type(void (T::*method)(P...) const) { return GetTypeInfo::VARIANT_TYPE; } @@ -450,12 +450,12 @@ static _FORCE_INLINE_ Variant::Type vc_get_base_type(void (T::*method)(P...) con } \ }; -template +template static _FORCE_INLINE_ void vc_static_ptrcall(R (*method)(P...), const void **p_args, void *r_ret) { call_with_ptr_args_static_method_ret(method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_static_ptrcall(void (*method)(P...), const void **p_args, void *r_ret) { call_with_ptr_args_static_method(method, p_args); } @@ -500,12 +500,12 @@ static _FORCE_INLINE_ void vc_static_ptrcall(void (*method)(P...), const void ** } \ }; -template +template static _FORCE_INLINE_ void vc_ptrcall(R (*method)(T *, P...), void *p_base, const void **p_args, void *r_ret) { call_with_ptr_args_static_retc(reinterpret_cast(p_base), method, p_args, r_ret); } -template +template static _FORCE_INLINE_ void vc_ptrcall(void (*method)(T *, P...), void *p_base, const void **p_args, void *r_ret) { call_with_ptr_args_static(reinterpret_cast(p_base), method, p_args); } @@ -1160,7 +1160,7 @@ typedef OAHashMap BuiltinMethodMap; static BuiltinMethodMap *builtin_method_info; static List *builtin_method_names; -template +template static void register_builtin_method(const Vector &p_argnames, const Vector &p_def_args) { StringName name = T::get_name(); diff --git a/core/variant/variant_construct.cpp b/core/variant/variant_construct.cpp index 3427950224c..b0ed49be5d1 100644 --- a/core/variant/variant_construct.cpp +++ b/core/variant/variant_construct.cpp @@ -41,7 +41,7 @@ struct VariantConstructData { static LocalVector construct_data[Variant::VARIANT_MAX]; -template +template static void add_constructor(const Vector &arg_names) { ERR_FAIL_COND_MSG(arg_names.size() != T::get_argument_count(), "Argument names size mismatch for " + Variant::get_type_name(T::get_base_type()) + "."); diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h index 36935907ae7..a93723a910f 100644 --- a/core/variant/variant_construct.h +++ b/core/variant/variant_construct.h @@ -42,7 +42,7 @@ #include "core/templates/local_vector.h" #include "core/templates/oa_hash_map.h" -template +template struct PtrConstruct {}; #define MAKE_PTRCONSTRUCT(m_type) \ @@ -99,7 +99,7 @@ MAKE_PTRCONSTRUCT(PackedVector3Array); MAKE_PTRCONSTRUCT(PackedColorArray); MAKE_PTRCONSTRUCT(Variant); -template +template class VariantConstructor { template static _FORCE_INLINE_ void construct_helper(T &base, const Variant **p_args, Callable::CallError &r_error, IndexSequence) { @@ -222,7 +222,7 @@ public: } }; -template +template class VariantConstructorFromString { public: static void construct(Variant &r_ret, const Variant **p_args, Callable::CallError &r_error) { @@ -470,7 +470,7 @@ public: } }; -template +template class VariantConstructorToArray { public: static void construct(Variant &r_ret, const Variant **p_args, Callable::CallError &r_error) { @@ -529,7 +529,7 @@ public: } }; -template +template class VariantConstructorFromArray { public: static void construct(Variant &r_ret, const Variant **p_args, Callable::CallError &r_error) { @@ -622,7 +622,7 @@ public: } }; -template +template class VariantConstructNoArgs { public: static void construct(Variant &r_ret, const Variant **p_args, Callable::CallError &r_error) { diff --git a/core/variant/variant_destruct.cpp b/core/variant/variant_destruct.cpp index 5308eba97d0..c7455d5117c 100644 --- a/core/variant/variant_destruct.cpp +++ b/core/variant/variant_destruct.cpp @@ -34,7 +34,7 @@ static Variant::PTRDestructor destruct_pointers[Variant::VARIANT_MAX] = { nullptr }; -template +template static void add_destructor() { destruct_pointers[T::get_base_type()] = T::ptr_destruct; } diff --git a/core/variant/variant_destruct.h b/core/variant/variant_destruct.h index c5f9c260c08..c496189c6de 100644 --- a/core/variant/variant_destruct.h +++ b/core/variant/variant_destruct.h @@ -35,7 +35,7 @@ #include "core/object/class_db.h" -template +template struct VariantDestruct {}; #define MAKE_PTRDESTRUCT(m_type) \ diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 79bed9be337..dbd4a6a7ad9 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -211,7 +211,7 @@ public: _FORCE_INLINE_ static const ObjectID get_object_id(const Variant *v) { return v->_get_obj().id; } - template + template _FORCE_INLINE_ static void init_generic(Variant *v) { v->type = GetTypeInfo::VARIANT_TYPE; } @@ -510,7 +510,7 @@ public: } }; -template +template struct VariantGetInternalPtr { }; @@ -797,7 +797,7 @@ struct VariantGetInternalPtr { static const PackedColorArray *get_ptr(const Variant *v) { return VariantInternal::get_color_array(v); } }; -template +template struct VariantInternalAccessor { }; @@ -830,13 +830,13 @@ struct VariantInternalAccessor { static _FORCE_INLINE_ void set(Variant *v, ObjectID p_value) { *VariantInternal::get_int(v) = p_value; } }; -template +template struct VariantInternalAccessor { static _FORCE_INLINE_ T *get(const Variant *v) { return const_cast(static_cast(*VariantInternal::get_object(v))); } static _FORCE_INLINE_ void set(Variant *v, const T *p_value) { VariantInternal::object_assign(v, p_value); } }; -template +template struct VariantInternalAccessor { static _FORCE_INLINE_ const T *get(const Variant *v) { return static_cast(*VariantInternal::get_object(v)); } static _FORCE_INLINE_ void set(Variant *v, const T *p_value) { VariantInternal::object_assign(v, p_value); } @@ -1091,7 +1091,7 @@ struct VariantInternalAccessor> { } }; -template +template struct VariantInitializer { }; @@ -1301,7 +1301,7 @@ struct VariantInitializer { static _FORCE_INLINE_ void init(Variant *v) { VariantInternal::init_object(v); } }; -template +template struct VariantDefaultInitializer { }; @@ -1490,7 +1490,7 @@ struct VariantDefaultInitializer { static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); } }; -template +template struct VariantTypeChanger { static _FORCE_INLINE_ void change(Variant *v) { if (v->get_type() != GetTypeInfo::VARIANT_TYPE || GetTypeInfo::VARIANT_TYPE >= Variant::PACKED_BYTE_ARRAY) { //second condition removed by optimizer @@ -1508,7 +1508,7 @@ struct VariantTypeChanger { } }; -template +template struct VariantTypeAdjust { _FORCE_INLINE_ static void adjust(Variant *r_ret) { VariantTypeChanger::type_t>::change(r_ret); @@ -1532,7 +1532,7 @@ struct VariantTypeAdjust { // GDExtension helpers. -template +template struct VariantTypeConstructor { _FORCE_INLINE_ static void variant_from_type(void *r_variant, void *p_value) { // r_variant is provided by caller as uninitialized memory diff --git a/core/variant/variant_op.cpp b/core/variant/variant_op.cpp index 4f9c38dc4c8..60ae09c6f1f 100644 --- a/core/variant/variant_op.cpp +++ b/core/variant/variant_op.cpp @@ -37,7 +37,7 @@ static VariantEvaluatorFunction operator_evaluator_table[Variant::OP_MAX][Varian static Variant::ValidatedOperatorEvaluator validated_operator_evaluator_table[Variant::OP_MAX][Variant::VARIANT_MAX][Variant::VARIANT_MAX]; static Variant::PTROperatorEvaluator ptr_operator_evaluator_table[Variant::OP_MAX][Variant::VARIANT_MAX][Variant::VARIANT_MAX]; -template +template void register_op(Variant::Operator p_op, Variant::Type p_type_a, Variant::Type p_type_b) { operator_return_type_table[p_op][p_type_a][p_type_b] = T::get_return_type(); operator_evaluator_table[p_op][p_type_a][p_type_b] = T::evaluate; diff --git a/core/variant/variant_op.h b/core/variant/variant_op.h index 17ad1268919..3142f49fc68 100644 --- a/core/variant/variant_op.h +++ b/core/variant/variant_op.h @@ -37,7 +37,7 @@ #include "core/debugger/engine_debugger.h" #include "core/object/class_db.h" -template +template class OperatorEvaluatorAdd { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -55,7 +55,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorSub { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -73,7 +73,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorMul { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -91,7 +91,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorPow { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -109,7 +109,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorXForm { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -127,7 +127,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorXFormInv { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -145,7 +145,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorDiv { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -163,7 +163,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorDivNZ { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -258,7 +258,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorMod { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -276,7 +276,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorModNZ { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -371,7 +371,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorNeg { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -388,7 +388,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorPos { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -405,7 +405,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorShiftLeft { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -431,7 +431,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorShiftRight { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -457,7 +457,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorBitOr { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -475,7 +475,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorBitAnd { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -493,7 +493,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorBitXor { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -511,7 +511,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorBitNeg { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -528,7 +528,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorEqual { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -599,7 +599,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorNotEqual { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -670,7 +670,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorLess { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -688,7 +688,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorLessEqual { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -706,7 +706,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorGreater { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -724,7 +724,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorGreaterEqual { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -742,7 +742,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorAnd { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -760,7 +760,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorOr { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -779,7 +779,7 @@ public: }; #define XOR_OP(m_a, m_b) (((m_a) || (m_b)) && !((m_a) && (m_b))) -template +template class OperatorEvaluatorXor { public: _FORCE_INLINE_ static bool xor_op(const A &a, const B &b) { @@ -800,7 +800,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorNot { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -857,7 +857,7 @@ public: static Variant::Type get_return_type() { return Variant::ARRAY; } }; -template +template class OperatorEvaluatorAppendArray { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -880,7 +880,7 @@ public: static Variant::Type get_return_type() { return GetTypeInfo>::VARIANT_TYPE; } }; -template +template class OperatorEvaluatorStringConcat { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -902,10 +902,10 @@ public: static Variant::Type get_return_type() { return Variant::STRING; } }; -template +template class OperatorEvaluatorStringFormat; -template +template class OperatorEvaluatorStringFormat { public: _FORCE_INLINE_ static String do_mod(const String &s, bool *r_valid) { @@ -933,7 +933,7 @@ public: static Variant::Type get_return_type() { return Variant::STRING; } }; -template +template class OperatorEvaluatorStringFormat { public: _FORCE_INLINE_ static String do_mod(const String &s, const Array &p_values, bool *r_valid) { @@ -958,7 +958,7 @@ public: static Variant::Type get_return_type() { return Variant::STRING; } }; -template +template class OperatorEvaluatorStringFormat { public: _FORCE_INLINE_ static String do_mod(const String &s, const Object *p_object, bool *r_valid) { @@ -986,7 +986,7 @@ public: static Variant::Type get_return_type() { return Variant::STRING; } }; -template +template class OperatorEvaluatorStringFormat { public: _FORCE_INLINE_ static String do_mod(const String &s, const T &p_value, bool *r_valid) { @@ -1317,10 +1317,10 @@ public: //// -template +template class OperatorEvaluatorInStringFind; -template +template class OperatorEvaluatorInStringFind { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -1341,7 +1341,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorInStringFind { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -1362,7 +1362,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorInArrayFind { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { @@ -1417,7 +1417,7 @@ public: static Variant::Type get_return_type() { return Variant::BOOL; } }; -template +template class OperatorEvaluatorInDictionaryHas { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index e35751fd61e..46c450d9f86 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -546,7 +546,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector &strings, } } -template +template Error VariantParser::_parse_construct(Stream *p_stream, Vector &r_construct, int &line, String &r_err_str) { Token token; get_token(p_stream, token, line, r_err_str); diff --git a/core/variant/variant_parser.h b/core/variant/variant_parser.h index 8505fff739a..18448100e01 100644 --- a/core/variant/variant_parser.h +++ b/core/variant/variant_parser.h @@ -139,7 +139,7 @@ public: private: static const char *tk_name[TK_MAX]; - template + template static Error _parse_construct(Stream *p_stream, Vector &r_construct, int &line, String &r_err_str); static Error _parse_enginecfg(Stream *p_stream, Vector &strings, int &line, String &r_err_str); static Error _parse_dictionary(Dictionary &object, Stream *p_stream, int &line, String &r_err_str, ResourceParser *p_res_parser = nullptr); diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index 20941b944fb..9d5ed22b1aa 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -45,7 +45,7 @@ struct VariantSetterGetterInfo { static LocalVector variant_setters_getters[Variant::VARIANT_MAX]; static LocalVector variant_setters_getters_names[Variant::VARIANT_MAX]; //one next to another to make it cache friendly -template +template static void register_member(Variant::Type p_type, const StringName &p_member) { VariantSetterGetterInfo sgi; sgi.setter = T::set; @@ -873,7 +873,7 @@ struct VariantIndexedSetterGetterInfo { static VariantIndexedSetterGetterInfo variant_indexed_setters_getters[Variant::VARIANT_MAX]; -template +template static void register_indexed_member(Variant::Type p_type) { VariantIndexedSetterGetterInfo &sgi = variant_indexed_setters_getters[p_type]; @@ -1094,7 +1094,7 @@ struct VariantKeyedSetterGetterInfo { static VariantKeyedSetterGetterInfo variant_keyed_setters_getters[Variant::VARIANT_MAX]; -template +template static void register_keyed_member(Variant::Type p_type) { VariantKeyedSetterGetterInfo &sgi = variant_keyed_setters_getters[p_type]; diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index 7136fa00c4b..916ba7aa2f6 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -1235,7 +1235,7 @@ bool VariantUtilityFunctions::is_same(const Variant &p_a, const Variant &p_b) { #define VCALL p_func(VariantCaster

::cast(*p_args[Is])...) #endif -template +template static _FORCE_INLINE_ void call_helperpr(R (*p_func)(P...), Variant *ret, const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; VCALLR; @@ -1243,51 +1243,51 @@ static _FORCE_INLINE_ void call_helperpr(R (*p_func)(P...), Variant *ret, const (void)r_error; } -template +template static _FORCE_INLINE_ void validated_call_helperpr(R (*p_func)(P...), Variant *ret, const Variant **p_args, IndexSequence) { *ret = p_func(VariantCaster

::cast(*p_args[Is])...); (void)p_args; } -template +template static _FORCE_INLINE_ void ptr_call_helperpr(R (*p_func)(P...), void *ret, const void **p_args, IndexSequence) { PtrToArg::encode(p_func(PtrToArg

::convert(p_args[Is])...), ret); (void)p_args; } -template +template static _FORCE_INLINE_ void call_helperr(R (*p_func)(P...), Variant *ret, const Variant **p_args, Callable::CallError &r_error) { call_helperpr(p_func, ret, p_args, r_error, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void validated_call_helperr(R (*p_func)(P...), Variant *ret, const Variant **p_args) { validated_call_helperpr(p_func, ret, p_args, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void ptr_call_helperr(R (*p_func)(P...), void *ret, const void **p_args) { ptr_call_helperpr(p_func, ret, p_args, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ int get_arg_count_helperr(R (*p_func)(P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ Variant::Type get_arg_type_helperr(R (*p_func)(P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type get_ret_type_helperr(R (*p_func)(P...)) { return GetTypeInfo::VARIANT_TYPE; } // WITHOUT RET -template +template static _FORCE_INLINE_ void call_helperp(void (*p_func)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence) { r_error.error = Callable::CallError::CALL_OK; VCALL; @@ -1295,44 +1295,44 @@ static _FORCE_INLINE_ void call_helperp(void (*p_func)(P...), const Variant **p_ (void)r_error; } -template +template static _FORCE_INLINE_ void validated_call_helperp(void (*p_func)(P...), const Variant **p_args, IndexSequence) { p_func(VariantCaster

::cast(*p_args[Is])...); (void)p_args; } -template +template static _FORCE_INLINE_ void ptr_call_helperp(void (*p_func)(P...), const void **p_args, IndexSequence) { p_func(PtrToArg

::convert(p_args[Is])...); (void)p_args; } -template +template static _FORCE_INLINE_ void call_helper(void (*p_func)(P...), const Variant **p_args, Callable::CallError &r_error) { call_helperp(p_func, p_args, r_error, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void validated_call_helper(void (*p_func)(P...), const Variant **p_args) { validated_call_helperp(p_func, p_args, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ void ptr_call_helper(void (*p_func)(P...), const void **p_args) { ptr_call_helperp(p_func, p_args, BuildIndexSequence{}); } -template +template static _FORCE_INLINE_ int get_arg_count_helper(void (*p_func)(P...)) { return sizeof...(P); } -template +template static _FORCE_INLINE_ Variant::Type get_arg_type_helper(void (*p_func)(P...), int p_arg) { return call_get_argument_type(p_arg); } -template +template static _FORCE_INLINE_ Variant::Type get_ret_type_helper(void (*p_func)(P...)) { return Variant::NIL; } @@ -1645,7 +1645,7 @@ struct VariantUtilityFunctionInfo { static OAHashMap utility_function_table; static List utility_function_name_table; -template +template static void register_utility_function(const String &p_name, const Vector &argnames) { String name = p_name; if (name.begins_with("_")) { diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index ce0876972a0..71cd1525204 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -144,7 +144,7 @@ private: RS::ViewportDebugDraw debug_draw = RS::VIEWPORT_DEBUG_DRAW_DISABLED; uint64_t scene_pass = 0; - template + template struct InstanceSort { float depth; T *instance = nullptr; diff --git a/editor/editor_data.h b/editor/editor_data.h index d71a2b3ed37..42b2d2ed0c9 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -300,7 +300,7 @@ public: void remove_node(Node *p_node); bool is_selected(Node *p_node) const; - template + template T *get_node_editor_data(Node *p_node) { if (!selection.has(p_node)) { return nullptr; diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index 003b98adf0a..39ffc2f71b6 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -117,7 +117,7 @@ class EditorHelpSearch::Runner : public RefCounted { }; int phase = 0; - template + template struct MemberMatch { T *doc = nullptr; bool name = false; diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 7c28818b2f0..f45a512b897 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -264,7 +264,7 @@ class EditorPlugins { static EditorPluginCreateFunc creation_funcs[MAX_CREATE_FUNCS]; static int creation_func_count; - template + template static EditorPlugin *creator() { return memnew(T); } @@ -276,7 +276,7 @@ public: return creation_funcs[p_idx](); } - template + template static void add_by_type() { add_create_func(creator); } diff --git a/editor/import/3d/resource_importer_scene.h b/editor/import/3d/resource_importer_scene.h index 2e682350bc8..17fa9ef0e25 100644 --- a/editor/import/3d/resource_importer_scene.h +++ b/editor/import/3d/resource_importer_scene.h @@ -303,10 +303,10 @@ public: ResourceImporterScene(bool p_animation_import = false, bool p_singleton = false); ~ResourceImporterScene(); - template + template static Vector> get_collision_shapes(const Ref &p_mesh, const M &p_options, float p_applied_root_scale); - template + template static Transform3D get_collision_shapes_transform(const M &p_options); }; @@ -319,7 +319,7 @@ public: virtual Node *import_scene(const String &p_path, uint32_t p_flags, const HashMap &p_options, List *r_missing_deps, Error *r_err = nullptr) override; }; -template +template Vector> ResourceImporterScene::get_collision_shapes(const Ref &p_mesh, const M &p_options, float p_applied_root_scale) { ERR_FAIL_COND_V(p_mesh.is_null(), Vector>()); ShapeType generate_shape_type = SHAPE_TYPE_DECOMPOSE_CONVEX; @@ -476,7 +476,7 @@ Vector> ResourceImporterScene::get_collision_shapes(const Ref>(); } -template +template Transform3D ResourceImporterScene::get_collision_shapes_transform(const M &p_options) { Transform3D transform; diff --git a/main/main.h b/main/main.h index 062af73d577..755c7d841ae 100644 --- a/main/main.h +++ b/main/main.h @@ -35,7 +35,7 @@ #include "core/os/thread.h" #include "core/typedefs.h" -template +template class Vector; class Main { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index aae45274e07..0584219e6f8 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -799,7 +799,7 @@ void GDScriptParser::parse_extends() { } } -template +template void GDScriptParser::parse_class_member(T *(GDScriptParser::*p_parse_function)(bool), AnnotationInfo::TargetKind p_target, const String &p_member_kind, bool p_is_static) { advance(); diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 45ab3f3e386..e2b6719dc0d 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -777,7 +777,7 @@ public: bool has_function(const StringName &p_name) const { return has_member(p_name) && members[members_indices[p_name]].type == Member::FUNCTION; } - template + template void add_member(T *p_member_node) { members_indices[p_member_node->identifier->name] = members.size(); members.push_back(Member(p_member_node)); @@ -1167,7 +1167,7 @@ public: bool has_local(const StringName &p_name) const; const Local &get_local(const StringName &p_name) const; - template + template void add_local(T *p_local, FunctionNode *p_source_function) { locals_indices[p_local->identifier->name] = locals.size(); locals.push_back(Local(p_local, p_source_function)); @@ -1418,7 +1418,7 @@ private: void reset_extents(Node *p_node, GDScriptTokenizer::Token p_token); void reset_extents(Node *p_node, Node *p_from); - template + template T *alloc_node() { T *node = memnew(T); @@ -1464,7 +1464,7 @@ private: void parse_class_name(); void parse_extends(); void parse_class_body(bool p_is_multiline); - template + template void parse_class_member(T *(GDScriptParser::*p_parse_function)(bool), AnnotationInfo::TargetKind p_target, const String &p_member_kind, bool p_is_static = false); SignalNode *parse_signal(bool p_is_static); EnumNode *parse_enum(bool p_is_static); diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index eece6afdccb..b592b3e0330 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5483,7 +5483,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref p_state, const GL } } -template +template struct SceneFormatImporterGLTFInterpolate { T lerp(const T &a, const T &b, float c) const { return a + (b - a) * c; @@ -5533,7 +5533,7 @@ struct SceneFormatImporterGLTFInterpolate { } }; -template +template T GLTFDocument::_interpolate_track(const Vector &p_times, const Vector &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) { ERR_FAIL_COND_V(p_values.is_empty(), T()); if (p_times.size() != (p_values.size() / (p_interp == GLTFAnimation::INTERP_CUBIC_SPLINE ? 3 : 1))) { diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index 04de2ac5f8e..0fd2113e07e 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -216,7 +216,7 @@ private: Light3D *_generate_light(Ref p_state, const GLTFNodeIndex p_node_index); Node3D *_generate_spatial(Ref p_state, const GLTFNodeIndex p_node_index); void _assign_node_names(Ref p_state); - template + template T _interpolate_track(const Vector &p_times, const Vector &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp); diff --git a/modules/gltf/gltf_template_convert.h b/modules/gltf/gltf_template_convert.h index 2743cd8a9ba..46f185867ae 100644 --- a/modules/gltf/gltf_template_convert.h +++ b/modules/gltf/gltf_template_convert.h @@ -37,7 +37,7 @@ #include "core/variant/typed_array.h" namespace GLTFTemplateConvert { -template +template static Array to_array(const Vector &p_inp) { Array ret; for (int i = 0; i < p_inp.size(); i++) { @@ -46,7 +46,7 @@ static Array to_array(const Vector &p_inp) { return ret; } -template +template static TypedArray to_array(const HashSet &p_inp) { TypedArray ret; typename HashSet::Iterator elem = p_inp.begin(); @@ -57,7 +57,7 @@ static TypedArray to_array(const HashSet &p_inp) { return ret; } -template +template static void set_from_array(Vector &r_out, const Array &p_inp) { r_out.clear(); for (int i = 0; i < p_inp.size(); i++) { @@ -65,7 +65,7 @@ static void set_from_array(Vector &r_out, const Array &p_inp) { } } -template +template static void set_from_array(HashSet &r_out, const TypedArray &p_inp) { r_out.clear(); for (int i = 0; i < p_inp.size(); i++) { @@ -73,7 +73,7 @@ static void set_from_array(HashSet &r_out, const TypedArray &p_inp) { } } -template +template static Dictionary to_dictionary(const HashMap &p_inp) { Dictionary ret; for (const KeyValue &E : p_inp) { @@ -82,7 +82,7 @@ static Dictionary to_dictionary(const HashMap &p_inp) { return ret; } -template +template static void set_from_dictionary(HashMap &r_out, const Dictionary &p_inp) { r_out.clear(); Array keys = p_inp.keys(); diff --git a/modules/gltf/structures/gltf_animation.h b/modules/gltf/structures/gltf_animation.h index 7f769752c20..afc97848953 100644 --- a/modules/gltf/structures/gltf_animation.h +++ b/modules/gltf/structures/gltf_animation.h @@ -47,7 +47,7 @@ public: INTERP_CUBIC_SPLINE, }; - template + template struct Channel { Interpolation interpolation = INTERP_LINEAR; Vector times; diff --git a/modules/multiplayer/scene_replication_interface.h b/modules/multiplayer/scene_replication_interface.h index 31211bb108b..cb582a2cafc 100644 --- a/modules/multiplayer/scene_replication_interface.h +++ b/modules/multiplayer/scene_replication_interface.h @@ -112,7 +112,7 @@ private: Error _update_spawn_visibility(int p_peer, const ObjectID &p_oid); void _free_remotes(const PeerInfo &p_info); - template + template static T *get_id_as(const ObjectID &p_id) { return p_id.is_valid() ? Object::cast_to(ObjectDB::get_instance(p_id)) : nullptr; } diff --git a/modules/websocket/packet_buffer.h b/modules/websocket/packet_buffer.h index 25e1b1f15a4..f98ee12ef9a 100644 --- a/modules/websocket/packet_buffer.h +++ b/modules/websocket/packet_buffer.h @@ -33,7 +33,7 @@ #include "core/templates/ring_buffer.h" -template +template class PacketBuffer { private: typedef struct { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 7e7d23a2a84..351cb32c9b3 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -69,7 +69,7 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x4 #endif -template +template class ComAutoreleaseRef { public: T *reference = nullptr; diff --git a/scene/main/node.h b/scene/main/node.h index 7cc0f7b370b..57a7278e736 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -57,7 +57,7 @@ protected: MTFlag() : mt{} {} }; - template + template union MTNumeric { SafeNumeric mt; T st; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 079101f679d..cd530f100ef 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1041,7 +1041,7 @@ bool Animation::track_get_interpolation_loop_wrap(int p_track) const { return tracks[p_track]->loop_wrap; } -template +template int Animation::_insert(double p_time, T &p_keys, const V &p_value) { int idx = p_keys.size(); @@ -1065,7 +1065,7 @@ int Animation::_insert(double p_time, T &p_keys, const V &p_value) { return -1; } -template +template void Animation::_clear(T &p_keys) { p_keys.clear(); } @@ -2331,7 +2331,7 @@ void Animation::track_set_key_transition(int p_track, int p_key_idx, real_t p_tr emit_changed(); } -template +template int Animation::_find(const Vector &p_keys, double p_time, bool p_backward, bool p_limit) const { int len = p_keys.size(); if (len == 0) { @@ -2451,7 +2451,7 @@ Variant Animation::_cubic_interpolate_angle_in_time(const Variant &p_pre_a, cons return _cubic_interpolate_in_time(p_pre_a, p_a, p_b, p_post_b, p_c, p_pre_a_t, p_b_t, p_post_b_t); } -template +template T Animation::_interpolate(const Vector> &p_keys, double p_time, InterpolationType p_interp, bool p_loop_wrap, bool *p_ok, bool p_backward) const { int len = _find(p_keys, length) + 1; // try to find last key (there may be more past the end) @@ -2693,7 +2693,7 @@ Animation::UpdateMode Animation::value_track_get_update_mode(int p_track) const return vt->update_mode; } -template +template void Animation::_track_get_key_indices_in_range(const Vector &p_array, double from_time, double to_time, List *p_indices, bool p_is_backward) const { int len = p_array.size(); if (len == 0) { diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 5b27958005b..d3df8d03e5f 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -120,7 +120,7 @@ private: }; // Transform key holds either Vector3 or Quaternion. - template + template struct TKey : public Key { T value; }; @@ -235,13 +235,13 @@ private: Vector tracks; - template + template void _clear(T &p_keys); - template + template int _insert(double p_time, T &p_keys, const V &p_value); - template + template inline int _find(const Vector &p_keys, double p_time, bool p_backward = false, bool p_limit = false) const; @@ -257,10 +257,10 @@ private: _FORCE_INLINE_ real_t _cubic_interpolate_in_time(const real_t &p_pre_a, const real_t &p_a, const real_t &p_b, const real_t &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const; _FORCE_INLINE_ Variant _cubic_interpolate_angle_in_time(const Variant &p_pre_a, const Variant &p_a, const Variant &p_b, const Variant &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const; - template + template _FORCE_INLINE_ T _interpolate(const Vector> &p_keys, double p_time, InterpolationType p_interp, bool p_loop_wrap, bool *p_ok, bool p_backward = false) const; - template + template _FORCE_INLINE_ void _track_get_key_indices_in_range(const Vector &p_array, double from_time, double to_time, List *p_indices, bool p_is_backward) const; double length = 1.0; diff --git a/scene/resources/audio_stream_wav.cpp b/scene/resources/audio_stream_wav.cpp index b6e6493b682..0185c6ef855 100644 --- a/scene/resources/audio_stream_wav.cpp +++ b/scene/resources/audio_stream_wav.cpp @@ -86,7 +86,7 @@ void AudioStreamPlaybackWAV::seek(double p_time) { offset = uint64_t(p_time * base->mix_rate) << MIX_FRAC_BITS; } -template +template void AudioStreamPlaybackWAV::do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &p_offset, int32_t &p_increment, uint32_t p_amount, IMA_ADPCM_State *p_ima_adpcm) { // this function will be compiled branchless by any decent compiler diff --git a/scene/resources/audio_stream_wav.h b/scene/resources/audio_stream_wav.h index f150a17d219..959d1ceca0b 100644 --- a/scene/resources/audio_stream_wav.h +++ b/scene/resources/audio_stream_wav.h @@ -60,7 +60,7 @@ class AudioStreamPlaybackWAV : public AudioStreamPlayback { friend class AudioStreamWAV; Ref base; - template + template void do_resample(const Depth *p_src, AudioFrame *p_dst, int64_t &p_offset, int32_t &p_increment, uint32_t p_amount, IMA_ADPCM_State *p_ima_adpcm); public: diff --git a/servers/camera_server.h b/servers/camera_server.h index 4e0b75fbf61..e9bcd771d2e 100644 --- a/servers/camera_server.h +++ b/servers/camera_server.h @@ -71,7 +71,7 @@ protected: static void _bind_methods(); - template + template static CameraServer *_create_builtin() { return memnew(T); } @@ -79,7 +79,7 @@ protected: public: static CameraServer *get_singleton(); - template + template static void make_default() { create_func = _create_builtin; } diff --git a/servers/physics_2d/godot_broad_phase_2d_bvh.h b/servers/physics_2d/godot_broad_phase_2d_bvh.h index 36fd1223b0f..6c1fae5cb22 100644 --- a/servers/physics_2d/godot_broad_phase_2d_bvh.h +++ b/servers/physics_2d/godot_broad_phase_2d_bvh.h @@ -38,7 +38,7 @@ #include "core/math/vector2.h" class GodotBroadPhase2DBVH : public GodotBroadPhase2D { - template + template class UserPairTestFunction { public: static bool user_pair_check(const T *p_a, const T *p_b) { @@ -47,7 +47,7 @@ class GodotBroadPhase2DBVH : public GodotBroadPhase2D { } }; - template + template class UserCullTestFunction { public: static bool user_cull_check(const T *p_a, const T *p_b) { diff --git a/servers/physics_2d/godot_collision_solver_2d_sat.cpp b/servers/physics_2d/godot_collision_solver_2d_sat.cpp index c85fdc592a7..daa9982b2ee 100644 --- a/servers/physics_2d/godot_collision_solver_2d_sat.cpp +++ b/servers/physics_2d/godot_collision_solver_2d_sat.cpp @@ -171,7 +171,7 @@ static void _generate_contacts_from_supports(const Vector2 *p_points_A, int p_po contacts_func(points_A, pointcount_A, points_B, pointcount_B, p_collector); } -template +template class SeparatorAxisTest2D { const ShapeA *shape_A = nullptr; const ShapeB *shape_B = nullptr; diff --git a/servers/physics_3d/godot_broad_phase_3d_bvh.h b/servers/physics_3d/godot_broad_phase_3d_bvh.h index 6279658ec41..63968dea645 100644 --- a/servers/physics_3d/godot_broad_phase_3d_bvh.h +++ b/servers/physics_3d/godot_broad_phase_3d_bvh.h @@ -36,7 +36,7 @@ #include "core/math/bvh.h" class GodotBroadPhase3DBVH : public GodotBroadPhase3D { - template + template class UserPairTestFunction { public: static bool user_pair_check(const T *p_a, const T *p_b) { @@ -45,7 +45,7 @@ class GodotBroadPhase3DBVH : public GodotBroadPhase3D { } }; - template + template class UserCullTestFunction { public: static bool user_cull_check(const T *p_a, const T *p_b) { diff --git a/servers/physics_3d/godot_collision_solver_3d_sat.cpp b/servers/physics_3d/godot_collision_solver_3d_sat.cpp index 3aa2f256c18..beaa30eb843 100644 --- a/servers/physics_3d/godot_collision_solver_3d_sat.cpp +++ b/servers/physics_3d/godot_collision_solver_3d_sat.cpp @@ -612,7 +612,7 @@ static void _generate_contacts_from_supports(const Vector3 *p_points_A, int p_po contacts_func(points_A, pointcount_A, points_B, pointcount_B, p_callback); } -template +template class SeparatorAxisTest { const ShapeA *shape_A = nullptr; const ShapeB *shape_B = nullptr; diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index cd38aa05f3a..8e342375f86 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -2162,7 +2162,7 @@ bool RendererCanvasCull::free(RID p_rid) { return true; } -template +template void RendererCanvasCull::_free_rids(T &p_owner, const char *p_type) { List owned; p_owner.get_owned_list(&owned); diff --git a/servers/rendering/renderer_canvas_cull.h b/servers/rendering/renderer_canvas_cull.h index 8d40c2fbaa7..d733a7bed2c 100644 --- a/servers/rendering/renderer_canvas_cull.h +++ b/servers/rendering/renderer_canvas_cull.h @@ -170,7 +170,7 @@ public: RID_Owner canvas_item_owner; RID_Owner canvas_light_owner; - template + template void _free_rids(T &p_owner, const char *p_type); bool disable_scale; diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index fd31a40a3ef..cf8f6dcb2ee 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -366,7 +366,7 @@ public: mutable double debug_redraw_time = 0; #endif - template + template T *alloc_command() { T *command = nullptr; if (commands == nullptr) { diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index dc48ddbd565..7dfff0b76f3 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -5182,7 +5182,7 @@ void RenderingDevice::_save_pipeline_cache(void *p_data) { } } -template +template void RenderingDevice::_free_rids(T &p_owner, const char *p_type) { List owned; p_owner.get_owned_list(&owned); diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 8c88c08950a..9a898a2fcae 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -1294,7 +1294,7 @@ private: void _stall_for_previous_frames(); void _flush_and_stall_for_all_frames(); - template + template void _free_rids(T &p_owner, const char *p_type); #ifdef DEV_ENABLED diff --git a/servers/rendering/rendering_device_driver.h b/servers/rendering/rendering_device_driver.h index ee33dc103cb..09a04129419 100644 --- a/servers/rendering/rendering_device_driver.h +++ b/servers/rendering/rendering_device_driver.h @@ -56,7 +56,7 @@ // This may one day be used in Godot for interoperability between C arrays, Vector and LocalVector. // (See https://github.com/godotengine/godot-proposals/issues/5144.) -template +template class VectorView { const T *_ptr = nullptr; const uint32_t _size = 0; @@ -97,20 +97,20 @@ public: #define ENUM_MEMBERS_EQUAL(m_a, m_b) ((int64_t)m_a == (int64_t)m_b) // This helps using a single paged allocator for many resource types. -template +template struct VersatileResourceTemplate { static constexpr size_t RESOURCE_SIZES[] = { sizeof(RESOURCE_TYPES)... }; static constexpr size_t MAX_RESOURCE_SIZE = std::max_element(RESOURCE_SIZES, RESOURCE_SIZES + sizeof...(RESOURCE_TYPES))[0]; uint8_t data[MAX_RESOURCE_SIZE]; - template + template static T *allocate(PagedAllocator &p_allocator) { T *obj = (T *)p_allocator.alloc(); memnew_placement(obj, T); return obj; } - template + template static void free(PagedAllocator &p_allocator, T *p_object) { p_object->~T(); p_allocator.free((VersatileResourceTemplate *)p_object); diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 737545b8caf..816a202b50c 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -383,7 +383,7 @@ public: virtual ~Node() {} }; - template + template T *alloc_node() { T *node = memnew(T); node->next = nodes; diff --git a/servers/rendering/storage/variant_converters.h b/servers/rendering/storage/variant_converters.h index 6e3c07237ed..7dbdb0f5176 100644 --- a/servers/rendering/storage/variant_converters.h +++ b/servers/rendering/storage/variant_converters.h @@ -242,10 +242,10 @@ inline bool is_convertible_array(Variant::Type type) { type == Variant::PACKED_COLOR_ARRAY; } -template +template inline constexpr bool is_vector_type_v = false; -template +template inline constexpr bool is_vector_type_v> = true; template