Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <array.hpp>
Public Types | |
using | value_type = T |
using | reference = const T & |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | const_reference = const T & |
using | iterator = const T * |
using | const_iterator = iterator |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | memory_policy = MemoryPolicy |
using | persistent_type = array< T, MemoryPolicy > |
Public Member Functions | |
array_transient ()=default | |
iterator | begin () const |
iterator | end () const |
reverse_iterator | rbegin () const |
reverse_iterator | rend () const |
std::size_t | size () const |
bool | empty () const |
const T * | data () const |
const T & | back () const |
const T & | front () const |
reference | operator[] (size_type index) const |
reference | at (size_type index) const |
void | push_back (value_type value) |
void | set (size_type index, value_type value) |
template<typename FnT > | |
void | update (size_type index, FnT &&fn) |
void | take (size_type elems) |
persistent_type | persistent () & |
persistent_type | persistent () && |
Private Types | |
using | impl_t = detail::arrays::with_capacity< T, MemoryPolicy > |
using | impl_no_capacity_t = detail::arrays::no_capacity< T, MemoryPolicy > |
using | owner_t = typename MemoryPolicy::transience_t::owner |
Private Member Functions | |
array_transient (impl_t impl) | |
Private Attributes | |
friend | persistent_type |
impl_t | impl_ = impl_t::empty |
Detailed Description
template<typename T, typename MemoryPolicy = default_memory_policy>
class immer::array_transient< T, MemoryPolicy >
Mutable version of immer::array
.
Refer to :doc:transients
to learn more about when and how to use the mutable versions of immutable containers.
Member Typedef Documentation
◆ const_iterator
using immer::array_transient< T, MemoryPolicy >::const_iterator = iterator |
Definition at line 45 of file array_transient.hpp.
◆ const_reference
using immer::array_transient< T, MemoryPolicy >::const_reference = const T& |
Definition at line 42 of file array_transient.hpp.
◆ difference_type
using immer::array_transient< T, MemoryPolicy >::difference_type = std::ptrdiff_t |
Definition at line 41 of file array_transient.hpp.
◆ impl_no_capacity_t
|
private |
Definition at line 34 of file array_transient.hpp.
◆ impl_t
|
private |
Definition at line 33 of file array_transient.hpp.
◆ iterator
using immer::array_transient< T, MemoryPolicy >::iterator = const T* |
Definition at line 44 of file array_transient.hpp.
◆ memory_policy
using immer::array_transient< T, MemoryPolicy >::memory_policy = MemoryPolicy |
Definition at line 48 of file array_transient.hpp.
◆ owner_t
|
private |
Definition at line 35 of file array_transient.hpp.
◆ persistent_type
using immer::array_transient< T, MemoryPolicy >::persistent_type = array<T, MemoryPolicy> |
Definition at line 49 of file array_transient.hpp.
◆ reference
using immer::array_transient< T, MemoryPolicy >::reference = const T& |
Definition at line 39 of file array_transient.hpp.
◆ reverse_iterator
using immer::array_transient< T, MemoryPolicy >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 46 of file array_transient.hpp.
◆ size_type
using immer::array_transient< T, MemoryPolicy >::size_type = std::size_t |
Definition at line 40 of file array_transient.hpp.
◆ value_type
using immer::array_transient< T, MemoryPolicy >::value_type = T |
Definition at line 38 of file array_transient.hpp.
Constructor & Destructor Documentation
◆ array_transient() [1/2]
|
default |
Default constructor. It creates a mutable array of size() == 0
. It does not allocate memory and its complexity is .
◆ array_transient() [2/2]
|
inlineprivate |
Definition at line 180 of file array_transient.hpp.
Member Function Documentation
◆ at()
|
inline |
Returns a const
reference to the element at position index
. It throws an std::out_of_range
exception when . It does not allocate memory and its complexity is effectively .
Definition at line 127 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::get_check(), and immer::array_transient< T, MemoryPolicy >::impl_.
◆ back()
|
inline |
Access the last element.
Definition at line 105 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::data(), and immer::array_transient< T, MemoryPolicy >::size().
◆ begin()
|
inline |
Returns an iterator pointing at the first element of the collection. It does not allocate memory and its complexity is .
Definition at line 63 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::data(), and immer::array_transient< T, MemoryPolicy >::impl_.
Referenced by immer::array_transient< T, MemoryPolicy >::rend().
◆ data()
|
inline |
Access the raw data.
Definition at line 100 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::data(), and immer::array_transient< T, MemoryPolicy >::impl_.
Referenced by immer::array_transient< T, MemoryPolicy >::back(), and immer::array_transient< T, MemoryPolicy >::front().
◆ empty()
|
inline |
Returns true
if there are no elements in the container. It does not allocate memory and its complexity is .
Definition at line 95 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::empty(), and immer::array_transient< T, MemoryPolicy >::impl_.
◆ end()
|
inline |
Returns an iterator pointing just after the last element of the collection. It does not allocate and its complexity is .
Definition at line 69 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::data(), immer::array_transient< T, MemoryPolicy >::impl_, and immer::detail::arrays::with_capacity< T, MemoryPolicy >::size.
Referenced by immer::array_transient< T, MemoryPolicy >::rbegin().
◆ front()
|
inline |
Access the first element.
Definition at line 110 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::data().
◆ operator[]()
|
inline |
Returns a const
reference to the element at position index
. It is undefined when . It does not allocate memory and its complexity is effectively .
Definition at line 118 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::get(), and immer::array_transient< T, MemoryPolicy >::impl_.
◆ persistent() [1/2]
|
inline |
Returns an immutable form of this container, an immer::array
.
Definition at line 169 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_.
◆ persistent() [2/2]
|
inline |
Definition at line 174 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_.
◆ push_back()
|
inline |
Inserts value
at the end. It may allocate memory and its complexity is effectively .
Definition at line 134 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_, and immer::detail::arrays::with_capacity< T, MemoryPolicy >::push_back_mut().
◆ rbegin()
|
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 .
Definition at line 76 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::end().
◆ rend()
|
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 .
Definition at line 83 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::begin().
◆ set()
|
inline |
Sets to the value value
at position idx
. Undefined for index >= size()
. It may allocate memory and its complexity is effectively .
Definition at line 143 of file array_transient.hpp.
References immer::detail::arrays::with_capacity< T, MemoryPolicy >::assoc_mut(), and immer::array_transient< T, MemoryPolicy >::impl_.
◆ size()
|
inline |
Returns the number of elements in the container. It does not allocate memory and its complexity is .
Definition at line 89 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_, and immer::detail::arrays::with_capacity< T, MemoryPolicy >::size.
Referenced by immer::array_transient< T, MemoryPolicy >::back().
◆ take()
|
inline |
Resizes the array to only contain the first min(elems, size())
elements. It may allocate memory and its complexity is effectively .
Definition at line 162 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_, and immer::detail::arrays::with_capacity< T, MemoryPolicy >::take_mut().
◆ update()
|
inline |
Updates the array to contain the result of the expression fn((*this)[idx])
at position idx
. Undefined for 0 >= size()
. It may allocate memory and its complexity is effectively .
Definition at line 154 of file array_transient.hpp.
References immer::array_transient< T, MemoryPolicy >::impl_, and immer::detail::arrays::with_capacity< T, MemoryPolicy >::update_mut().
Member Data Documentation
◆ impl_
|
private |
Definition at line 184 of file array_transient.hpp.
Referenced by immer::array_transient< T, MemoryPolicy >::at(), immer::array_transient< T, MemoryPolicy >::begin(), immer::array_transient< T, MemoryPolicy >::data(), immer::array_transient< T, MemoryPolicy >::empty(), immer::array_transient< T, MemoryPolicy >::end(), immer::array_transient< T, MemoryPolicy >::operator[](), immer::array_transient< T, MemoryPolicy >::persistent(), immer::array_transient< T, MemoryPolicy >::push_back(), immer::array_transient< T, MemoryPolicy >::set(), immer::array_transient< T, MemoryPolicy >::size(), immer::array_transient< T, MemoryPolicy >::take(), and immer::array_transient< T, MemoryPolicy >::update().
◆ persistent_type
|
private |
Definition at line 178 of file array_transient.hpp.
The documentation for this class was generated from the following files:
- src/immer/array.hpp
- src/immer/array_transient.hpp