看了STL的栈实现,没搞清楚当是一个空栈是,返回栈顶会出现什么情况?该怎么处理

看了STL的栈实现,没搞清楚当是一个空栈是,返回栈顶会出现什么情况?
贴上代码如下:

<stack>文件:
reference top()
{// return last element of mutable stack
return (c.back());
}

其中c是deque容器
找到<deque>文件看到c.back()实现如下:
reference back()
{// return last element of mutable sequence
return (*(end() - 1));
}

end()是指迭代器的指针,如果是空栈,迭代器的begin()和end()都是指向第一个元素,那这个end()-1不是越界了吗?返回的又是什么值呢?

------解决方案--------------------
对iterator解引用之前会有一个assert,你这么干的时候就会触发。。。
------解决方案--------------------
The top function returns the topmost element of the stack. You should ensure that there are one or more elements on the stack before calling the top function.