|
DSA - Data Structures and Algorithms
|
Implements ForwardList using Node with pointer to next element as internal base. More...
#include <forward_list.h>
Classes | |
| class | ForwardListIterator |
| Implements ForwardListIterator. More... | |
| class | Node |
| Implements Node class with user data. More... | |
| class | NodeBase |
| Struct implements base pointer used by ForwardList. More... | |
Public Types | |
| using | value_type = T |
| Alias for data type used in class. | |
| using | allocator_type = std::allocator<value_type> |
| Alias for memory allocator. | |
| using | size_type = std::size_t |
| Alias for size type used in class. | |
| using | difference_type = std::ptrdiff_t |
| Alias for pointer difference type used in class. | |
| using | pointer = value_type* |
| Alias for pointer to data type used in class. | |
| using | const_pointer = const value_type* |
| Alias for const pointer to data type used in class. | |
| using | reference = value_type& |
| Alias for reference to data type used in class. | |
| using | const_reference = const value_type& |
| Alias for const reference to data type used in class. | |
| using | const_iterator = ForwardListIterator<true> |
| Alias for const iterator to data type used in class. | |
| using | iterator = ForwardListIterator<false> |
| Alias for iterator to data type used in class. | |
Public Member Functions | |
| ForwardList () | |
| Construct a new ForwardList object. | |
| ForwardList (size_type count) | |
Construct a new ForwardList object of size count, using default value of type T. | |
| ForwardList (size_type count, const T &value) | |
Construct a new ForwardList object of size count, using provided value of type T. | |
| template<typename InputIt> requires std::input_iterator<InputIt> | |
| ForwardList (InputIt first, InputIt last) | |
Construct a new ForwardList object using elements from range [ first , last ) | |
| ForwardList (const std::initializer_list< T > &init_list) | |
| Construct a new ForwardList object using initializer list. | |
| ForwardList (const ForwardList< T > &other) | |
| Construct a new ForwardList object using copy constructor. | |
| auto | operator= (const ForwardList< T > &other) -> ForwardList & |
| Constructs ForwardList using copy assignment. | |
| ForwardList (ForwardList< T > &&other) noexcept | |
| Construct a new ForwardList object using move constructor. | |
| auto | operator= (ForwardList< T > &&other) noexcept -> ForwardList & |
| Assign ForwardList object using move assignment. | |
| ~ForwardList () | |
| Destroy the ForwardList object. | |
| void | assign (size_type count, const_reference value) |
| Function assign values to the ForwardList. | |
| template<typename InputIt> requires std::input_iterator<InputIt> | |
| void | assign (InputIt first, InputIt last) |
Function assign elements from range [ first , last ) to ForwardList object. | |
| void | assign (const std::initializer_list< T > &init_list) |
| Function assign values to the ForwardList. | |
| constexpr auto | get_allocator () const -> allocator_type |
| Get the allocator object. | |
| auto | front () -> reference |
| Function returns reference to value stored in ForwardList first Node. | |
| auto | front () const -> const_reference |
| Function returns const reference value stored in ForwardList first Node. | |
| auto | before_begin () noexcept -> iterator |
| Function returns iterator just before ForwardList first Node. | |
| auto | before_begin () const noexcept -> const_iterator |
| Function returns const_iterator just before ForwardList first Node. | |
| auto | cbefore_begin () const noexcept -> const_iterator |
| Function returns const_iterator just before ForwardList first Node. | |
| auto | begin () noexcept -> iterator |
| Function returns pointer to ForwardList first Node. | |
| auto | begin () const noexcept -> const_iterator |
| Function returns const pointer to ForwardList first Node. | |
| auto | cbegin () const noexcept -> const_iterator |
| Function returns const pointer to ForwardList first Node. | |
| auto | end () noexcept -> iterator |
| Function returns pointer to ForwardList last Node. | |
| auto | end () const noexcept -> const_iterator |
| Function returns pointer to ForwardList last Node. | |
| auto | cend () const noexcept -> const_iterator |
| Function returns pointer to ForwardList last Node. | |
| auto | empty () const -> bool |
| Function checks if container has no elements. | |
| auto | max_size () const noexcept -> size_type |
| Function returns maximum number of elements container can hold. | |
| void | clear () |
| Function removes all elements of ForwardList. | |
| auto | insert_after (const const_iterator &pos, const_reference value) -> iterator |
| Function inserts new Node after specified ForwardList iterator. | |
| auto | insert_after (const const_iterator &pos, T &&value) -> iterator |
| Function inserts new Node after specified ForwardList iterator. | |
| auto | insert_after (const const_iterator &pos, size_type count, const_reference value) -> iterator |
| Function inserts new Node after specified ForwardList const_iterator. | |
| template<typename InputIt> requires std::input_iterator<InputIt> | |
| auto | insert_after (const const_iterator &pos, InputIt first, InputIt last) -> iterator |
| Function inserts new Node after specified ForwardList const_iterator. | |
| auto | insert_after (const const_iterator &pos, std::initializer_list< T > init_list) -> iterator |
| Function inserts new Node after specified ForwardList const_iterator. | |
| template<typename... Args> | |
| auto | emplace_after (const_iterator pos, Args &&... args) -> iterator |
Insert new element into the container after pos. | |
| auto | erase_after (const const_iterator &pos) -> iterator |
| Function erases Node after specified ForwardList const_iterator. | |
| auto | erase_after (const const_iterator &first, const const_iterator &last) -> iterator |
| Function erases Node between specified ForwardList const_iterators. | |
| void | push_front (const_reference value) |
| Function adds new Node at the beginning of ForwardList. | |
| void | push_front (T &&value) |
| Function adds new Node at the beginning of ForwardList. | |
| template<typename... Args> | |
| auto | emplace_front (Args &&... args) -> reference |
| Inserts a new element to the beginning of the container. | |
| void | pop_front () |
| Function removes first Node of ForwardList. | |
| void | resize (size_type count) |
| Function resize ForwardList to specified number of elements. | |
| void | resize (size_type count, const_reference value) |
| Function resize ForwardList to specified number of elements. | |
| void | swap (ForwardList< T > &other) noexcept(std::is_nothrow_swappable_v< T >) |
| Function swaps content of two ForwardList objects. | |
| void | merge (ForwardList< T > &other) |
| Function combines two sorted ForwardLists into one sorted ForwardList. | |
| void | merge (ForwardList< T > &&other) |
| Function combines two sorted ForwardLists into one sorted ForwardList. | |
| template<typename Compare> | |
| void | merge (ForwardList< T > &other, Compare comp) |
| Function combines two sorted ForwardLists into one sorted ForwardList. | |
| template<typename Compare> | |
| void | merge (ForwardList< T > &&other, Compare comp) |
| Function combines two sorted ForwardLists into one sorted ForwardList. | |
| void | splice_after (const const_iterator &pos, ForwardList< T > &other) |
| Function moves elements from other ForwardList object. | |
| void | splice_after (const_iterator pos, ForwardList< T > &&other) |
| Function moves elements from other ForwardList object. | |
| void | splice_after (const const_iterator &pos, ForwardList< T > &other, const const_iterator &iter) |
| Function moves elements from other ForwardList object. | |
| void | splice_after (const_iterator pos, ForwardList< T > &&other, const_iterator iter) |
| Function moves elements from other ForwardList object. | |
| void | splice_after (const const_iterator &pos, ForwardList< T > &other, const const_iterator &first, const const_iterator &last) |
| Function moves elements from other ForwardList object. | |
| void | splice_after (const_iterator pos, ForwardList< T > &&other, const_iterator first, const_iterator last) |
| Function moves elements from other ForwardList object. | |
| auto | remove (const_reference value) -> size_type |
Function removes all elements equal to value. | |
| template<typename UnaryPred> | |
| auto | remove_if (UnaryPred predicate) -> size_type |
Function removes all elements for which predicate returns true. | |
| void | reverse () |
| Function reverts in place Nodes of ForwardList. | |
| auto | unique () -> size_type |
| Function removes consecutive duplicated elements. | |
| template<typename BinaryPred> | |
| auto | unique (BinaryPred predicate) -> size_type |
| Function removes consecutive duplicated elements. | |
| void | sort () |
| Function sorts the elements and preserves the order of equivalent elements. | |
| template<typename Compare> | |
| void | sort (Compare comp) |
| Function sorts the elements and preserves the order of equivalent elements. | |
| auto | size () const -> size_type |
| Function returns ForwardList size. | |
Implements ForwardList using Node with pointer to next element as internal base.
| T | type of data stored in ForwardList Node |
Definition at line 38 of file forward_list.h.
| using dsa::ForwardList< T >::allocator_type = std::allocator<value_type> |
Alias for memory allocator.
Definition at line 355 of file forward_list.h.
| using dsa::ForwardList< T >::const_iterator = ForwardListIterator<true> |
Alias for const iterator to data type used in class.
Definition at line 402 of file forward_list.h.
| using dsa::ForwardList< T >::const_pointer = const value_type* |
Alias for const pointer to data type used in class.
| T* | pointer to data type |
Definition at line 383 of file forward_list.h.
| using dsa::ForwardList< T >::const_reference = const value_type& |
Alias for const reference to data type used in class.
| T& | const reference to data type |
Definition at line 397 of file forward_list.h.
| using dsa::ForwardList< T >::difference_type = std::ptrdiff_t |
Alias for pointer difference type used in class.
| T | pointer size type |
Definition at line 369 of file forward_list.h.
| using dsa::ForwardList< T >::iterator = ForwardListIterator<false> |
Alias for iterator to data type used in class.
Definition at line 407 of file forward_list.h.
| using dsa::ForwardList< T >::pointer = value_type* |
Alias for pointer to data type used in class.
| T* | pointer to data type |
Definition at line 376 of file forward_list.h.
| using dsa::ForwardList< T >::reference = value_type& |
Alias for reference to data type used in class.
| T& | reference to data type |
Definition at line 390 of file forward_list.h.
| using dsa::ForwardList< T >::size_type = std::size_t |
Alias for size type used in class.
| T | size type |
Definition at line 362 of file forward_list.h.
| using dsa::ForwardList< T >::value_type = T |
Alias for data type used in class.
| T | data type |
Definition at line 350 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | ) |
Construct a new ForwardList object.
Definition at line 1129 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | size_type | count | ) |
Construct a new ForwardList object of size count, using default value of type T.
| [in] | count | element count |
Definition at line 1135 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | size_type | count, |
| const T & | value ) |
Construct a new ForwardList object of size count, using provided value of type T.
| [in] | count | element count |
| [in] | value | value for all nodes |
Definition at line 1140 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | InputIt | first, |
| InputIt | last ) |
Construct a new ForwardList object using elements from range [ first , last )
| InputIt |
| [in] | first | element defining range of elements to insert |
| [in] | last | element definig range of elements to insert |
Definition at line 1153 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | const std::initializer_list< T > & | init_list | ) |
Construct a new ForwardList object using initializer list.
| [in] | init_list | initializer list of values of type T |
Definition at line 1161 of file forward_list.h.
| dsa::ForwardList< T >::ForwardList | ( | const ForwardList< T > & | other | ) |
Construct a new ForwardList object using copy constructor.
| [in] | other | ForwardList object of type T |
Definition at line 1173 of file forward_list.h.
|
noexcept |
Construct a new ForwardList object using move constructor.
Content of other object will be taken by constructed object
| [in,out] | other | ForwardList object of type T |
Definition at line 1207 of file forward_list.h.
| dsa::ForwardList< T >::~ForwardList | ( | ) |
Destroy the ForwardList object.
Definition at line 1231 of file forward_list.h.
| void dsa::ForwardList< T >::assign | ( | const std::initializer_list< T > & | init_list | ) |
Function assign values to the ForwardList.
| [in] | init_list | values to replace ForwardList with |
Definition at line 1268 of file forward_list.h.
| void dsa::ForwardList< T >::assign | ( | InputIt | first, |
| InputIt | last ) |
Function assign elements from range [ first , last ) to ForwardList object.
| InputIt |
| [in] | first | element defining range of elements to insert |
| [in] | last | element definig range of elements to insert |
Definition at line 1255 of file forward_list.h.
| void dsa::ForwardList< T >::assign | ( | size_type | count, |
| const_reference | value ) |
Function assign values to the ForwardList.
| [in] | count | new size of the container |
| [in] | value | value to initialize elements of the container with |
Definition at line 1238 of file forward_list.h.
|
nodiscardnoexcept |
Function returns const_iterator just before ForwardList first Node.
Definition at line 1307 of file forward_list.h.
|
nodiscardnoexcept |
Function returns iterator just before ForwardList first Node.
Definition at line 1301 of file forward_list.h.
|
nodiscardnoexcept |
Function returns const pointer to ForwardList first Node.
Definition at line 1325 of file forward_list.h.
|
nodiscardnoexcept |
Function returns pointer to ForwardList first Node.
Definition at line 1319 of file forward_list.h.
|
nodiscardnoexcept |
Function returns const_iterator just before ForwardList first Node.
Definition at line 1313 of file forward_list.h.
|
nodiscardnoexcept |
Function returns const pointer to ForwardList first Node.
Definition at line 1331 of file forward_list.h.
|
nodiscardnoexcept |
Function returns pointer to ForwardList last Node.
Definition at line 1349 of file forward_list.h.
| void dsa::ForwardList< T >::clear | ( | ) |
Function removes all elements of ForwardList.
Definition at line 1368 of file forward_list.h.
| auto dsa::ForwardList< T >::emplace_after | ( | const_iterator | pos, |
| Args &&... | args ) -> iterator |
Insert new element into the container after pos.
| ...Args |
| [in] | pos | iterator before which new element will be inserted |
| [in] | ...args | args arguments to forward to the constructor of the element |
Definition at line 1466 of file forward_list.h.
| auto dsa::ForwardList< T >::emplace_front | ( | Args &&... | args | ) | -> reference |
Inserts a new element to the beginning of the container.
| ...Args |
| [in] | ...args | arguments to forward to the constructor of the element |
Definition at line 1524 of file forward_list.h.
|
nodiscard |
Function checks if container has no elements.
| true | if container is empty |
| false | if container is not empty |
Definition at line 1356 of file forward_list.h.
|
nodiscardnoexcept |
Function returns pointer to ForwardList last Node.
Definition at line 1343 of file forward_list.h.
|
nodiscardnoexcept |
Function returns pointer to ForwardList last Node.
Definition at line 1337 of file forward_list.h.
| auto dsa::ForwardList< T >::erase_after | ( | const const_iterator & | first, |
| const const_iterator & | last ) -> iterator |
Function erases Node between specified ForwardList const_iterators.
| [in] | first | element after which element will be erased |
| [in] | last | element after last erased element |
| iterator | to element after last deleted element |
| nullptr | if invalid iterator |
Definition at line 1492 of file forward_list.h.
| auto dsa::ForwardList< T >::erase_after | ( | const const_iterator & | pos | ) | -> iterator |
Function erases Node after specified ForwardList const_iterator.
| [in] | pos | const_iterator after which element will be erased |
| iterator | element after deleted element |
| nullptr | if invalid iterator |
Definition at line 1478 of file forward_list.h.
|
nodiscard |
Function returns reference to value stored in ForwardList first Node.
Definition at line 1289 of file forward_list.h.
|
nodiscard |
Function returns const reference value stored in ForwardList first Node.
Definition at line 1295 of file forward_list.h.
|
nodiscardconstexpr |
Get the allocator object.
Definition at line 1283 of file forward_list.h.
| auto dsa::ForwardList< T >::insert_after | ( | const const_iterator & | pos, |
| const_reference | value ) -> iterator |
Function inserts new Node after specified ForwardList iterator.
| [in] | pos | const_iterator to insert element after |
| [in] | value | element of type T to be inserted after pos |
| iterator | to inserted value |
| pos | if no element was inserted |
Definition at line 1386 of file forward_list.h.
| auto dsa::ForwardList< T >::insert_after | ( | const const_iterator & | pos, |
| InputIt | first, | ||
| InputIt | last ) -> iterator |
Function inserts new Node after specified ForwardList const_iterator.
| [in] | pos | const_iterator to insert element after |
| [in] | first | element defining range of elements to insert |
| [in] | last | element definig range of elements to insert |
| iterator | pointer to last inserted element |
| pos | if no element was inserted |
Definition at line 1428 of file forward_list.h.
| auto dsa::ForwardList< T >::insert_after | ( | const const_iterator & | pos, |
| size_type | count, | ||
| const_reference | value ) -> iterator |
Function inserts new Node after specified ForwardList const_iterator.
| [in] | pos | const_iterator to insert element after |
| [in] | count | number of elements to insert after pos |
| [in] | value | element of type T to be inserted |
| iterator | pointer to last inserted element |
| pos | if no element was inserted |
Definition at line 1408 of file forward_list.h.
| auto dsa::ForwardList< T >::insert_after | ( | const const_iterator & | pos, |
| std::initializer_list< T > | init_list ) -> iterator |
Function inserts new Node after specified ForwardList const_iterator.
| [in] | pos | const_iterator to insert element after |
| [in] | init_list | initializer_list with elements to insert after pos |
| iterator | to last inserted element |
| pos | if no element was inserted |
Definition at line 1447 of file forward_list.h.
| auto dsa::ForwardList< T >::insert_after | ( | const const_iterator & | pos, |
| T && | value ) -> iterator |
Function inserts new Node after specified ForwardList iterator.
| [in] | pos | const_iterator to insert element after |
| [in] | value | element of type T to be inserted after pos |
| iterator | to inserted value |
| pos | if no element was inserted |
Definition at line 1393 of file forward_list.h.
|
nodiscardnoexcept |
Function returns maximum number of elements container can hold.
Definition at line 1362 of file forward_list.h.
| void dsa::ForwardList< T >::merge | ( | ForwardList< T > && | other | ) |
Function combines two sorted ForwardLists into one sorted ForwardList.
| [in,out] | other | container to take elements from |
Content of other object will be taken by constructed object
other will refer to the same elements of this Definition at line 1611 of file forward_list.h.
| void dsa::ForwardList< T >::merge | ( | ForwardList< T > && | other, |
| Compare | comp ) |
Function combines two sorted ForwardLists into one sorted ForwardList.
| [in,out] | other | container to take elements from |
| [in] | comp | comparison function object |
Content of other object will be taken by constructed object
other will refer to the same elements of this Definition at line 1627 of file forward_list.h.
| void dsa::ForwardList< T >::merge | ( | ForwardList< T > & | other | ) |
Function combines two sorted ForwardLists into one sorted ForwardList.
| [in,out] | other | container to take elements from |
Content of other object will be taken by constructed object
other will refer to the same elements of this Definition at line 1605 of file forward_list.h.
| void dsa::ForwardList< T >::merge | ( | ForwardList< T > & | other, |
| Compare | comp ) |
Function combines two sorted ForwardLists into one sorted ForwardList.
| [in,out] | other | container to take elements from |
| [in] | comp | comparison function object |
Content of other object will be taken by constructed object
other will refer to the same elements of this Definition at line 1618 of file forward_list.h.
| auto dsa::ForwardList< T >::operator= | ( | const ForwardList< T > & | other | ) | -> ForwardList& |
Constructs ForwardList using copy assignment.
| [in] | other | ForwardList object of type T |
Definition at line 1185 of file forward_list.h.
|
noexcept |
Assign ForwardList object using move assignment.
Content of other object will be taken by constructed object
| [in,out] | other | ForwardList object of type T |
Definition at line 1213 of file forward_list.h.
| void dsa::ForwardList< T >::pop_front | ( | ) |
Function removes first Node of ForwardList.
Definition at line 1531 of file forward_list.h.
| void dsa::ForwardList< T >::push_front | ( | const_reference | value | ) |
Function adds new Node at the beginning of ForwardList.
| [in] | value | element of type T |
Definition at line 1511 of file forward_list.h.
| void dsa::ForwardList< T >::push_front | ( | T && | value | ) |
Function adds new Node at the beginning of ForwardList.
| [in] | value | element of type T |
Definition at line 1517 of file forward_list.h.
| auto dsa::ForwardList< T >::remove | ( | const_reference | value | ) | -> size_type |
Function removes all elements equal to value.
| [in] | value | value of elements to remove |
Definition at line 1729 of file forward_list.h.
| auto dsa::ForwardList< T >::remove_if | ( | UnaryPred | predicate | ) | -> size_type |
Function removes all elements for which predicate returns true.
| UnaryPred |
| [in] | predicate | to remove elements |
Definition at line 1736 of file forward_list.h.
| void dsa::ForwardList< T >::resize | ( | size_type | count | ) |
Function resize ForwardList to specified number of elements.
| [in] | count | new size of container |
Definition at line 1553 of file forward_list.h.
| void dsa::ForwardList< T >::resize | ( | size_type | count, |
| const_reference | value ) |
Function resize ForwardList to specified number of elements.
| [in] | count | count new size of container |
| [in] | value | value to initialize new elements |
Definition at line 1559 of file forward_list.h.
| void dsa::ForwardList< T >::reverse | ( | ) |
Function reverts in place Nodes of ForwardList.
Definition at line 1768 of file forward_list.h.
|
inlinenodiscard |
Function returns ForwardList size.
Definition at line 988 of file forward_list.h.
| void dsa::ForwardList< T >::sort | ( | ) |
Function sorts the elements and preserves the order of equivalent elements.
elements are compared using operator<
Definition at line 1842 of file forward_list.h.
Function sorts the elements and preserves the order of equivalent elements.
elements are compared using comp
| Compare |
| [in] | comp | comparison function object, returns true if the first argument is less than second |
Definition at line 1849 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const const_iterator & | pos, |
| ForwardList< T > & | other ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
other will refer to the same elements of this Definition at line 1692 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const const_iterator & | pos, |
| ForwardList< T > & | other, | ||
| const const_iterator & | first, | ||
| const const_iterator & | last ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
| [in] | first | const_iterator after which elements of other will be taken |
| [in] | last | const_iterator until which elements of other will be taken |
other will refer to the same elements of this Definition at line 1716 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const const_iterator & | pos, |
| ForwardList< T > & | other, | ||
| const const_iterator & | iter ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
| [in] | iter | const_iterator after which elements of other will be taken |
other will refer to the same elements of this Definition at line 1704 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const_iterator | pos, |
| ForwardList< T > && | other ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
other will refer to the same elements of this Definition at line 1698 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const_iterator | pos, |
| ForwardList< T > && | other, | ||
| const_iterator | first, | ||
| const_iterator | last ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
| [in] | first | const_iterator after which elements of other will be taken |
| [in] | last | const_iterator until which elements of other will be taken |
other will refer to the same elements of this Definition at line 1723 of file forward_list.h.
| void dsa::ForwardList< T >::splice_after | ( | const_iterator | pos, |
| ForwardList< T > && | other, | ||
| const_iterator | iter ) |
Function moves elements from other ForwardList object.
Content of other object will be taken by constructed object
| [in] | pos | const_iterator after which content of other container will be inserted |
| [in,out] | other | container to take elements from |
| [in] | iter | const_iterator after which elements of other will be taken |
other will refer to the same elements of this Definition at line 1710 of file forward_list.h.
|
noexcept |
Function swaps content of two ForwardList objects.
| [in,out] | other | object to swap content with |
Definition at line 1598 of file forward_list.h.
| auto dsa::ForwardList< T >::unique | ( | ) | -> size_type |
Function removes consecutive duplicated elements.
Only the first occurrence of given element in each group is preserved
Definition at line 1794 of file forward_list.h.
| auto dsa::ForwardList< T >::unique | ( | BinaryPred | predicate | ) | -> size_type |
Function removes consecutive duplicated elements.
Only the first occurrence of given element in each group is preserved
| BinaryPred |
| [in] | predicate | binary predicate which returns true if the element should be treated as equal |
Definition at line 1801 of file forward_list.h.