diff options
author | David Snopek <dsnopek@gmail.com> | 2024-04-02 14:30:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-02 14:30:01 -0500 |
commit | 44d78ec8816e57fdd0c06812d31c09a25b97d6e8 (patch) | |
tree | 502a26499fd129c80619ed290cd0125b327055f1 /include/godot_cpp/templates/vector.hpp | |
parent | a62f633cebee4b36356dc903d00670733cd28fb1 (diff) | |
parent | 87f5fb06912d19b3ff3ba80b747fcea3023a1ed5 (diff) | |
download | redot-cpp-44d78ec8816e57fdd0c06812d31c09a25b97d6e8.tar.gz |
Merge pull request #1409 from Repiteo/class-to-typename
Enforce template syntax `typename` over `class`
Diffstat (limited to 'include/godot_cpp/templates/vector.hpp')
-rw-r--r-- | include/godot_cpp/templates/vector.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/godot_cpp/templates/vector.hpp b/include/godot_cpp/templates/vector.hpp index 05b7184..aaa84f3 100644 --- a/include/godot_cpp/templates/vector.hpp +++ b/include/godot_cpp/templates/vector.hpp @@ -47,7 +47,7 @@ namespace godot { -template <class T> +template <typename T> class VectorWriteProxy { public: _FORCE_INLINE_ T &operator[](typename CowData<T>::Size p_index) { @@ -57,7 +57,7 @@ public: } }; -template <class T> +template <typename T> class Vector { friend class VectorWriteProxy<T>; @@ -110,7 +110,7 @@ public: sort_custom<_DefaultComparator<T>>(); } - template <class Comparator, bool Validate = SORT_ARRAY_VALIDATE_ENABLED, class... Args> + template <typename Comparator, bool Validate = SORT_ARRAY_VALIDATE_ENABLED, typename... Args> void sort_custom(Args &&...args) { Size len = _cowdata.size(); if (len == 0) { @@ -126,7 +126,7 @@ public: return bsearch_custom<_DefaultComparator<T>>(p_value, p_before); } - template <class Comparator, class Value, class... Args> + template <typename Comparator, typename Value, typename... Args> Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) { SearchArray<T, Comparator> search{ args... }; return search.bisect(ptrw(), size(), p_value, p_before); @@ -293,7 +293,7 @@ public: _FORCE_INLINE_ ~Vector() {} }; -template <class T> +template <typename T> void Vector<T>::reverse() { for (Size i = 0; i < size() / 2; i++) { T *p = ptrw(); @@ -301,7 +301,7 @@ void Vector<T>::reverse() { } } -template <class T> +template <typename T> void Vector<T>::append_array(Vector<T> p_other) { const Size ds = p_other.size(); if (ds == 0) { @@ -314,7 +314,7 @@ void Vector<T>::append_array(Vector<T> p_other) { } } -template <class T> +template <typename T> bool Vector<T>::push_back(T p_elem) { Error err = resize(size() + 1); ERR_FAIL_COND_V(err, true); @@ -323,7 +323,7 @@ bool Vector<T>::push_back(T p_elem) { return false; } -template <class T> +template <typename T> void Vector<T>::fill(T p_elem) { T *p = ptrw(); for (Size i = 0; i < size(); i++) { |