Skip to main content

std::queue front

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

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

Returns a reference

to the first element in the queue.
This element will be the first element to be removed on a call to pop().

note

Effectively calls c.front().

Parameters​

(none)

Return value​

Reference to the first element.

Exceptions​

(none)

Complexity​

Constant - (1).

Example​

important

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

std::queue front

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

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

Returns a reference

to the first element in the queue.
This element will be the first element to be removed on a call to pop().

note

Effectively calls c.front().

Parameters​

(none)

Return value​

Reference to the first element.

Exceptions​

(none)

Complexity​

Constant - (1).

Example​

important

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