Pigweed
C/C++ API Reference
|
Classes | |
class | Item |
Public Member Functions | |
IntrusiveForwardList (const IntrusiveForwardList &)=delete | |
IntrusiveForwardList & | operator= (const IntrusiveForwardList &)=delete |
IntrusiveForwardList (IntrusiveForwardList &&)=default | |
IntrusiveForwardList & | operator= (IntrusiveForwardList &&)=default |
template<typename Iterator > | |
IntrusiveForwardList (Iterator first, Iterator last) | |
IntrusiveForwardList (std::initializer_list< Item * > items) | |
Constructs a list from a std::initializer_list of pointers to items. | |
template<typename Iterator > | |
void | assign (Iterator first, Iterator last) |
void | assign (std::initializer_list< T * > items) |
reference | front () |
Reference to the first element in the list. Undefined behavior if empty(). | |
const_reference | front () const |
iterator | before_begin () noexcept |
const_iterator | before_begin () const noexcept |
const_iterator | cbefore_begin () const noexcept |
iterator | begin () noexcept |
const_iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
iterator | end () noexcept |
const_iterator | end () const noexcept |
const_iterator | cend () const noexcept |
bool | empty () const noexcept |
constexpr size_type | max_size () const noexcept |
void | clear () |
iterator | insert_after (iterator pos, T &item) |
Inserts the given item after the given position, pos . | |
template<typename Iterator > | |
iterator | insert_after (iterator pos, Iterator first, Iterator last) |
iterator | insert_after (iterator pos, std::initializer_list< T * > items) |
iterator | erase_after (iterator pos) |
Removes the item following pos from the list. The item is not destructed. | |
iterator | erase_after (iterator first, iterator last) |
Removes the range of items from first (inclusive) to last (exclusive). | |
void | push_front (T &item) |
Inserts the item at the start of the list. | |
void | pop_front () |
Removes the first item in the list. The list must not be empty. | |
void | swap (IntrusiveForwardList< T > &other) noexcept |
void | merge (IntrusiveForwardList< T > &other) |
template<typename Compare > | |
void | merge (IntrusiveForwardList< T > &other, Compare comp) |
void | splice_after (iterator pos, IntrusiveForwardList< T > &other) |
void | splice_after (iterator pos, IntrusiveForwardList< T > &other, iterator it) |
void | splice_after (iterator pos, IntrusiveForwardList< T > &other, iterator first, iterator last) |
bool | remove (const T &item) |
template<typename UnaryPredicate > | |
size_type | remove_if (UnaryPredicate pred) |
void | reverse () |
size_type | unique () |
template<typename BinaryPredicate > | |
size_type | unique (BinaryPredicate pred) |
void | sort () |
template<typename Compare > | |
void | sort (Compare comp) |
Friends | |
template<typename > | |
class | containers::internal::LegacyIntrusiveList |
A singly-list intrusive list.
IntrusiveForwardList<T> is a handle to access and manipulate the list, and IntrusiveForwardList<T>::Item is the type from which the base class items must derive.
As a singly-linked list, the overhead required is only sizeof(T*)
. However, operations such as removal may require O(n) time to walk the length of the list.
This class is modeled on std::forward_list
, with the following differences:
iterator
s and not const_iterator
s:T | Type of intrusive items stored in the list. |
|
default |
Moves the other list's contents into this list.
This is O(n).
|
inline |
Constructs a list from an iterator over items. The iterator may dereference as either Item& (e.g. from std::array<Item>) or Item* (e.g. from std::initializer_list<Item*>).
|
inline |
|
inlinenoexcept |
|
inline |
Inserts the range of items from first
(inclusive) to last
(exclusive) after the given position, pos
.
|
inline |
Inserts the range of items from first
(inclusive) to last
(exclusive) after the given position, pos
.
|
inlineconstexprnoexcept |
|
inline |
This overload uses T::operator<
.
|
inline |
|
default |
Clears this list and moves the other list's contents into it.
This is O(n).
|
inline |
|
inline |
|
inline |
|
inline |
This overload uses T::operator<
.
|
inline |
|
inline |
Inserts the items of other
to after pos
in this list. Upon returning, other
will be empty.
|
inline |
Moves the items exclusively between first
and last
from other
to after pos
in this list.
|
inline |
Moves the item pointed to by the iterator following it
from other
to after pos
in this list.
|
inlinenoexcept |
Exchanges this list's items with the other
list's items.
This is O(n), where "n" is the number of items in the range.
|
inline |
This overload uses T::operator==
.
|
inline |