After reading the item of the book, I am trying to implement it. However, there are only four lines of code in the book (lines with comment // book). I added other members. Is the following code a correct class declaration for the item?
Arrays with the new operator require that the type/class of the elements in the array has default constructor. Array1D has a non-default (Array1D(unsigned in_1DnumElem)) constructor and mere presence of user-defined constructor suppresses the compiler generated implicit one. The result is that you need to implement default constructor with the prototype Array1D() or to provide default value for the in_1DnumElem argument in the existing constructor.