// // This is example code from Chapter 17.5 "Destructors" of // "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup // //------------------------------------------------------------------------------ // a very simplified vector of doubles: class vector { int sz; // the size double* elem; // a pointer to the elements public: vector(int s) // constructor :sz{s}, // initialize sz elem{new double[s]} // initialize elem { for (int i=0; i