Template Class Storage#
Defined in File storage.hpp
Class Documentation#
-
template<typename Scalar_, typename Allocator_ = std::allocator<Scalar_>>
class Storage# Public Types
-
using Allocator = Allocator_#
-
using ConstIterator = ConstPointer#
-
using ConstReverseIterator = std::reverse_iterator<ConstIterator>#
Public Functions
-
Storage() = default#
Default constructor.
-
explicit Storage(SizeType size, const Allocator &alloc = Allocator())#
Create a Storage object with
size
elements and, optionally, a custom allocator.- Parameters
size – Number of elements to allocate
alloc – Allocator to use
-
Storage(SizeType size, ConstReference value, const Allocator &alloc = Allocator())#
Create a Storage object with
size
elements, each initialized tovalue
. Optionally, a custom allocator can be used.- Parameters
size – Number of elements to allocate
value – Value to initialize each element to
alloc – Allocator to use
-
Storage(const Storage &other, const Allocator &alloc = Allocator())#
Create a Storage object from another Storage object. Additionally a custom allocator can be used.
- Parameters
other – Storage object to copy
alloc – Allocator to use
-
Storage(Storage &&other) noexcept#
Move a Storage object into this object.
- Parameters
other – Storage object to move
-
template<typename V>
Storage(const std::initializer_list<V> &list, const Allocator &alloc = Allocator())# Create a Storage object from an std::initializer_list
- Template Parameters
V – Type of the elements in the initializer list
- Parameters
list – Initializer list to copy
alloc – Allocator to use
-
template<typename V>
explicit Storage(const std::vector<V> &vec, const Allocator &alloc = Allocator())# Create a Storage object from a std::vector
- Template Parameters
V – Type of the elements in the vector
- Parameters
vec – Vector to copy
alloc – Allocator to use
-
Storage &operator=(const Storage &other)#
Assignment operator for a Storage object
- Parameters
other – Storage object to copy
- Returns
*this
- Storage & operator= (Storage &&other) LIBRAPID_RELEASE_NOEXCEPT
Move assignment operator for a Storage object
- Parameters
other – Storage object to move
- Returns
*this
-
void resize(SizeType newSize)#
Resize a Storage object to
size
elements. Existing elements are preserved.- Parameters
size – New size of the Storage object
-
void resize(SizeType newSize, int)#
Resize a Storage object to
size
elements. Existing elements are not preserved- Parameters
size – New size of the Storage object
-
ConstReference operator[](SizeType index) const#
Const access to the element at index
index
- Parameters
index – Index of the element to access
- Returns
Const reference to the element at index
index
-
Reference operator[](SizeType index)#
Access to the element at index
index
- Parameters
index – Index of the element to access
- Returns
Reference to the element at index
index
-
ConstIterator begin() const noexcept#
-
ConstIterator end() const noexcept#
-
ConstIterator cbegin() const noexcept#
-
ConstIterator cend() const noexcept#
-
ReverseIterator rbegin() noexcept#
-
ReverseIterator rend() noexcept#
-
ConstReverseIterator rbegin() const noexcept#
-
ConstReverseIterator rend() const noexcept#
-
ConstReverseIterator crbegin() const noexcept#
-
ConstReverseIterator crend() const noexcept#
-
using Allocator = Allocator_#