# std::queue<T,Container>::back

> C++ Atlas: `cppatlas.com/w/cpp/container/queue/back` | Source: https://en.cppreference.com/w/cpp/container/queue/back | Domain: Containers

Returns reference to the last element in the queue. This is the most recently pushed element. Effectively calls c.back().

## Official Specification Summary (cppreference)

```cpp
reference back();
const_reference back() const;
```

Returns reference to the last element in the queue. This is the most recently pushed element. Effectively calls `c.back()`.

### Parameters

(none)

### Return value

Reference to the last element.

### Complexity

Constant.

### See also

- [`front`](https://en.cppreference.com/w/cpp/container/queue/front): access the first element (public member function)
- [`push`](https://en.cppreference.com/w/cpp/container/queue/push): inserts element at the end (public member function)

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