seq_.reserve (200);
}
- stack (unsigned int n)
+ stack (unsigned n)
: seq_ (n)
{}
///
/// Index 0 returns the topmost element.
T&
- operator[] (unsigned int i)
+ operator[] (unsigned i)
{
return seq_[seq_.size () - 1 - i];
}
///
/// Index 0 returns the topmost element.
const T&
- operator[] (unsigned int i) const
+ operator[] (unsigned i) const
{
return seq_[seq_.size () - 1 - i];
}
}
void
- pop (unsigned int n = 1)
+ pop (unsigned n = 1)
{
for (; n; --n)
seq_.pop_back ();
class slice
{
public:
- slice (const S& stack, unsigned int range)
+ slice (const S& stack, unsigned range)
: stack_ (stack)
, range_ (range)
{}
const T&
- operator [] (unsigned int i) const
+ operator [] (unsigned i) const
{
return stack_[range_ - i];
}
private:
const S& stack_;
- unsigned int range_;
+ unsigned range_;
};
]])