10 static_assert((!std::is_reference<T>::value && !std::is_array<T>::value),
11 "cLazyArray<T>: T must be a value type");
12 static_assert(std::is_default_constructible<T>::value,
13 "cLazyArray<T>: T must be default constructible");
41 m_Array{ std::move(a_Other.m_Array) },
54 m_Array = std::move(a_Other.m_Array);
93 static_assert(!std::is_const<
typename decltype(
m_Array)::element_type>::value,
"");
95 return const_cast<T *
>(const_this->
data());
100 std::swap(
m_Array, a_Other.m_Array);
101 std::swap(
m_Size, a_Other.m_Size);
117 return data()[a_Idx];
121 static const T DefaultValue;
A dynamic array that defers allocation to the first modifying access.
friend void swap(cLazyArray &a_Lhs, cLazyArray &a_Rhs) noexcept
const T & const_reference
const_iterator cbegin() const
const_iterator end() const
bool IsStorageAllocated() const noexcept
Returns true if the array has already been allocated.
const_iterator cend() const
void swap(cLazyArray &a_Other) noexcept
T & operator[](size_type a_Idx)
cLazyArray(const cLazyArray &a_Other)
cLazyArray(cLazyArray &&a_Other) noexcept
const T & GetAt(size_type a_Idx) const
A const view of an element of the array.
cLazyArray & operator=(const cLazyArray &a_Other)
cLazyArray(size_type a_Size) noexcept
const_pointer const_iterator
const_iterator begin() const
size_type size() const noexcept
std::unique_ptr< T[]> m_Array