|
SPH
|
Doubly-linked list. More...
#include <List.h>
Public Member Functions | |
| List () | |
| Constructs the list with no elements. More... | |
| List (std::initializer_list< StorageType > list) | |
| Constructs the list given initializer_list of elements. More... | |
| List (List &&other) | |
| Move constructor. More... | |
| ~List () | |
| List & | operator= (List &&other) |
| Move operator. More... | |
| INLINE bool | empty () const |
| Returns true if there are no elements in the list. More... | |
| INLINE Size | size () const |
| Returns the number of elements in the list. More... | |
| template<typename U > | |
| void | pushBack (U &&value) |
| Adds a new element to the back of the list. More... | |
| template<typename U > | |
| void | pushFront (U &&value) |
| Adds a new element to the beginning of the list. More... | |
| template<typename U > | |
| void | insert (const ListIterator< T > iter, U &&value) |
| ListIterator< T > | erase (const ListIterator< T > iter) |
| Removes an element given by the iterator. More... | |
| void | clear () |
| Removes all elements from the list. More... | |
| INLINE T & | front () |
| Returns the reference to the first element in the list. More... | |
| INLINE const T & | front () const |
| Returns the reference to the first element in the list. More... | |
| INLINE T & | back () |
| Returns the reference to the last element in the list. More... | |
| INLINE const T & | back () const |
| Returns the reference to the last element in the list. More... | |
| List | clone () const |
| Creates a copy of the list. More... | |
| ListIterator< T > | begin () |
| Returns a bidirectional iterator pointing to the first element of the list. More... | |
| ListIterator< const T > | begin () const |
| Returns a bidirectional iterator pointing to the first element of the list. More... | |
| ListIterator< T > | end () |
| Returns a bidirectional iterator pointing to the one-past-last element of the list. More... | |
| ListIterator< const T > | end () const |
| Returns a bidirectional iterator pointing to the one-past-last element of the list. More... | |
| const TAllocator & | allocator () const |
| Returns the interface to the allocator. More... | |
| TAllocator & | allocator () |
| Returns the interface to the allocator. More... | |
Public Member Functions inherited from Noncopyable | |
| Noncopyable ()=default | |
| Noncopyable (const Noncopyable &)=delete | |
| Noncopyable (Noncopyable &&)=default | |
| Noncopyable & | operator= (const Noncopyable &)=delete |
| Noncopyable & | operator= (Noncopyable &&)=default |
Friends | |
| template<typename TStream > | |
| TStream & | operator<< (TStream &stream, const List &array) |
| Prints content of the list to stream. Stored values must have overloaded << operator. More... | |
Doubly-linked list.
Random access is not implemented, as it would be highly ineffective anyway.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes an element given by the iterator.
This does not invalidate iterators or pointers to element, except for the iterator to the element being erased from the list.
| iter | Iterator to an element being erased. Must not be nullptr. |
|
inline |
|
inline |
|
inline |
|
friend |