|
libhatchet
|
#include <hxdeque.hpp>
Classes | |
| class | const_iterator |
| class | iterator |
Public Member Functions | |
| hxdeque (hxsize_t dynamic_capacity_=0) | |
| ~hxdeque (void) | |
| const T & | operator[] (hxsize_t index_) const |
| T & | operator[] (hxsize_t index_) |
| bool | operator== (const hxdeque &x_) const |
| bool | operator< (const hxdeque &x_) const |
| const_iterator | begin (void) const |
| iterator | begin (void) |
| template<hxrange_concept_ range_t_> | |
| void | add_range (range_t_ &range_) noexcept |
| template<hxrange_concept_ range_t_, hxenable_if_t<!hxis_lvalue_reference< range_t_ >(), int > = 0> | |
| void | add_range (range_t_ &&range_) noexcept |
| T & | back (void) |
| const T & | back (void) const |
| hxsize_t | capacity (void) const |
| const_iterator | cbegin (void) const |
| const_iterator | cend (void) const |
| void | clear (void) noexcept |
| template<typename... args_t_> | |
| void | emplace_back (args_t_ &&... args_) noexcept |
| template<typename... args_t_> | |
| void | emplace_front (args_t_ &&... args_) noexcept |
| bool | empty (void) const |
| const_iterator | end (void) const |
| iterator | end (void) |
| T & | front (void) |
| const T & | front (void) const |
| bool | full (void) const |
| hxsize_t | max_size (void) const |
| void | pop_back (void) noexcept |
| void | pop_front (void) noexcept |
| template<typename... args_t_> | |
| void | push_back (args_t_ &&... args_) noexcept |
| template<typename... args_t_> | |
| void | push_front (args_t_ &&... args_) noexcept |
| void | reserve (hxsize_t dynamic_capacity_) |
| hxsize_t | size (void) const |
hxdeque - A fixed-capacity deque backed by a power-of-two ring buffer.
All operations are O(1). The effective capacity must be a power of two and positive once storage is allocated. This is designed to do one thing very well and that is all.
|
explicit |
Constructs an empty hxdeque.
When using static storage the capacity is fixed at compile time and dynamic_capacity must be 0.
| hxdeque< T, capacity_ >::~hxdeque | ( | void | ) |
Destroys all elements in the deque.
|
noexcept |
Appends elements from a temporary range, moving each element with push_back.
This overload enables moving the range elements into the deque when forwarding rvalues.
|
noexcept |
Appends elements from a range referenced by an lvalue, copying each element with push_back.
| T & hxdeque< T, capacity_ >::back | ( | void | ) |
Returns a reference to the back element. The deque must not be empty.
| const T & hxdeque< T, capacity_ >::back | ( | void | ) | const |
|
inline |
|
inline |
Returns a const iterator pointing to the first element.
| hxsize_t hxdeque< T, capacity_ >::capacity | ( | void | ) | const |
Returns the capacity of the deque or 0 if unallocated.
|
inline |
Returns a const iterator pointing to the first element (alias for begin).
|
inline |
Returns a const iterator pointing past the last element.
|
noexcept |
Destroys all elements and resets the deque to empty without deallocating.
|
noexcept |
Constructs an element in place at the back using forwarded arguments.
Exactly the same as push_back.
|
noexcept |
Constructs an element in place at the front using forwarded arguments.
Exactly the same as push_front.
| bool hxdeque< T, capacity_ >::empty | ( | void | ) | const |
Returns true if the deque contains no elements.
|
inline |
|
inline |
Returns a const iterator pointing past the last element.
| T & hxdeque< T, capacity_ >::front | ( | void | ) |
Returns a reference to the front element. The deque must not be empty.
| const T & hxdeque< T, capacity_ >::front | ( | void | ) | const |
| bool hxdeque< T, capacity_ >::full | ( | void | ) | const |
Returns true if the deque is at capacity.
|
inline |
Returns the capacity of the deque or 0 if unallocated.
| bool hxdeque< T, capacity_ >::operator< | ( | const hxdeque< T, capacity_ > & | x_ | ) | const |
Returns true if this deque compares less than x lexicographically, using hxkey_equal and hxkey_less.
| bool hxdeque< T, capacity_ >::operator== | ( | const hxdeque< T, capacity_ > & | x_ | ) | const |
Returns true if this deque and x contain the same elements in the same order, using hxkey_equal.
| T & hxdeque< T, capacity_ >::operator[] | ( | hxsize_t | index_ | ) |
| const T & hxdeque< T, capacity_ >::operator[] | ( | hxsize_t | index_ | ) | const |
Returns a const reference to the element at logical index index.
|
noexcept |
Removes and destroys the back element. The deque must not be empty.
|
noexcept |
Removes and destroys the front element. The deque must not be empty.
|
noexcept |
Appends an element at the back using forwarded arguments.
Exactly the same as emplace_back.
|
noexcept |
Prepends an element at the front using forwarded arguments.
Exactly the same as emplace_front.
| void hxdeque< T, capacity_ >::reserve | ( | hxsize_t | dynamic_capacity_ | ) |
Allocates storage for a dynamic deque.
May only be called once and only when the deque has no storage.
| hxsize_t hxdeque< T, capacity_ >::size | ( | void | ) | const |
Returns the number of elements currently in the deque.