iffl  1.3.4
Implements Intrusive Flat Forward List container
Namespaces | Classes | Typedefs | Functions
iffl Namespace Reference

intrusive flat forward list More...

Namespaces

 mpl
 intrusive flat forward list
 

Classes

class  attach_buffer
 Helper class used as a parameter in flat_forward_list constructor to designate that it should take ownership of the buffer rather than make a copy. More...
 
class  buffer_t
 A set of pointers describing state of the buffer containing flat forward list. More...
 
class  compressed_pair
 Empty Base Class Optimization EBCO helper. More...
 
class  compressed_pair< T1, T2, false >
 Specialization for the case when Empty Base Class Optimization EBCO would not work. More...
 
class  debug_memory_resource
 implements std::pmr::memory_resource interface. More...
 
class  default_validate_element_fn
 
class  flat_forward_list
 Intrusive flat forward list container. More...
 
class  flat_forward_list_iterator_t
 THis class implements forward iterator for intrusive flat forward list. More...
 
class  flat_forward_list_ref
 Non owning container for flat forward list. More...
 
class  flat_forward_list_sizes
 Describes buffer used by container. More...
 
class  flat_forward_list_traits
 traits for an elements that are in the flat forward list More...
 
class  flat_forward_list_traits_traits
 traits for flat_forward_list_traits More...
 
class  input_buffer_memory_resource
 implements std::pmr::memory_resource interface. More...
 
class  noop_validate_element_fn
 
class  offset_with_aligment
 Vocabulary type that describes an offset in a larger buffer and template parameter that specifies element's type alignment requirements. More...
 
class  one_then_variadic_args_t
 Tag type for constructing first from one argument, constructing second from remaining arguments. More...
 
class  range
 Vocabulary type that describes a sub-buffer in a larger buffer, and portion of that sub-buffer actually used by the data. More...
 
class  range_with_alighment
 Vocabulary type that describes a sub-buffer in a larger buffer and portion of that sub-buffer actually used by the data. More...
 
class  scope_guard
 template class that can be parametrized with a functor or a lambda that it will call in destructor. More...
 
class  size_with_padding
 Vocabulary type that describes an size and template parameter that specifies element's type alignment requirements. More...
 
class  zero_then_variadic_args_t
 Tag type for value - initializing first, constructing second from remaining arguments. More...
 

Typedefs

using buffer_ref = buffer_t< char >
 Non const flat forward list buffer.
 
using buffer_view = buffer_t< char const >
 Const flat forward list buffer.
 
template<typename T , typename TT = flat_forward_list_traits<T>>
using flat_forward_list_iterator = flat_forward_list_iterator_t< T, TT >
 non-const iterator More...
 
template<typename T , typename TT = flat_forward_list_traits<T>>
using flat_forward_list_const_iterator = flat_forward_list_iterator_t< std::add_const_t< T >, TT >
 const iterator More...
 
template<typename T , typename TT = flat_forward_list_traits<T>>
using flat_forward_list_view = flat_forward_list_ref< T const, TT >
 Constant view to flat forward list.
 
template<typename T , typename TT = flat_forward_list_traits<T>>
using pmr_flat_forward_list = flat_forward_list< T, TT, FFL_PMR::polymorphic_allocator< char > >
 Use this typedef if you want to use container with polymorphic allocator. More...
 

Functions

template<typename T >
constexpr void unused_variable ([[maybe_unused]] T const &)
 Restore saved min and max definition. More...
 
template<typename T >
constexpr void unused_expression_result ([[maybe_unused]] T const &)
 Silence sensitizers warning about unused result of expression. More...
 
size_t const ptr_to_size (void const *const ptr)
 Reinterprets pointer to void value as size_t value. More...
 
void *const size_to_ptr (size_t size)
 Reinterprets size_t value as pointer to void. More...
 
constexpr size_t roundup_size_to_alignment (size_t size, size_t alignment) noexcept
 Rounds up size to specified alignment. More...
 
template<typename T >
constexpr size_t roundup_size_to_alignment (size_t size) noexcept
 Rounds up size to specified alignment. More...
 
void * roundup_ptr_to_alignment (void *ptr, size_t alignment) noexcept
 Rounds up pointer to specified alignment. More...
 
template<typename T >
void * roundup_ptr_to_alignment (void *ptr) noexcept
 Rounds up pointer to specified alignment. More...
 
void const * roundup_ptr_to_alignment (void const *ptr, size_t alignment) noexcept
 Rounds up pointer to specified alignment. More...
 
template<typename T >
void const * roundup_ptr_to_alignment (void const *ptr) noexcept
 Rounds up pointer to specified alignment. More...
 
void copy_data (char *to_buffer, char const *from_buffer, size_t length) noexcept
 copies length bytes from from_buffer to to_buffer. source and destination buffers cannot overlap More...
 
void move_data (char *to_buffer, char const *from_buffer, size_t length) noexcept
 copies length bytes from from_buffer to to_buffer. source and destination buffers can overlap More...
 
void fill_buffer (char *buffer, int value, size_t length) noexcept
 sets "length" consecutive bytes of "to_buffer" to "value". More...
 
void zero_buffer (char *buffer, size_t length) noexcept
 sets "length" consecutive bytes of "to_buffer" to 0. More...
 
size_t distance (void const *begin, void const *end) noexcept
 sets "length" consecutive bytes of "to_buffer" to 0. More...
 
template<typename T >
char * cast_to_char_ptr (T *p) noexcept
 Helper method to cast a pointer to a char *. More...
 
template<typename T >
void * cast_to_void_ptr (T *p) noexcept
 Helper method to cast a pointer to a void *. More...
 
template<typename G >
constexpr auto make_scope_guard (G &&g)
 Factory method for scoped_guard. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate_has_next_offset (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate_no_next_offset (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (char *first, char *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration.
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (T *first, T *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (T const *first, T const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (unsigned char const *first, unsigned char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (unsigned char *first, unsigned char *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (void const *first, void const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > flat_forward_list_validate (void *first, void *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept
 Forward declaration. More...
 
template<typename T , typename TT >
void swap (flat_forward_list_ref< T, TT > &lhs, flat_forward_list_ref< T, TT > &rhs) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::iterator begin (flat_forward_list_ref< T, TT > &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator begin (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator cbegin (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::iterator end (flat_forward_list_ref< T, TT > &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator end (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator cend (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::iterator last (flat_forward_list_ref< T, TT > &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator last (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT >
flat_forward_list_ref< T, TT >::const_iterator clast (flat_forward_list_ref< T, TT > const &c) noexcept
 
template<typename T , typename TT , typename A >
void swap (flat_forward_list< T, TT, A > &lhs, flat_forward_list< T, TT, A > &rhs) noexcept(std::allocator_traits< A >::propagate_on_container_swap::value||std::allocator_traits< A >::propagate_on_container_move_assignment::value)
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::iterator begin (flat_forward_list< T, TT, A > &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator begin (flat_forward_list< T, TT, A > const &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator cbegin (flat_forward_list< T, TT, A > const &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::iterator end (flat_forward_list< T, TT, A > &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator end (flat_forward_list< T, TT, A > const &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator cend (flat_forward_list< T, TT, A > const &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::iterator last (flat_forward_list< T, TT, A > &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator last (flat_forward_list< T, TT, A > const &c) noexcept
 
template<typename T , typename TT , typename A >
flat_forward_list< T, TT, A >::const_iterator clast (flat_forward_list< T, TT, A > const &c) noexcept
 

Detailed Description

intrusive flat forward list

Typedef Documentation

◆ flat_forward_list_const_iterator

template<typename T , typename TT = flat_forward_list_traits<T>>
iffl::flat_forward_list_const_iterator

const iterator

Template Parameters
T- element type
TT- element type traits

Default initialized to specialization of flat_forward_list_traits for T

◆ flat_forward_list_iterator

template<typename T , typename TT = flat_forward_list_traits<T>>
iffl::flat_forward_list_iterator

non-const iterator

Template Parameters
T- element type
TT- element type traits

Default initialized to specialization of flat_forward_list_traits for T

◆ pmr_flat_forward_list

template<typename T , typename TT = flat_forward_list_traits<T>>
iffl::pmr_flat_forward_list

Use this typedef if you want to use container with polymorphic allocator.

Template Parameters
T- element type
TT- element type traits

Function Documentation

◆ begin() [1/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::iterator iffl::begin ( flat_forward_list_ref< T, TT > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ begin() [2/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::begin ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ begin() [3/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::iterator iffl::begin ( flat_forward_list< T, TT, A > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ begin() [4/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::begin ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ cast_to_char_ptr()

template<typename T >
char* iffl::cast_to_char_ptr ( T *  p)
inlinenoexcept

Helper method to cast a pointer to a char *.

Parameters
p- Buffer pointer.
Returns
pointer casted to char *

◆ cast_to_void_ptr()

template<typename T >
void* iffl::cast_to_void_ptr ( T *  p)
inlinenoexcept

Helper method to cast a pointer to a void *.

Parameters
p- Buffer pointer.
Returns
pointer casted to void *

◆ cbegin() [1/2]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::cbegin ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ cbegin() [2/2]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::cbegin ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ cend() [1/2]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::cend ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ cend() [2/2]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::cend ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ clast() [1/2]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::clast ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ clast() [2/2]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::clast ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ copy_data()

void iffl::copy_data ( char *  to_buffer,
char const *  from_buffer,
size_t  length 
)
inlinenoexcept

copies length bytes from from_buffer to to_buffer. source and destination buffers cannot overlap

Parameters
to_buffer- Destination buffer. Must be at least length bytes long
from_buffer- Source buffer. Must be at least length bytes long
length- number of bytes to copy

◆ distance()

size_t iffl::distance ( void const *  begin,
void const *  end 
)
inlinenoexcept

sets "length" consecutive bytes of "to_buffer" to 0.

Parameters
begin- Destination buffer.
end- number of bytes to assign 0 to

◆ end() [1/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::iterator iffl::end ( flat_forward_list_ref< T, TT > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ end() [2/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::end ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ end() [3/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::iterator iffl::end ( flat_forward_list< T, TT, A > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ end() [4/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::end ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ fill_buffer()

void iffl::fill_buffer ( char *  buffer,
int  value,
size_t  length 
)
inlinenoexcept

sets "length" consecutive bytes of "to_buffer" to "value".

Parameters
buffer- Destination buffer.
value- value we are assigning
length- number of bytes to assign value to

◆ flat_forward_list_validate() [1/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( char const *  first,
char const *  end,
F const &  validate_element_fn 
)
inlinenoexcept

Forward declaration.

Validates that buffer contains valid flat forward list and returns a pointer to the last element.

Template Parameters
T- element type
TT- element type traits. Defaulted to algorithms expects following methods
  • get_next_offset
  • minimum_size
  • validate specialization flat_forward_list_traits<T>
F- functor used to validate element by default uses default_validate_element_fn<T, TT>
Parameters
first- start of buffer we are validating
end- first byte pass the buffer we are validation buffer size == end - first
validate_element_fn- a functor that is used to validate element. For instance if element contains offset to variable lengths data, it can check that these data are in bound of the buffer. Default functor calls TT::validate. You can use noop_validate_element_fn if you do not want validate element
Returns
std::pair<id_valid, flat_forward_list_ref<T, TT>> first - result of validation
  • true if buffer is null
  • true if buffer is empty
  • true if we found a valid element with offset to the next element equals 0
  • false is all other cases second - reference or a view up to the last valid element
    • empty view if no valid elements were found <true, empty view> - buffer is NULL or empty It is safe to use iterators. <false, empty view> - buffer is too small to query next element offset, or offset to next element is pointing beyond end, or element fields validation did not pass. We did not find any entries that pass validation so far. Buffer contains no flat list. <false, non empty view> - same as above, but we did found at least one valid element. Buffer contains valid head, but tail is corrupt and have to be either truncated by setting next offset on the last valid element to 0 or if possible by fixing first elements pass the last valid element. <true, non empty view> - buffer contains a valid flat forward list, it is safe to use iterators

When TT has get_next_offset we will use flat_forward_list_validate_has_next_offset, otherwise we call flat_forward_list_validate_no_next_offset

  • flat_forward_list_validate_has_next_offset stops when next element offset is 0
  • flat_forward_list_validate_no_next_offset stops when buffer cannot fit next element

◆ flat_forward_list_validate() [2/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( T *  first,
T *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes pointers to element types.

◆ flat_forward_list_validate() [3/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( T const *  first,
T const *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes pointers to element types.

◆ flat_forward_list_validate() [4/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( unsigned char const *  first,
unsigned char const *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes unsigned char const pointers.

◆ flat_forward_list_validate() [5/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( unsigned char *  first,
unsigned char *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes unsigned char pointers.

◆ flat_forward_list_validate() [6/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( void const *  first,
void const *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes void const pointers.

◆ flat_forward_list_validate() [7/7]

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate ( void *  first,
void *  end,
F const &  validate_element_fn = default_validate_element_fn<T, TT>{} 
)
inlinenoexcept

Forward declaration.

Overload that takes void pointers.

◆ flat_forward_list_validate_has_next_offset()

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate_has_next_offset ( char const *  first,
char const *  end,
F const &  validate_element_fn 
)
inlinenoexcept

Forward declaration.

flat_forward_list_validate_has_next_offset

Template Parameters
T- element type
TT- element type traits. Defaulted to specialization flat_forward_list_traits<T>
F- functor used to validate element by default uses default_validate_element_fn<T, TT>

Validates if buffer contains a valid intrusive flat forward list See comment for flat_forward_list_validate. Users are not expected to use this function directly, instead use flat_forward_list_validate, which will call flat_forward_list_validate_has_next_offset if TT::get_next_offset is defined.

◆ flat_forward_list_validate_no_next_offset()

template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>>
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > iffl::flat_forward_list_validate_no_next_offset ( char const *  first,
char const *  end,
F const &  validate_element_fn 
)
inlinenoexcept

Forward declaration.

flat_forward_list_validate_no_next_offset

Template Parameters
T- element type
TT- element type traits. Defaulted to specialization flat_forward_list_traits<T>
F- functor used to validate element by default uses default_validate_element_fn<T, TT>

Validates if buffer contains a valid intrusive flat forward list See comment for flat_forward_list_validate. Users are not expected to use this function directly, instead prefer to use flat_forward_list_validate, which will call flat_forward_list_validate_no_next_offset if TT::get_next_offset is NOT defined. You can call this function directly IFF TT::get_next_offset is defined, but you want to run validation as if it is not defined.

◆ last() [1/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::iterator iffl::last ( flat_forward_list_ref< T, TT > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ last() [2/4]

template<typename T , typename TT >
flat_forward_list_ref<T, TT>::const_iterator iffl::last ( flat_forward_list_ref< T, TT > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ last() [3/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::iterator iffl::last ( flat_forward_list< T, TT, A > &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ last() [4/4]

template<typename T , typename TT , typename A >
flat_forward_list<T, TT, A>::const_iterator iffl::last ( flat_forward_list< T, TT, A > const &  c)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
c- container

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ make_scope_guard()

template<typename G >
constexpr auto iffl::make_scope_guard ( G &&  g)
inline

Factory method for scoped_guard.

Creates an instance of guard given input functor. Helper for lambdas where we do not know name of lambda type

Template Parameters
G- type of functor. It is deduced by compiler from parameter type
Parameters
g- forwarding reference for the functor.

◆ move_data()

void iffl::move_data ( char *  to_buffer,
char const *  from_buffer,
size_t  length 
)
inlinenoexcept

copies length bytes from from_buffer to to_buffer. source and destination buffers can overlap

Parameters
to_buffer- Destination buffer. Must be at least length bytes long
from_buffer- Source buffer. Must be at least length bytes long
length- number of bytes to copy

◆ ptr_to_size()

size_t const iffl::ptr_to_size ( void const *const  ptr)
inline

Reinterprets pointer to void value as size_t value.

Parameters
ptr- pointer that value we want to put in size_t
Returns
- value of pointer places in size_t

◆ roundup_ptr_to_alignment() [1/4]

void* iffl::roundup_ptr_to_alignment ( void *  ptr,
size_t  alignment 
)
inlinenoexcept

Rounds up pointer to specified alignment.

Parameters
ptr- pointer to round up
alignment- alignment we are rounding up to
Returns
- value of pointer rounded up to alignment

◆ roundup_ptr_to_alignment() [2/4]

template<typename T >
void* iffl::roundup_ptr_to_alignment ( void *  ptr)
inlinenoexcept

Rounds up pointer to specified alignment.

Template Parameters
T- type that alignment we are aligning to
Parameters
ptr- pointer to round up
Returns
- pointer rounded up to the type alignment

◆ roundup_ptr_to_alignment() [3/4]

void const* iffl::roundup_ptr_to_alignment ( void const *  ptr,
size_t  alignment 
)
inlinenoexcept

Rounds up pointer to specified alignment.

Parameters
ptr- pointer to round up
alignment- alignment we are rounding up to
Returns
- value of pointer rounded up to alignment

◆ roundup_ptr_to_alignment() [4/4]

template<typename T >
void const* iffl::roundup_ptr_to_alignment ( void const *  ptr)
inlinenoexcept

Rounds up pointer to specified alignment.

Template Parameters
T- type that alignment we are aligning to
Parameters
ptr- pointer to round up
Returns
- pointer rounded up to the type alignment

◆ roundup_size_to_alignment() [1/2]

constexpr size_t iffl::roundup_size_to_alignment ( size_t  size,
size_t  alignment 
)
inlinenoexcept

Rounds up size to specified alignment.

Parameters
size- value to round up
alignment- alignment we are rounding up to
Returns
- value of size rounded up to alignment

◆ roundup_size_to_alignment() [2/2]

template<typename T >
constexpr size_t iffl::roundup_size_to_alignment ( size_t  size)
inlinenoexcept

Rounds up size to specified alignment.

Template Parameters
T- type that alignment we are aligning to
Parameters
size- value to round up
Returns
- value of size rounded up to the type alignment

◆ size_to_ptr()

void* const iffl::size_to_ptr ( size_t  size)
inline

Reinterprets size_t value as pointer to void.

Parameters
size- value that we want to reinterpret as a pointer
Returns
- pointer that contains same value as passed in size parameter

◆ swap() [1/2]

template<typename T , typename TT >
void iffl::swap ( flat_forward_list_ref< T, TT > &  lhs,
flat_forward_list_ref< T, TT > &  rhs 
)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
lhs- one of the containers we are swapping between
rhs- other container we are swapping between

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ swap() [2/2]

template<typename T , typename TT , typename A >
void iffl::swap ( flat_forward_list< T, TT, A > &  lhs,
flat_forward_list< T, TT, A > &  rhs 
)
inlinenoexcept
Template Parameters
T- element type
TT- element type traits
A- allocator type that should be used for this container
Parameters
lhs- one of the containers we are swapping between
rhs- other container we are swapping between

TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T

◆ unused_expression_result()

template<typename T >
constexpr void iffl::unused_expression_result ( [[maybe_unused] ] T const &  )
inline

Silence sensitizers warning about unused result of expression.

Template Parameters
T- type of unused variable

◆ unused_variable()

template<typename T >
constexpr void iffl::unused_variable ( [[maybe_unused] ] T const &  )
inline

Restore saved min and max definition.

Silence unused variable warning when both

  • MSVC: var;
  • and [[maybe_unused]] do not work
    Template Parameters
    T- type of unused variable

◆ zero_buffer()

void iffl::zero_buffer ( char *  buffer,
size_t  length 
)
inlinenoexcept

sets "length" consecutive bytes of "to_buffer" to 0.

Parameters
buffer- Destination buffer.
length- number of bytes to assign 0 to