Added a new helper method to MLPPVector.

This commit is contained in:
Relintai 2023-12-29 13:31:27 +01:00
parent abaf8ad1f2
commit 701749b2e5

View File

@ -14,13 +14,13 @@
#include "core/object/resource.h" #include "core/object/resource.h"
#else #else
#include "core/containers/vector.h"
#include "core/defs.h" #include "core/defs.h"
#include "core/math_funcs.h" #include "core/math_funcs.h"
#include "core/pool_arrays.h"
#include "core/containers/vector.h"
#include "core/os/memory.h" #include "core/os/memory.h"
#include "core/pool_arrays.h"
#include "gen/resource.h" #include "gen/resource.h"
@ -93,6 +93,16 @@ public:
_data[p_index] = p_val; _data[p_index] = p_val;
} }
_FORCE_INLINE_ const real_t &element_get_ref(int p_index) const {
CRASH_BAD_INDEX(p_index, _size);
return _data[p_index];
}
_FORCE_INLINE_ real_t &element_get_ref(int p_index) {
CRASH_BAD_INDEX(p_index, _size);
return _data[p_index];
}
void fill(real_t p_val); void fill(real_t p_val);
void insert(int p_pos, real_t p_val); void insert(int p_pos, real_t p_val);