don't understand this list (C++ STL)# Programming - 葵花宝典
b*n
1 楼
member functions of the C++ (SGI STL, according to Hou's book)
STL list container:
void pop_front() {erase(begin());}
void pop_back() {iterator tmp=end(); erase(--tmp);}
For the pop_back(), why not juse write as:
void pop_back() {erase(--end());}
looks like it should also work.
Thanks!
STL list container:
void pop_front() {erase(begin());}
void pop_back() {iterator tmp=end(); erase(--tmp);}
For the pop_back(), why not juse write as:
void pop_back() {erase(--end());}
looks like it should also work.
Thanks!