]> git.donarmstrong.com Git - lilypond.git/blob - flower/sstack.hh
release: 0.0.20
[lilypond.git] / flower / sstack.hh
1 /*
2   sstack.hh -- part of Flower lib
3
4   (c) 1996 Han-Wen Nienhuys
5 */
6
7 #ifndef SSTACK_HH
8 #define SSTACK_HH
9
10 #include "varray.hh"
11
12 /// A simple stack based on Array.
13 template<class T>
14 struct sstack : Array<T> { 
15     T top()const { return last(); }
16     T pop() {
17         assert(!empty());
18         T l = last();
19         Array<T>::pop();
20         return l;
21     }
22     void push(T l) { add(l); }
23 };
24 /**
25   Same as for #Array# goes here.
26 */
27
28
29 #endif // SSTACK_HH
30