38 #ifndef YY_YY_STACK_HH_INCLUDED 39 # define YY_YY_STACK_HH_INCLUDED 47 template <
class T,
class S = std::deque<T> >
52 typedef typename S::reverse_iterator iterator;
53 typedef typename S::const_reverse_iterator const_iterator;
59 stack (
unsigned int n) : seq_ (n)
65 operator [] (
unsigned int i)
72 operator [] (
unsigned int i)
const 86 pop (
unsigned int n = 1)
99 inline const_iterator begin ()
const {
return seq_.rbegin (); }
100 inline const_iterator end ()
const {
return seq_.rend (); }
107 template <
class T,
class S = stack<T> >
111 slice (
const S& stack,
unsigned int range)
119 operator [] (
unsigned int i)
const 121 return stack_[range_ - i];
Present a slice of the top of a stack.