|
ActiveLib
|
#include <List.h>


Public Types | |
| using | value_t = std::unique_ptr<T> |
| Stored type. | |
| using | base = std::list<value_t> |
| Base container type. | |
| using | size_type = typename base::size_type |
| Container size (index) type. | |
| using | iterator = typename base::iterator |
| Container iterator type. | |
| using | const_iterator = typename base::const_iterator |
| Container const iterator type. | |
Public Member Functions | |
| List () | |
| template<class Derived > | |
| List (const std::initializer_list< Derived > &items) | |
| List (const List &source) | |
| List (List &&source) | |
| virtual | ~List ()=default |
| auto | operator= (const List &source) |
| auto | operator= (List &&source) |
| void | push_back (T *item) |
| void | push_back (T &item) |
| void | emplace_back (T &&item) |
| void | emplace_back (const T &item) |
| void | emplace_back (value_t &&item) |
| void | emplace_back (value_t &item) |
| void | push_front (T *item) |
| void | emplace_front (T &&item) |
| void | emplace_front (value_t &&item) |
| auto | release (iterator &pos) |
A specialisation class for a list of objects wrapped in unique_ptr
This allows list to store objects with polymorphic behaviour and object copying (object type must conform to Clonable). Keep in mind that the normal behaviour of the list is to take ownership of any objects stored in it (unless release is used)
NB: There is no requirement for container items to be non-null. It is entirely up the implementor if this rule should be adopted or enforced
|
inline |
Constructor
|
inlineexplicit |
Constructor
| items | The items to insert into the list |

|
inline |
Copy constructor
| source | The object to copy |
|
inline |
Move constructor
| source | The object to move |
|
virtualdefault |
Destructor
|
inline |
Push an item at the end of the list
| item | The item to push |
|
inline |
Push an item at the end of the list
| item | The item to push |

|
inline |
Push an item at the end of the list
| item | The item to push (already wrapped in unique_ptr) |
|
inline |
Push an item at the end of the list
| item | The item to push (already wrapped in unique_ptr) |
|
inline |
Push an item at the front of the list
| item | The item to push |

|
inline |
Push an item at the front of the list
| item | The item to push (already wrapped in unique_ptr) |
|
inline |
Assignment operator
| source | The object to copy |
|
inline |
Assignment operator
| source | The object to move |
|
inline |
Push an item at the end of the list
| item | The item to push (ownership passes to this list) |
|
inline |
Push an item at the end of the list
| item | The item to push (ownership passes to this list) |
|
inline |
Push an item at the end of the list
| item | The item to push (ownership passes to this list) |
|
inline |
Release the pointer held by the specified item and erase
| pos | An iterator pointing to the item to be removed |
