最終更新日時(UTC): 2018年07月11日 05時21分29秒 YukiMiyatake が更新
履歴 編集
void pop();
スタックトップ(コンテナの末尾側)の要素を削除する。内部でスタックを実装するコンテナオブジェクトのpop_back()メンバ関数が呼び出される。
pop_back()
c.pop_back();
なし。
Container::pop_back()と同じ。
Container::pop_back()
#include <iostream> #include <stack> int main() { std::stack<int> st; for (int i = 0; i < 5; ++i) st.push(i); std::cout << "Popping out elements..."; while (!st.empty()) { std::cout << " " << st.top(); st.pop(); } std::cout << std::endl; return 0; }
Popping out elements... 4 3 2 1 0
void pop() { c.pop_back(); }