Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::stack<T,Container>::pop

Removes the top element from the stack. Effectively calls c.pop_back().

Containers
  • C++98
  • C++11
1 min readView on cppreference
NotebookLM
void pop();

Removes the top element from the stack. Effectively calls c.pop_back().

Parameters

(none)

Return value

(none)

Complexity

Equal to the complexity of Container::pop_back.

Example

See also

(C++11)
constructs element in-place at the top
(public member function)
inserts element at the top
(public member function)
accesses the top element
(public member function)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.