diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2018-07-23 16:04:32 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-23 16:04:32 -0300 |
| commit | dc976cac57bc04de6cdace8d582a48f07afa0a7b (patch) | |
| tree | edcabc27a46b50ce492f02fc99ee96b37d32f667 /core | |
| parent | ec85fd554b0ae9861fddabbda1667a93bdd52450 (diff) | |
| parent | 17ebbfb56de980c5529c8a02a12141dd7bb766c8 (diff) | |
Merge pull request #12678 from AndreaCatania/soft
Soft body
Diffstat (limited to 'core')
| -rw-r--r-- | core/vector.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/vector.h b/core/vector.h index f586471e27..c026448ddd 100644 --- a/core/vector.h +++ b/core/vector.h @@ -152,6 +152,8 @@ public: Error insert(int p_pos, const T &p_val); + void append_array(const Vector<T> &p_other); + template <class C> void sort_custom() { @@ -408,6 +410,17 @@ Error Vector<T>::insert(int p_pos, const T &p_val) { } template <class T> +void Vector<T>::append_array(const Vector<T> &p_other) { + const int ds = p_other.size(); + if (ds == 0) + return; + const int bs = size(); + resize(bs + ds); + for (int i = 0; i < ds; ++i) + operator[](bs + i) = p_other[i]; +} + +template <class T> Vector<T>::Vector(const Vector &p_from) { _ptr = NULL; |