template class Stack { private: T _v[10]; int _len=10; int used=0; public: void push(T const&); T pop(); T top() const; bool empty() const; protected: // void expand() // { // _len = _len * 2; // T *p = new T[_len]; // for (int i = 0; i <= _used; i++) // p[i] = _v[i]; // delete[] _v; // _v = p; // } // template // void Vec::shrink() // { // if (((double)_used / (double)_len) >= 0.25) // return; // _len = _len >> 1; // T *p = new T[_len]; // for (int i = 0; i <= _used; i++) // p[i] = _v[i]; // delete[] _v; // _v = p; // } };