Double-ended queue container wrapping std::deque. More...
#include <deque.h>
Public Types | |
| using | Ptr = SharedPtr< Deque > |
| Shared pointer type for Deque. | |
| using | Data = std::deque< T > |
| Underlying std::deque storage type. | |
| using | Value = T |
| Value type. | |
| using | Iterator = typename Data::iterator |
| Mutable forward iterator. | |
| using | ConstIterator = typename Data::const_iterator |
| Const forward iterator. | |
| using | RevIterator = typename Data::reverse_iterator |
| Mutable reverse iterator. | |
| using | ConstRevIterator = typename Data::const_reverse_iterator |
| Const reverse iterator. | |
Public Member Functions | |
| Deque ()=default | |
| Default constructor. Creates an empty deque. | |
| Deque (const Deque &other) | |
| Copy constructor. | |
| Deque (Deque &&other) noexcept | |
| Move constructor. | |
| Deque (std::initializer_list< T > initList) | |
| Constructs a deque from an initializer list. | |
| ~Deque ()=default | |
| Destructor. | |
| Deque & | operator= (const Deque &other) |
| Copy assignment operator. | |
| Deque & | operator= (Deque &&other) noexcept |
| Move assignment operator. | |
| Iterator | begin () noexcept |
| Returns a mutable iterator to the first element. | |
| ConstIterator | begin () const noexcept |
| Returns a const iterator to the first element. | |
| ConstIterator | cbegin () const noexcept |
| Returns a const iterator to the first element. | |
| ConstIterator | constBegin () const noexcept |
| Returns a const iterator to the first element. | |
| Iterator | end () noexcept |
| Returns a mutable iterator to one past the last element. | |
| ConstIterator | end () const noexcept |
| Returns a const iterator to one past the last element. | |
| ConstIterator | cend () const noexcept |
| Returns a const iterator to one past the last element. | |
| ConstIterator | constEnd () const noexcept |
| Returns a const iterator to one past the last element. | |
| RevIterator | rbegin () noexcept |
| Returns a mutable reverse iterator to the last element. | |
| RevIterator | revBegin () noexcept |
| Returns a mutable reverse iterator to the last element. | |
| ConstRevIterator | crbegin () const noexcept |
| Returns a const reverse iterator to the last element. | |
| ConstRevIterator | constRevBegin () const noexcept |
| Returns a const reverse iterator to the last element. | |
| RevIterator | rend () noexcept |
| Returns a mutable reverse iterator to one before the first element. | |
| RevIterator | revEnd () noexcept |
| Returns a mutable reverse iterator to one before the first element. | |
| ConstRevIterator | crend () const noexcept |
| Returns a const reverse iterator to one before the first element. | |
| ConstRevIterator | constRevEnd () const noexcept |
| Returns a const reverse iterator to one before the first element. | |
| T & | at (size_t index) |
Returns a reference to the element at index with bounds checking. | |
| const T & | at (size_t index) const |
Returns a reference to the element at index with bounds checking. | |
| T & | operator[] (size_t index) |
Returns a reference to the element at index without bounds checking. | |
| const T & | operator[] (size_t index) const |
Returns a reference to the element at index without bounds checking. | |
| T & | front () |
| Returns a reference to the first element. | |
| const T & | front () const |
| Returns a reference to the first element. | |
| T & | back () |
| Returns a reference to the last element. | |
| const T & | back () const |
| Returns a reference to the last element. | |
| bool | isEmpty () const noexcept |
| Returns true if the deque has no elements. | |
| size_t | size () const noexcept |
| Returns the number of elements. | |
| void | pushToFront (const T &value) |
| Pushes an item onto the front of the deque. | |
| void | pushToFront (T &&value) |
| Pushes an item onto the front of the deque (move overload). | |
| void | pushToBack (const T &value) |
| Pushes an item onto the back of the deque. | |
| void | pushToBack (T &&value) |
| Pushes an item onto the back of the deque (move overload). | |
| T | popFromFront () |
| Removes and returns the first element. | |
| T | popFromBack () |
| Removes and returns the last element. | |
| void | clear () noexcept |
| Removes all elements. | |
| void | swap (Deque &other) noexcept |
| Swaps contents with another deque. | |
| template<typename Func > | |
| void | forEach (Func &&func) const |
Calls func for every element. | |
Friends | |
| bool | operator== (const Deque &lhs, const Deque &rhs) |
| Returns true if both deques have identical contents. | |
| bool | operator!= (const Deque &lhs, const Deque &rhs) |
| Returns true if the deques differ. | |
Double-ended queue container wrapping std::deque.
Provides a Qt-inspired API over std::deque with consistent naming
| T | Element type. |
Constructs a deque from an initializer list.
| initList | Brace-enclosed list of values. |
Returns a reference to the element at index with bounds checking.
| index | Zero-based element index. |
Returns a reference to the element at index with bounds checking.
| index | Zero-based element index. |
Returns a reference to the last element.
|
inlinenoexcept |
Returns a const iterator to the first element.
|
inlinenoexcept |
Returns a const iterator to one past the last element.
|
inlinenoexcept |
Returns a const reverse iterator to the last element.
|
inlinenoexcept |
Returns a const reverse iterator to one before the first element.
Calls func for every element.
| Func | Callable with signature void(const T &). |
| func | The function to invoke. |
Returns a reference to the first element.
Returns a reference to the element at index without bounds checking.
| index | Zero-based element index. |
Returns a reference to the element at index without bounds checking.
| index | Zero-based element index. |
Removes and returns the last element.
Removes and returns the first element.
Pushes an item onto the back of the deque.
| value | The value to append. |
Pushes an item onto the back of the deque (move overload).
| value | The value to move-append. |
Pushes an item onto the front of the deque.
| value | The value to prepend. |
Pushes an item onto the front of the deque (move overload).
| value | The value to move-prepend. |
|
inlinenoexcept |
Returns a mutable reverse iterator to the last element.
|
inlinenoexcept |
Returns a mutable reverse iterator to one before the first element.
Swaps contents with another deque.
| other | The deque to swap with. |