empty
语法:
1 |
bool empty(); |
empty()返回真如果双向队列为空,否则返回假。
1 2 3 4 5 6 7 8 |
源代码 /** * Returns true if the %deque is empty. (Thus begin() would equal end().) */ bool empty() const { return this->_M_impl._M_finish == this->_M_impl._M_start; } |
测试代码:
测试结果:
dq5内没有元素2
请按任意键继续. . .