20 assert(a_pos >= 0 && a_pos <
size());
26 assert(a_pos >= 0 && a_pos <
size());
35 [[nodiscard]]
const T*
data()
const
90 [[nodiscard]]
bool empty()
const
108 size_type newSize = a_newCap *
sizeof(T);
109 T* newMem =
static_cast<T*
>(allocator->BufAlloc(newSize));
112 std::memcpy(newMem,
_data, oldSize);
114 allocator->BufFree(
_data, oldSize);
139 if (a_count ==
size()) {
143 if (a_count <
size()) {
151 T* newMem =
static_cast<T*
>(allocator->BufAlloc(newSize));
154 std::memcpy(newMem,
_data, (std::min)(oldSize, newSize));
156 allocator->BufFree(
_data, oldSize);
160 if (a_count >
size()) {
162 new (&newMem[i]) T{};
187 template <
class T,
class Allocator =
void>
194 template <
class T, std::
size_t N,
class Allocator =
void>
iterator begin()
Definition hkArray.h:60
void resize(size_type a_count)
Definition hkArray.h:136
const_iterator cbegin() const
Definition hkArray.h:70
std::int32_t _size
Definition hkArray.h:182
@ kFlagMask
Definition hkArray.h:175
@ kDontDeallocFlag
Definition hkArray.h:176
@ kCapacityMask
Definition hkArray.h:174
const T * data() const
Definition hkArray.h:35
const_reference back() const
Definition hkArray.h:55
T * data()
Definition hkArray.h:30
bool empty() const
Definition hkArray.h:90
std::int32_t _capacityAndFlags
Definition hkArray.h:183
value_type & reference
Definition hkArray.h:13
T value_type
Definition hkArray.h:11
const_reference operator[](size_type a_pos) const
Definition hkArray.h:24
const T * const_iterator
Definition hkArray.h:16
void reserve(size_type a_newCap)
Definition hkArray.h:100
reference back()
Definition hkArray.h:50
reference operator[](size_type a_pos)
Definition hkArray.h:18
const_iterator begin() const
Definition hkArray.h:65
const_iterator end() const
Definition hkArray.h:80
size_type size() const noexcept
Definition hkArray.h:95
T * _data
Definition hkArray.h:181
void push_back(const T &a_value)
Definition hkArray.h:128
const_reference front() const
Definition hkArray.h:45
static constexpr float GROWTH_FACTOR
Definition hkArray.h:179
reference front()
Definition hkArray.h:40
iterator end()
Definition hkArray.h:75
std::int32_t size_type
Definition hkArray.h:12
const value_type & const_reference
Definition hkArray.h:14
const_iterator cend() const
Definition hkArray.h:85
size_type capacity() const noexcept
Definition hkArray.h:123
T * iterator
Definition hkArray.h:15
T storage[N]
Definition hkArray.h:198
Definition AbsorbEffect.h:6
static Allocator * GetSingleton()
Definition hkContainerAllocators.h:25