iffl
1.3.4
Implements Intrusive Flat Forward List container
|
THis class implements forward iterator for intrusive flat forward list. More...
#include <iffl_list.h>
Public Types | |
using | iterator_category = std::forward_iterator_tag |
Marks iterator as a forward iterator. | |
using | value_type = T |
Element value type. | |
using | difference_type = ptrdiff_t |
Element pointers difference type. | |
using | pointer = T * |
Pointer to element type. | |
using | reference = T & |
Reference to the element type. | |
using | traits = TT |
Element traits type. | |
using | traits_traits = flat_forward_list_traits_traits< T, TT > |
Element traits-traits type. | |
using | buffer_char_pointer = std::conditional_t< std::is_const_v< T >, char const *, char * > |
using | buffer_unsigned_char_pointer = std::conditional_t< std::is_const_v< T >, unsigned char const *, unsigned char * > |
using | buffer_void_pointer = std::conditional_t< std::is_const_v< T >, void const *, void * > |
using | size_with_padding_t = typename traits_traits::size_with_padding_t |
Vocabulary type used to describe size with padding. | |
using | const_iterator = flat_forward_list_iterator_t< std::add_const_t< T >, TT > |
Const iterator is an iterator for a T const. More... | |
using | non_const_iterator = flat_forward_list_iterator_t< std::remove_cv_t< T >, TT > |
[Non-const] iterator is an iterator for a T with no const qualifiers More... | |
Public Member Functions | |
constexpr | flat_forward_list_iterator_t () noexcept=default |
Default initialize iterator. More... | |
constexpr | flat_forward_list_iterator_t (flat_forward_list_iterator_t const &) noexcept=default |
Copy constructs an iterator. | |
constexpr | flat_forward_list_iterator_t (flat_forward_list_iterator_t &&other) noexcept |
Move constructs iterator. More... | |
template<typename I , typename = std::enable_if_t<is_const_iterator && is_non_const_iterator_v<I>>> | |
constexpr | flat_forward_list_iterator_t (I const &other) noexcept |
Unittest that is_non_const_iterator_v returns expected result. More... | |
template<typename I , typename = std::enable_if_t<is_const_iterator && is_non_const_iterator_v<I>>> | |
constexpr | flat_forward_list_iterator_t (I &&other) noexcept |
Perfect forwarding constructor for const iterator from non-const iterator. More... | |
constexpr flat_forward_list_iterator_t & | operator= (flat_forward_list_iterator_t const &) noexcept=default |
Default generated copy constructor. More... | |
constexpr flat_forward_list_iterator_t & | operator= (flat_forward_list_iterator_t &&other) noexcept |
Move constructor. More... | |
template<typename I , typename = std::enable_if_t<is_const_iterator && is_non_const_iterator_v<I>>> | |
constexpr flat_forward_list_iterator_t & | operator= (I const &other) noexcept |
Assignment operator for const iterator from non-const iterator. More... | |
template<typename I , typename = std::enable_if_t<is_const_iterator && is_non_const_iterator_v<I>>> | |
constexpr flat_forward_list_iterator_t & | operator= (I &&other) noexcept |
Perfect forwarding assignment operator for const iterator from non-const iterator. More... | |
constexpr void | swap (flat_forward_list_iterator_t &other) noexcept |
swaps this iterator and the other iterator More... | |
constexpr | operator bool () const |
Explicit conversion iterator to bool. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator== (I const &other) const noexcept |
Equals operator used to compare to another iterator. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator != (I const &other) const noexcept |
Not equals operator used to compare to another iterator. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator< (I const &other) const noexcept |
Less than operator used to compare to another iterator. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator<= (I const &other) const noexcept |
Less than or equals operator used to compare to another iterator. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator > (I const &other) const noexcept |
Greater than operator used to compare to another iterator. More... | |
template<typename I , typename = std::enable_if_t<is_comparable_iterator_v<I>>> | |
constexpr bool | operator >= (I const &other) const noexcept |
Greater or equals than operator used to compare to another iterator. More... | |
constexpr flat_forward_list_iterator_t & | operator++ () noexcept |
Prefix increment operator. More... | |
constexpr flat_forward_list_iterator_t | operator++ (int) noexcept |
Postfix increment operator. More... | |
constexpr flat_forward_list_iterator_t | operator+ (unsigned int advance_by) const noexcept |
Add operator. Advances iterator specified number of times. More... | |
constexpr T & | operator * () const noexcept |
Dereference operator. More... | |
constexpr T * | operator-> () const noexcept |
pointer operator. More... | |
constexpr buffer_char_pointer | get_ptr () const noexcept |
Static Public Attributes | |
static constexpr auto const | is_const_iterator { std::is_const_v<T> } |
Is std::true_type{} if this iterator is an iterator for a T const, and std::false_type{} otherwise. | |
template<typename Iterator > | |
static constexpr auto const | is_non_const_iterator_v |
Is std::true_type{} if Iterator is same as non-const equivalent of the current iterator non-const equivalent is constructed by removing CV qualifiers from T. non_const_iterator defines non-const equivalent for this iterator so we just need to make sure Iterator is the same type as non_const_iterator. More... | |
template<typename Iterator > | |
static constexpr auto const | is_const_iterator_v |
Is std::true_type{} if Iterator is same as const equivalent of the current iterator non-const equivalent is constructed by adding CV qualifiers to T. const_iterator defines const equivalent for this iterator so we just need to make sure Iterator is the same type as const_iterator. More... | |
template<typename Iterator > | |
static constexpr auto const | is_comparable_iterator_v |
Is std::true_type{} if Iterator is a const or non-const equivalent of this iterator and std::false_type otherwise. Comparable iterator can be used in relation operators. More... | |
Friends | |
template<typename TU , typename TTU , typename AU > | |
class | flat_forward_list |
template<typename TU , typename TTU > | |
class | flat_forward_list_ref |
THis class implements forward iterator for intrusive flat forward list.
T | - type of element header |
TT | - type trait for T that is used to get offset to the next element in the flat list. It must implement get_next_offset method. |
Once iterator is incremented pass last element it becomes equal to default initialized iterator so you can use flat_forward_list_iterator_t{} as a sentinel that can be used as an end iterator.
iffl::flat_forward_list_iterator_t< T, TT >::buffer_char_pointer |
Selects between constant and non-constant pointer to the buffer depending if T is const
iffl::flat_forward_list_iterator_t< T, TT >::buffer_unsigned_char_pointer |
Selects between constant and non-constant pointer to the buffer depending if T is const
iffl::flat_forward_list_iterator_t< T, TT >::buffer_void_pointer |
Selects between constant and non-constant pointer to the buffer depending if T is const
iffl::flat_forward_list_iterator_t< T, TT >::const_iterator |
Const iterator is an iterator for a T const.
This type is used as helper for SFINAE expressions
iffl::flat_forward_list_iterator_t< T, TT >::non_const_iterator |
[Non-const] iterator is an iterator for a T with no const qualifiers
This type is used as a helper for SFINAE expressions
|
defaultnoexcept |
Default initialize iterator.
For the types that support get_next_offset default initialized iterator is an end iterator. For the types that do not support get_next_offset it creates an invalid iterator.
|
inlinenoexcept |
Move constructs iterator.
other | - instance of iterator we are moving from |
|
inlinenoexcept |
Unittest that is_non_const_iterator_v returns expected result.
Unittest that is_non_const_iterator_v returns expected resultCopy constructor for const iterator from non-const iterator
I | - iterator type we are constructing from |
other | - iterator we are constructing from |
We are relying on SFINAE to disable this constructor if
|
inlinenoexcept |
Perfect forwarding constructor for const iterator from non-const iterator.
I | - iterator type we are constructing from |
other | - iterator we are constructing from |
We are relying on SFINAE to disable this constructor if
|
inlinenoexcept |
|
inlinenoexcept |
Not equals operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
inlinenoexcept |
Dereference operator.
|
inlinenoexcept |
Greater than operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
inlinenoexcept |
Greater or equals than operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
inlineexplicit |
Explicit conversion iterator to bool.
|
inlinenoexcept |
Add operator. Advances iterator specified number of times.
advance_by | - number of times this iterator should be advanced |
Advances iterator specified number of times caller is responsible for making sure iterator would not get advanced beyond container's end, if that happen then behavior is undefined.
|
inlinenoexcept |
Prefix increment operator.
Advances iterator to the next element
|
inlinenoexcept |
Postfix increment operator.
Advances iterator to the next element
|
inlinenoexcept |
pointer operator.
|
inlinenoexcept |
Less than operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
inlinenoexcept |
Less than or equals operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
defaultnoexcept |
Default generated copy constructor.
|
inlinenoexcept |
Move constructor.
other | - iterator we are moving from |
|
inlinenoexcept |
Assignment operator for const iterator from non-const iterator.
I | - iterator type we are assigning from |
other | - iterator we are constructing from |
We are relying on SFINAE to disable this assignment operator if
|
inlinenoexcept |
Perfect forwarding assignment operator for const iterator from non-const iterator.
I | - iterator type we are assigning from |
other | - iterator we are assigning from |
We are relying on SFINAE to disable this assignment operator if
|
inlinenoexcept |
Equals operator used to compare to another iterator.
I | - type of the other iterator |
other | - other iterator we are comparing to |
We are using SFINAE to enable this operator only for const and non-const iterator types for the same element type
|
inlinenoexcept |
swaps this iterator and the other iterator
other | - reference to the other iterator |
|
friend |
Forward declaration of intrusive flat forward list container.
|
friend |
Forward declaration of intrusive flat forward list reference.
|
static |
Is std::true_type{} if Iterator is a const or non-const equivalent of this iterator and std::false_type otherwise. Comparable iterator can be used in relation operators.
Iterator | - any type |
|
static |
Is std::true_type{} if Iterator is same as const equivalent of the current iterator non-const equivalent is constructed by adding CV qualifiers to T. const_iterator defines const equivalent for this iterator so we just need to make sure Iterator is the same type as const_iterator.
Iterator | - any type |
|
static |
Is std::true_type{} if Iterator is same as non-const equivalent of the current iterator non-const equivalent is constructed by removing CV qualifiers from T. non_const_iterator defines non-const equivalent for this iterator so we just need to make sure Iterator is the same type as non_const_iterator.
Iterator | - any type |