Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <flex_vector.hpp>

Public Types

using memory_policy = MemoryPolicy
 
using value_type = T
 
using reference = const T &
 
using size_type = detail::rbts::size_t
 
using difference_type = std::ptrdiff_t
 
using const_reference = const T &
 
using iterator = detail::rbts::rbtree_iterator< T, MemoryPolicy, B, BL >
 
using const_iterator = iterator
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using transient_type = vector_transient< T, MemoryPolicy, B, BL >
 

Public Member Functions

 vector ()=default
 
 vector (std::initializer_list< T > values)
 
template<typename Iter , typename Sent , std::enable_if_t< detail::compatible_sentinel_v< Iter, Sent >, bool > = true>
 vector (Iter first, Sent last)
 
 vector (size_type n, T v={})
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
size_type size () const
 
bool empty () const
 
const T & back () const
 
const T & front () const
 
reference operator[] (size_type index) const
 
reference at (size_type index) const
 
bool operator== (const vector &other) const
 
bool operator!= (const vector &other) const
 
vector push_back (value_type value) const &
 
decltype(auto) push_back (value_type value) &&
 
vector set (size_type index, value_type value) const &
 
decltype(auto) set (size_type index, value_type value) &&
 
template<typename FnT >
vector update (size_type index, FnT &&fn) const &
 
template<typename FnT >
decltype(auto) update (size_type index, FnT &&fn) &&
 
vector take (size_type elems) const &
 
decltype(auto) take (size_type elems) &&
 
transient_type transient () const &
 
transient_type transient () &&
 
const impl_timpl () const
 

Static Public Attributes

static constexpr auto bits = B
 
static constexpr auto bits_leaf = BL
 

Private Types

using impl_t = detail::rbts::rbtree< T, MemoryPolicy, B, BL >
 
using flex_t = flex_vector< T, MemoryPolicy, B, BL >
 
using move_t = std::integral_constant< bool, MemoryPolicy::use_transient_rvalues >
 

Private Member Functions

 vector (impl_t impl)
 
vector && push_back_move (std::true_type, value_type value)
 
vector push_back_move (std::false_type, value_type value)
 
vector && set_move (std::true_type, size_type index, value_type value)
 
vector set_move (std::false_type, size_type index, value_type value)
 
template<typename Fn >
vector && update_move (std::true_type, size_type index, Fn &&fn)
 
template<typename Fn >
vector update_move (std::false_type, size_type index, Fn &&fn)
 
vector && take_move (std::true_type, size_type elems)
 
vector take_move (std::false_type, size_type elems)
 

Private Attributes

friend flex_t
 
friend transient_type
 
impl_t impl_ = impl_t::empty()
 

Detailed Description

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
class immer::vector< T, MemoryPolicy, B, BL >

Immutable sequential container supporting both random access and structural sharing.

Template Parameters
TThe type of the values to be stored in the container.
MemoryPolicyMemory management policy. See memory_policy.

This cotainer provides a good trade-off between cache locality, random access, update performance and structural sharing. It does so by storing the data in contiguous chunks of :math:2^{BL} elements. By default, when sizeof(T) == sizeof(void*) then :math:B=BL=5, such that data would be stored in contiguous chunks of :math:32 elements.

You may learn more about the meaning and implications of B and BL parameters in the :doc:implementation section.

.. note:: In several methods we say that their complexity is effectively :math:O(...). Do not confuse this with the word amortized, which has a very different meaning. In this context, effective means that while the mathematically rigurous complexity might be higher, for all practical matters the provided complexity is more useful to think about the actual cost of the operation.

Example .. literalinclude:: ../example/vector/intro.cpp :language: c++ :start-after: intro/start :end-before: intro/end

Definition at line 21 of file flex_vector.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::const_iterator = iterator

Definition at line 94 of file vector.hpp.

◆ const_reference

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::const_reference = const T&

Definition at line 91 of file vector.hpp.

◆ difference_type

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::difference_type = std::ptrdiff_t

Definition at line 90 of file vector.hpp.

◆ flex_t

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::flex_t = flex_vector<T, MemoryPolicy, B, BL>
private

Definition at line 77 of file vector.hpp.

◆ impl_t

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::impl_t = detail::rbts::rbtree<T, MemoryPolicy, B, BL>
private

Definition at line 76 of file vector.hpp.

◆ iterator

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::iterator = detail::rbts::rbtree_iterator<T, MemoryPolicy, B, BL>

Definition at line 93 of file vector.hpp.

◆ memory_policy

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::memory_policy = MemoryPolicy

Definition at line 85 of file vector.hpp.

◆ move_t

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::move_t = std::integral_constant<bool, MemoryPolicy::use_transient_rvalues>
private

Definition at line 80 of file vector.hpp.

◆ reference

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::reference = const T&

Definition at line 88 of file vector.hpp.

◆ reverse_iterator

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 95 of file vector.hpp.

◆ size_type

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::size_type = detail::rbts::size_t

Definition at line 89 of file vector.hpp.

◆ transient_type

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::transient_type = vector_transient<T, MemoryPolicy, B, BL>

Definition at line 97 of file vector.hpp.

◆ value_type

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
using immer::vector< T, MemoryPolicy, B, BL >::value_type = T

Definition at line 87 of file vector.hpp.

Constructor & Destructor Documentation

◆ vector() [1/5]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
immer::vector< T, MemoryPolicy, B, BL >::vector ( )
default

Default constructor. It creates a vector of size() == 0. It does not allocate memory and its complexity is $ O(1) $.

◆ vector() [2/5]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
immer::vector< T, MemoryPolicy, B, BL >::vector ( std::initializer_list< T >  values)
inline

Constructs a vector containing the elements in values.

Definition at line 108 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::from_initializer_list().

◆ vector() [3/5]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
template<typename Iter , typename Sent , std::enable_if_t< detail::compatible_sentinel_v< Iter, Sent >, bool > = true>
immer::vector< T, MemoryPolicy, B, BL >::vector ( Iter  first,
Sent  last 
)
inline

Constructs a vector containing the elements in the range defined by the input iterator first and range sentinel last.

Definition at line 119 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::from_range().

◆ vector() [4/5]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
immer::vector< T, MemoryPolicy, B, BL >::vector ( size_type  n,
v = {} 
)
inline

Constructs a vector containing the element val repeated n times.

Definition at line 127 of file vector.hpp.

◆ vector() [5/5]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
immer::vector< T, MemoryPolicy, B, BL >::vector ( impl_t  impl)
inlineprivate

Definition at line 319 of file vector.hpp.

Member Function Documentation

◆ at()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
reference immer::vector< T, MemoryPolicy, B, BL >::at ( size_type  index) const
inline

Returns a const reference to the element at position index. It throws an std::out_of_range exception when $ index \geq size() $. It does not allocate memory and its complexity is effectively $ O(1) $.

Definition at line 195 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::get_check(), and immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ back()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
const T& immer::vector< T, MemoryPolicy, B, BL >::back ( ) const
inline

◆ begin()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
iterator immer::vector< T, MemoryPolicy, B, BL >::begin ( ) const
inline

Returns an iterator pointing at the first element of the collection. It does not allocate memory and its complexity is $ O(1) $.

Definition at line 136 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_.

Referenced by immer::vector< T, MemoryPolicy, B, BL >::rend().

◆ empty()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
bool immer::vector< T, MemoryPolicy, B, BL >::empty ( ) const
inline

Returns true if there are no elements in the container. It does not allocate memory and its complexity is $ O(1) $.

Definition at line 168 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::size.

◆ end()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
iterator immer::vector< T, MemoryPolicy, B, BL >::end ( ) const
inline

Returns an iterator pointing just after the last element of the collection. It does not allocate and its complexity is $ O(1) $.

Definition at line 142 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_.

Referenced by immer::vector< T, MemoryPolicy, B, BL >::rbegin().

◆ front()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
const T& immer::vector< T, MemoryPolicy, B, BL >::front ( ) const
inline

◆ impl()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
const impl_t& immer::vector< T, MemoryPolicy, B, BL >::impl ( ) const
inline

Definition at line 308 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ operator!=()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
bool immer::vector< T, MemoryPolicy, B, BL >::operator!= ( const vector< T, MemoryPolicy, B, BL > &  other) const
inline

Definition at line 203 of file vector.hpp.

◆ operator==()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
bool immer::vector< T, MemoryPolicy, B, BL >::operator== ( const vector< T, MemoryPolicy, B, BL > &  other) const
inline

Returns whether the vectors are equal.

Definition at line 201 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::equals(), and immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ operator[]()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
reference immer::vector< T, MemoryPolicy, B, BL >::operator[] ( size_type  index) const
inline

Returns a const reference to the element at position index. It is undefined when $ 0 index \geq size() $. It does not allocate memory and its complexity is effectively $ O(1) $.

Definition at line 186 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::get(), and immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ push_back() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::push_back ( value_type  value) const &
inline

Returns a vector with value inserted at the end. It may allocate memory and its complexity is effectively $ O(1) $.

Example .. literalinclude:: ../example/vector/vector.cpp :language: c++ :dedent: 8 :start-after: push-back/start :end-before: push-back/end

Definition at line 221 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::push_back().

◆ push_back() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
decltype(auto) immer::vector< T, MemoryPolicy, B, BL >::push_back ( value_type  value) &&
inline

◆ push_back_move() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector&& immer::vector< T, MemoryPolicy, B, BL >::push_back_move ( std::true_type  ,
value_type  value 
)
inlineprivate

◆ push_back_move() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::push_back_move ( std::false_type  ,
value_type  value 
)
inlineprivate

◆ rbegin()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
reverse_iterator immer::vector< T, MemoryPolicy, B, BL >::rbegin ( ) const
inline

Returns an iterator that traverses the collection backwards, pointing at the first element of the reversed collection. It does not allocate memory and its complexity is $ O(1) $.

Definition at line 149 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::end().

◆ rend()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
reverse_iterator immer::vector< T, MemoryPolicy, B, BL >::rend ( ) const
inline

Returns an iterator that traverses the collection backwards, pointing after the last element of the reversed collection. It does not allocate memory and its complexity is $ O(1) $.

Definition at line 156 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::begin().

◆ set() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::set ( size_type  index,
value_type  value 
) const &
inline

Returns a vector containing value value at position idx. Undefined for index >= size(). It may allocate memory and its complexity is effectively $ O(1) $.

Example .. literalinclude:: ../example/vector/vector.cpp :language: c++ :dedent: 8 :start-after: set/start :end-before: set/end

Definition at line 244 of file vector.hpp.

References immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::assoc(), and immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ set() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
decltype(auto) immer::vector< T, MemoryPolicy, B, BL >::set ( size_type  index,
value_type  value 
) &&
inline

Definition at line 247 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::set_move().

◆ set_move() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector&& immer::vector< T, MemoryPolicy, B, BL >::set_move ( std::true_type  ,
size_type  index,
value_type  value 
)
inlineprivate

◆ set_move() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::set_move ( std::false_type  ,
size_type  index,
value_type  value 
)
inlineprivate

◆ size()

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
size_type immer::vector< T, MemoryPolicy, B, BL >::size ( ) const
inline

Returns the number of elements in the container. It does not allocate memory and its complexity is $ O(1) $.

Definition at line 162 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::size.

◆ take() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::take ( size_type  elems) const &
inline

Returns a vector containing only the first min(elems, size()) elements. It may allocate memory and its complexity is effectively $ O(1) $.

Example .. literalinclude:: ../example/vector/vector.cpp :language: c++ :dedent: 8 :start-after: take/start :end-before: take/end

Definition at line 292 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::take().

◆ take() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
decltype(auto) immer::vector< T, MemoryPolicy, B, BL >::take ( size_type  elems) &&
inline

Definition at line 295 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::take_move().

◆ take_move() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector&& immer::vector< T, MemoryPolicy, B, BL >::take_move ( std::true_type  ,
size_type  elems 
)
inlineprivate

◆ take_move() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
vector immer::vector< T, MemoryPolicy, B, BL >::take_move ( std::false_type  ,
size_type  elems 
)
inlineprivate

◆ transient() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
transient_type immer::vector< T, MemoryPolicy, B, BL >::transient ( ) const &
inline

Returns an transient form of this container, an immer::vector_transient.

Definition at line 302 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ transient() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
transient_type immer::vector< T, MemoryPolicy, B, BL >::transient ( ) &&
inline

Definition at line 304 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_.

◆ update() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
template<typename FnT >
vector immer::vector< T, MemoryPolicy, B, BL >::update ( size_type  index,
FnT &&  fn 
) const &
inline

Returns a vector containing the result of the expression fn((*this)[idx]) at position idx. Undefined for 0 >= size(). It may allocate memory and its complexity is effectively $ O(1) $.

Example .. literalinclude:: ../example/vector/vector.cpp :language: c++ :dedent: 8 :start-after: update/start :end-before: update/end

Definition at line 269 of file vector.hpp.

References immer::vector< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rbtree< T, MemoryPolicy, B, BL >::update().

◆ update() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
template<typename FnT >
decltype(auto) immer::vector< T, MemoryPolicy, B, BL >::update ( size_type  index,
FnT &&  fn 
) &&
inline

◆ update_move() [1/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
template<typename Fn >
vector&& immer::vector< T, MemoryPolicy, B, BL >::update_move ( std::true_type  ,
size_type  index,
Fn &&  fn 
)
inlineprivate

◆ update_move() [2/2]

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
template<typename Fn >
vector immer::vector< T, MemoryPolicy, B, BL >::update_move ( std::false_type  ,
size_type  index,
Fn &&  fn 
)
inlineprivate

Member Data Documentation

◆ bits

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
constexpr auto immer::vector< T, MemoryPolicy, B, BL >::bits = B
static

Definition at line 83 of file vector.hpp.

◆ bits_leaf

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
constexpr auto immer::vector< T, MemoryPolicy, B, BL >::bits_leaf = BL
static

Definition at line 84 of file vector.hpp.

◆ flex_t

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
friend immer::vector< T, MemoryPolicy, B, BL >::flex_t
private

Definition at line 316 of file vector.hpp.

◆ impl_

◆ transient_type

template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
friend immer::vector< T, MemoryPolicy, B, BL >::transient_type
private

Definition at line 317 of file vector.hpp.


The documentation for this class was generated from the following files:
Released under the MIT license