Skip to main content

std::queue back()

// (1) Non const version
reference back();

// (2) Const version
const_reference back() const;

Returns a reference

to the last element in the queue.
This is the most recently pushed element.

note

Effectively calls c.back().

Parameters​

(none)

Return value​

Reference to the last element.

Exceptions​

(none)

Complexity​

Constant - (1).

Example​

important

This section requires improvement. You can help by editing this doc page.

std::queue back()

// (1) Non const version
reference back();

// (2) Const version
const_reference back() const;

Returns a reference

to the last element in the queue.
This is the most recently pushed element.

note

Effectively calls c.back().

Parameters​

(none)

Return value​

Reference to the last element.

Exceptions​

(none)

Complexity​

Constant - (1).

Example​

important

This section requires improvement. You can help by editing this doc page.