pop_back
语法:
1 |
void pop_back(); |
pop_back()删除双向队列尾部的元素。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
源代码 /** * @brief Removes last element. * * This is a typical stack operation. It shrinks the %deque by one. * * Note that no data is returned, and if the last element's data is * needed, it should be retrieved before pop_back() is called. */ void pop_back() { if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_first) { --this->_M_impl._M_finish._M_cur; std::_Destroy(this->_M_impl._M_finish._M_cur); } else _M_pop_back_aux(); } |
测试代码
测试结果
0