2// ---------------------------------------------------------------------------
8 * Simplified stack class.
9 * It is intended to be used as a replacement of the standard class where
10 * full functionality of <stack> is not required, but it is essential
11 * to have highly portable and effective code.
13 * This file should be used exclusively inside *.cc files.
14 * Usage inside header files can result to a clash with standard <stack>.
16 * @author Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch>
25 stack() : k(0), max_size(20), v(new T[20]) {}
26 ~stack() { delete [] v; }
28 int size() const { return k; }
29 T top () const { return v[k-1]; }
30 T & top () { return v[k-1]; }
37 for (int i=0; i<k; i++) v[i] = w[i];
44#endif /* HEP_STACK_SRC */