16 mObjects(bound0 * bound1),
19 SetPointers(mObjects.data());
47Array2<T>& Array2<T>::operator=(Array2
const& other)
50 mObjects = other.mObjects;
58 *
this = std::move(other);
62Array2<T>& Array2<T>::operator=(Array2&& other)
65 mObjects = std::move(other.mObjects);
70template <
typename T>
inline
71size_t Array2<T>::GetBound0()
const
76template <
typename T>
inline
77size_t Array2<T>::GetBound1()
const
82template <
typename T>
inline
83T
const* Array2<T>::operator[] (
int row)
const
85 return mIndirect1[row];
88template <
typename T>
inline
89T* Array2<T>::operator[] (
int row)
91 return mIndirect1[row];
95void Array2<T>::SetPointers(T* objects)
97 for (
size_t i1 = 0; i1 < mBound1; ++i1)
99 size_t j0 = mBound0 * i1;
100 mIndirect1[i1] = &objects[j0];
105void Array2<T>::SetPointers(Array2
const& other)
107 mBound0 = other.mBound0;
108 mBound1 = other.mBound1;
109 mIndirect1.resize(mBound1);
114 SetPointers(mObjects.data());
116 else if (mIndirect1.size() > 0)
119 SetPointers(other.mIndirect1[0]);
The Array2 class represents a 2-dimensional array that minimizes the number of new and delete calls....
Array2()
Default constructor.