template<typename T, typename Container = fl::deque<T>>
class fl::queue< T, Container >
A first-in, first-out (FIFO) queue container adapter.
This queue is implemented as a container adapter that uses fl::deque as the underlying container by default. It provides standard queue operations: push elements to the back and pop elements from the front.
- Template Parameters
-
T | The type of elements stored in the queue |
Container | The underlying container type (defaults to fl::deque<T>) |
Definition at line 18 of file queue.h.
|
| queue ()=default |
| Default constructor - creates an empty queue.
|
|
| queue (const Container &container) |
| Construct queue with a copy of the given container.
|
|
| queue (const queue &other)=default |
| Copy constructor.
|
|
| queue (Container &&container) |
| Construct queue by moving the given container.
|
|
| queue (queue &&other)=default |
| Move constructor.
|
|
| ~queue ()=default |
| Destructor.
|
|
reference | back () |
| Access the last element (back of queue)
|
|
const_reference | back () const |
| Access the last element (back of queue) - const version.
|
|
bool | empty () const |
| Check if the queue is empty.
|
|
reference | front () |
| Access the first element (front of queue)
|
|
const_reference | front () const |
| Access the first element (front of queue) - const version.
|
|
Container & | get_container () |
| Get access to the underlying container (for advanced use)
|
|
const Container & | get_container () const |
| Get access to the underlying container (const version)
|
|
queue & | operator= (const queue &other)=default |
| Copy assignment operator.
|
|
queue & | operator= (queue &&other)=default |
| Move assignment operator.
|
|
void | pop () |
| Remove the front element from the queue.
|
|
void | push (const value_type &value) |
| Add an element to the back of the queue.
|
|
void | push (value_type &&value) |
| Add an element to the back of the queue (move version)
|
|
size_type | size () const |
| Get the number of elements in the queue.
|
|
void | swap (queue &other) |
| Swap the contents with another queue.
|
|