1 #ifndef CommonTools_Utils_DynArray_H
2 #define CommonTools_Utils_DynArray_H
17 explicit DynArray(
unsigned char * storage) :
a((
T*)(storage)),
s(0){}
19 DynArray(
unsigned char * storage,
unsigned int isize) :
a((
T*)(storage)),
s(isize){
22 DynArray(
unsigned char * storage,
unsigned int isize,
T const& it) :
a((
T*)(storage)),
s(isize){
44 unsigned int size()
const {
return s;}
57 #define unInitDynArray(T,n,x) alignas(alignof(T)) unsigned char x ## _storage[sizeof(T)*n]; DynArray<T> x(x ## _storage)
58 #define declareDynArray(T,n,x) alignas(alignof(T)) unsigned char x ## _storage[sizeof(T)*n]; DynArray<T> x(x ## _storage,n)
59 #define initDynArray(T,n,x,i) alignas(alignof(T)) unsigned char x ## _storage[sizeof(T)*n]; DynArray<T> x(x ## _storage,n,i)
62 #endif // CommonTools_Utils_DynArray_H
DynArray & operator=(DynArray &&other)
DynArray(DynArray &&other)
T const & const_reference
T const & operator[](unsigned int i) const
DynArray & operator=(DynArray const &)=delete
DynArray(unsigned char *storage, unsigned int isize, T const &it)
DynArray(unsigned char *storage, unsigned int isize)
void push_back(T const &t)
DynArray(unsigned char *storage)
unsigned int size() const
T & operator[](unsigned int i)