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

> C++ Atlas: `cppatlas.com/w/cpp/container/stack/pop` | Source: https://en.cppreference.com/w/cpp/container/stack/pop | Domain: Containers | Standards: C++98, C++11

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

## Official Specification Summary (cppreference)

```cpp
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

- [`emplace`](https://en.cppreference.com/w/cpp/container/stack/emplace) (C++11): constructs element in-place at the top (public member function)
- [`push`](https://en.cppreference.com/w/cpp/container/stack/push): inserts element at the top (public member function)
- [`top`](https://en.cppreference.com/w/cpp/container/stack/top): accesses the top element (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/container/stack/pop (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.