7 #elif __has_include(<alloca.h>)
35 auto begin()
const {
return m_ptr; }
36 auto end()
const {
return m_ptr + m_size; }
38 auto size()
const {
return m_size; }
40 T& operator[](std::size_t pos)
const
44 return *(m_ptr + pos);
48 #define make_dynarray(Type, Count) \
49 score::dynarray_impl<Type> \
51 (Type*)alloca(sizeof(Type) * Count), Count \
60 std::size_t m_capacity{};
65 using const_iterator = T*;
69 , m_capacity{capacity}
78 iterator begin()
const {
return m_ptr; }
79 iterator end()
const {
return m_ptr + m_size; }
81 std::size_t size()
const {
return m_size; }
83 T& operator[](std::size_t pos)
const
87 return *(m_ptr + pos);
92 assert(m_size + 1 <= m_capacity);
93 *(m_ptr + m_size) = std::move(t);
97 void push_back(
const T& t)
99 assert(m_size + 1 <= m_capacity);
100 *(m_ptr + m_size) = t;
105 #define make_dynvector(Type, Count) \
106 score::dynvector_impl<Type> \
108 (Type*)alloca(sizeof(Type) * Count), Count \
Definition: ArrayView.hpp:17
Definition: ArrayView.hpp:56
Base toolkit upon which the software is built.
Definition: Application.cpp:90