45 for (
int ir = 0; ir <
nr; ++ir)
46 this->ptr_2D[ir] = &this->
ptr_1D[ir *
nc];
52 delete[] this->ptr_2D;
53 delete[] this->ptr_1D;
58 : ptr_2D(other.ptr_2D),
63 other.ptr_2D =
nullptr;
64 other.ptr_1D =
nullptr;
74 delete[] this->ptr_2D;
75 delete[] this->ptr_1D;
76 this->ptr_2D = other.
ptr_2D;
77 this->ptr_1D = other.ptr_1D;
80 other.ptr_2D =
nullptr;
81 other.ptr_1D =
nullptr;
Array_Pool is a class designed for dynamically allocating a two-dimensional array with all its elemen...
Definition array_pool.h:16
T * operator[](const int ir) const
Definition array_pool.h:30
~Array_Pool()
Definition array_pool.h:50
T * ptr_1D
Definition array_pool.h:33
Array_Pool(const int nr_in, const int nc_in)
Definition array_pool.h:39
Array_Pool(const Array_Pool< T > &other)=delete
T * get_ptr_1D() const
Definition array_pool.h:27
int get_nc() const
Definition array_pool.h:29
int nc
Definition array_pool.h:35
T ** ptr_2D
Definition array_pool.h:32
Array_Pool & operator=(Array_Pool< T > &&other)
Definition array_pool.h:70
Array_Pool & operator=(const Array_Pool &other)=delete
int get_nr() const
Definition array_pool.h:28
Array_Pool(Array_Pool< T > &&other)
Definition array_pool.h:57
int nr
Definition array_pool.h:34
T ** get_ptr_2D() const
Definition array_pool.h:26
#define T
Definition exp.cpp:237
Definition array_pool.h:6