StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Deque< T > Class Template Referencefinal

Double-ended sequence stored on Base's heap. More...

#include <StormByte/safe/deque.hxx>

Public Types

using value_type = T
 Element type.
using size_type = Size
 Element count. Size, not std::size_t.
using difference_type = std::ptrdiff_t
 Iterator distance type.
using reference = T&
 Mutable element reference.
using const_reference = const T&
 Read-only element reference.
using pointer = T*
 Mutable element pointer.
using const_pointer = const T*
 Read-only element pointer.
using reverse_iterator = std::reverse_iterator<iterator>
 Mutable reverse iterator.
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 Read-only reverse iterator.

Public Member Functions

 Deque () noexcept
 Construct an empty deque.
 Deque (size_type count, const T &value)
 Construct count copies of value.
 Deque (size_type count)
 Construct count value-initialized elements.
template<std::input_iterator InputIt>
 Deque (InputIt first, InputIt last)
 Copy the range [first, last).
 Deque (std::initializer_list< T > values)
 Construct from an initializer list.
 Deque (const std::deque< T > &values)
 Copy a caller-owned STL deque.
STORMBYTE_FORCE_INLINE Deque (std::deque< T > &&values)
 Move elements from a caller-owned STL deque and leave it empty.
 Deque (const Deque &other)
 Copy every element into new Base blocks.
 Deque (Deque &&other) noexcept
 Take the blocks.
 ~Deque () noexcept
 Destroy every element and release the blocks.
Deque & operator= (const Deque &other)
 Copy-assign.
Deque & operator= (Deque &&other) noexcept
 Move-assign.
Deque & operator= (std::initializer_list< T > values)
 Replace the contents with an initializer list.
Deque & operator= (const std::deque< T > &values)
 Copy-assign a caller-owned STL deque.
STORMBYTE_FORCE_INLINE Deque & operator= (std::deque< T > &&values)
 Move-assign elements from a caller-owned STL deque and leave it empty.
void assign (size_type count, const T &value)
 Replace the contents with count copies of value.
template<std::input_iterator InputIt>
void assign (InputIt first, InputIt last)
 Replace the contents with the range [first, last).
void assign (std::initializer_list< T > values)
 Replace the contents with an initializer list.
template<std::ranges::input_range R>
void assign_range (R &&range)
 Replace the contents with a range.
reference at (size_type index)
 Access an element.
const_reference at (size_type index) const
 Access an element.
reference operator[] (size_type index) noexcept
 Access an element.
const_reference operator[] (size_type index) const noexcept
 Access an element.
reference front ()
 Return the first element.
const_reference front () const
 Return the first element.
reference back ()
 Return the last element.
const_reference back () const
 Return the last element.
iterator begin () noexcept
 Return a mutable iterator to the first element.
iterator end () noexcept
 Return the mutable end iterator.
const_iterator begin () const noexcept
 Return a read-only iterator to the first element.
const_iterator end () const noexcept
 Return the read-only end iterator.
const_iterator cbegin () const noexcept
 Return a read-only iterator to the first element.
const_iterator cend () const noexcept
 Return the read-only end iterator.
STORMBYTE_FORCE_INLINE reverse_iterator rbegin () noexcept
 Return a mutable reverse iterator to the last element.
STORMBYTE_FORCE_INLINE reverse_iterator rend () noexcept
 Return the mutable reverse end iterator.
STORMBYTE_FORCE_INLINE const_reverse_iterator rbegin () const noexcept
 Return a read-only reverse iterator to the last element.
STORMBYTE_FORCE_INLINE const_reverse_iterator rend () const noexcept
 Return the read-only reverse end iterator.
STORMBYTE_FORCE_INLINE const_reverse_iterator crbegin () const noexcept
 Return a read-only reverse iterator to the last element.
STORMBYTE_FORCE_INLINE const_reverse_iterator crend () const noexcept
 Return the read-only reverse end iterator.
bool empty () const noexcept
 Test whether the deque is empty.
size_type size () const noexcept
 Return the element count.
STORMBYTE_FORCE_INLINE size_type max_size () const noexcept
 Return the largest representable element count.
void shrink_to_fit ()
 Release unused blocks.
void clear () noexcept
 Destroy every element.
iterator insert (const_iterator position, const T &value)
 Insert a copy before position.
iterator insert (const_iterator position, T &&value)
 Insert a moved value before position.
iterator insert (const_iterator position, size_type count, const T &value)
 Insert count copies before position.
template<std::input_iterator InputIt>
iterator insert (const_iterator position, InputIt first, InputIt last)
 Insert the range [first, last) before position.
iterator insert (const_iterator position, std::initializer_list< T > values)
 Insert an initializer list before position.
template<std::ranges::input_range R>
iterator insert_range (const_iterator position, R &&range)
 Insert a range before position.
template<typename... Args>
iterator emplace (const_iterator position, Args &&... args)
 Construct an element before position.
iterator erase (const_iterator position)
 Destroy the element at position.
iterator erase (const_iterator first, const_iterator last)
 Destroy the half-open range [first, last).
void push_back (const T &value)
 Append a copy.
void push_back (T &&value)
 Append a moved value.
template<typename... Args>
reference emplace_back (Args &&... args)
 Construct an element at the back.
void pop_back ()
 Destroy the last element.
void push_front (const T &value)
 Prepend a copy.
void push_front (T &&value)
 Prepend a moved value.
template<typename... Args>
reference emplace_front (Args &&... args)
 Construct an element at the front.
void pop_front ()
 Destroy the first element.
template<std::ranges::input_range R>
void append_range (R &&range)
 Append a range.
template<std::ranges::input_range R>
void prepend_range (R &&range)
 Prepend a range.
void resize (size_type count)
 Change the element count.
void resize (size_type count, const T &value)
 Change the element count.
void swap (Deque &other) noexcept
 Exchange blocks.
STORMBYTE_FORCE_INLINE operator std::deque< T > () const
 Copy into a caller-owned std::deque.

Detailed Description

template<Type::SafeValue T>
class StormByte::Safe::Deque< T >

Double-ended sequence stored on Base's heap.

Template Parameters
TSafe value.

Not an alias of std::deque. There is no allocator parameter. A move from std::deque copies the elements onto Base's heap and clears the source. It does not steal its buffer. Conversion back is explicit and born in the caller.

Member Typedef Documentation

◆ const_pointer

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::const_pointer = const T*

Read-only element pointer.

◆ const_reference

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::const_reference = const T&

Read-only element reference.

◆ const_reverse_iterator

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Read-only reverse iterator.

◆ difference_type

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::difference_type = std::ptrdiff_t

Iterator distance type.

◆ pointer

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::pointer = T*

Mutable element pointer.

◆ reference

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::reference = T&

Mutable element reference.

◆ reverse_iterator

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::reverse_iterator = std::reverse_iterator<iterator>

Mutable reverse iterator.

◆ size_type

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::size_type = Size

Element count. Size, not std::size_t.

◆ value_type

template<Type::SafeValue T>
using StormByte::Safe::Deque< T >::value_type = T

Element type.

Constructor & Destructor Documentation

◆ Deque() [1/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( )
noexcept

Construct an empty deque.

◆ Deque() [2/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( size_type count,
const T & value )

Construct count copies of value.

Parameters
countElement count.
valueValue to copy.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [3/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( size_type count)
explicit

Construct count value-initialized elements.

Parameters
countElement count.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [4/9]

template<Type::SafeValue T>
template<std::input_iterator InputIt>
StormByte::Safe::Deque< T >::Deque ( InputIt first,
InputIt last )

Copy the range [first, last).

Template Parameters
InputItInput iterator whose value is convertible to T.
Parameters
firstStart of the source range.
lastEnd of the source range.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [5/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( std::initializer_list< T > values)

Construct from an initializer list.

Parameters
valuesInitial elements.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [6/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( const std::deque< T > & values)
explicit

Copy a caller-owned STL deque.

Its state is unchanged.

Parameters
valuesSource.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [7/9]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE StormByte::Safe::Deque< T >::Deque ( std::deque< T > && values)
inlineexplicit

Move elements from a caller-owned STL deque and leave it empty.

Parameters
valuesSource. Cleared before this function returns.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [8/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( const Deque< T > & other)

Copy every element into new Base blocks.

Parameters
otherSource.
Exceptions
AllocationErrorA block could not be allocated.

◆ Deque() [9/9]

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::Deque ( Deque< T > && other)
noexcept

Take the blocks.

other is left empty.

Parameters
otherSource.

◆ ~Deque()

template<Type::SafeValue T>
StormByte::Safe::Deque< T >::~Deque ( )
noexcept

Destroy every element and release the blocks.

Member Function Documentation

◆ append_range()

template<Type::SafeValue T>
template<std::ranges::input_range R>
void StormByte::Safe::Deque< T >::append_range ( R && range)

Append a range.

Template Parameters
RInput range whose value is convertible to T.
Parameters
rangeSource range.
Exceptions
AllocationErrorA block could not be allocated.

◆ assign() [1/3]

template<Type::SafeValue T>
template<std::input_iterator InputIt>
void StormByte::Safe::Deque< T >::assign ( InputIt first,
InputIt last )

Replace the contents with the range [first, last).

Template Parameters
InputItInput iterator whose value is convertible to T.
Parameters
firstStart of the source range.
lastEnd of the source range.
Exceptions
AllocationErrorA block could not be allocated.

◆ assign() [2/3]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::assign ( size_type count,
const T & value )

Replace the contents with count copies of value.

Parameters
countElement count.
valueValue to copy.
Exceptions
AllocationErrorA block could not be allocated.

◆ assign() [3/3]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::assign ( std::initializer_list< T > values)

Replace the contents with an initializer list.

Parameters
valuesNew elements.
Exceptions
AllocationErrorA block could not be allocated.

◆ assign_range()

template<Type::SafeValue T>
template<std::ranges::input_range R>
void StormByte::Safe::Deque< T >::assign_range ( R && range)

Replace the contents with a range.

Template Parameters
RInput range whose value is convertible to T.
Parameters
rangeSource range.
Exceptions
AllocationErrorA block could not be allocated.

◆ at() [1/2]

template<Type::SafeValue T>
reference StormByte::Safe::Deque< T >::at ( size_type index)

Access an element.

Parameters
indexElement index.
Returns
Element reference. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorindex is outside the deque.

◆ at() [2/2]

template<Type::SafeValue T>
const_reference StormByte::Safe::Deque< T >::at ( size_type index) const

Access an element.

Parameters
indexElement index.
Returns
Element reference. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorindex is outside the deque.

◆ back() [1/2]

template<Type::SafeValue T>
reference StormByte::Safe::Deque< T >::back ( )

Return the last element.

Returns
Last element. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorThe deque is empty.

◆ back() [2/2]

template<Type::SafeValue T>
const_reference StormByte::Safe::Deque< T >::back ( ) const

Return the last element.

Returns
Last element. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorThe deque is empty.

◆ begin() [1/2]

template<Type::SafeValue T>
const_iterator StormByte::Safe::Deque< T >::begin ( ) const
noexcept

Return a read-only iterator to the first element.

Returns
Read-only iterator.

◆ begin() [2/2]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::begin ( )
noexcept

Return a mutable iterator to the first element.

Returns
Mutable iterator.

◆ cbegin()

template<Type::SafeValue T>
const_iterator StormByte::Safe::Deque< T >::cbegin ( ) const
noexcept

Return a read-only iterator to the first element.

Returns
Read-only iterator.

◆ cend()

template<Type::SafeValue T>
const_iterator StormByte::Safe::Deque< T >::cend ( ) const
noexcept

Return the read-only end iterator.

Returns
End iterator.

◆ clear()

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::clear ( )
noexcept

Destroy every element.

Capacity is kept.

◆ crbegin()

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE const_reverse_iterator StormByte::Safe::Deque< T >::crbegin ( ) const
inlinenoexcept

Return a read-only reverse iterator to the last element.

Returns
Reverse iterator.

◆ crend()

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE const_reverse_iterator StormByte::Safe::Deque< T >::crend ( ) const
inlinenoexcept

Return the read-only reverse end iterator.

Returns
Reverse end iterator.

◆ emplace()

template<Type::SafeValue T>
template<typename... Args>
iterator StormByte::Safe::Deque< T >::emplace ( const_iterator position,
Args &&... args )

Construct an element before position.

Template Parameters
ArgsConstructor argument types.
Parameters
positionInsert position.
argsConstructor arguments.
Returns
Iterator to the inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ emplace_back()

template<Type::SafeValue T>
template<typename... Args>
reference StormByte::Safe::Deque< T >::emplace_back ( Args &&... args)

Construct an element at the back.

Template Parameters
ArgsConstructor argument types.
Parameters
argsConstructor arguments.
Returns
The new element.
Exceptions
AllocationErrorA block could not be allocated.

◆ emplace_front()

template<Type::SafeValue T>
template<typename... Args>
reference StormByte::Safe::Deque< T >::emplace_front ( Args &&... args)

Construct an element at the front.

Template Parameters
ArgsConstructor argument types.
Parameters
argsConstructor arguments.
Returns
The new element.
Exceptions
AllocationErrorA block could not be allocated.

◆ empty()

template<Type::SafeValue T>
bool StormByte::Safe::Deque< T >::empty ( ) const
noexcept

Test whether the deque is empty.

Returns
Whether there are no elements.

◆ end() [1/2]

template<Type::SafeValue T>
const_iterator StormByte::Safe::Deque< T >::end ( ) const
noexcept

Return the read-only end iterator.

Returns
End iterator.

◆ end() [2/2]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::end ( )
noexcept

Return the mutable end iterator.

Returns
End iterator.

◆ erase() [1/2]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::erase ( const_iterator first,
const_iterator last )

Destroy the half-open range [first, last).

Parameters
firstFirst element to destroy.
lastOne past the last element to destroy.
Returns
Iterator following the destroyed range.

◆ erase() [2/2]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::erase ( const_iterator position)

Destroy the element at position.

Parameters
positionElement to destroy.
Returns
Iterator following the destroyed element.

◆ front() [1/2]

template<Type::SafeValue T>
reference StormByte::Safe::Deque< T >::front ( )

Return the first element.

Returns
First element. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorThe deque is empty.

◆ front() [2/2]

template<Type::SafeValue T>
const_reference StormByte::Safe::Deque< T >::front ( ) const

Return the first element.

Returns
First element. Valid until erasure of that element.
Exceptions
OutOfBoundsErrorThe deque is empty.

◆ insert() [1/5]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::insert ( const_iterator position,
const T & value )

Insert a copy before position.

Parameters
positionInsert position.
valueValue to copy.
Returns
Iterator to the inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ insert() [2/5]

template<Type::SafeValue T>
template<std::input_iterator InputIt>
iterator StormByte::Safe::Deque< T >::insert ( const_iterator position,
InputIt first,
InputIt last )

Insert the range [first, last) before position.

Template Parameters
InputItInput iterator whose value is convertible to T.
Parameters
positionInsert position.
firstStart of the source range.
lastEnd of the source range.
Returns
Iterator to the first inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ insert() [3/5]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::insert ( const_iterator position,
size_type count,
const T & value )

Insert count copies before position.

Parameters
positionInsert position.
countCopy count.
valueValue to copy.
Returns
Iterator to the first inserted element, or position when count is zero.
Exceptions
AllocationErrorA block could not be allocated.

◆ insert() [4/5]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::insert ( const_iterator position,
std::initializer_list< T > values )

Insert an initializer list before position.

Parameters
positionInsert position.
valuesSource elements.
Returns
Iterator to the first inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ insert() [5/5]

template<Type::SafeValue T>
iterator StormByte::Safe::Deque< T >::insert ( const_iterator position,
T && value )

Insert a moved value before position.

Parameters
positionInsert position.
valueValue to move.
Returns
Iterator to the inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ insert_range()

template<Type::SafeValue T>
template<std::ranges::input_range R>
iterator StormByte::Safe::Deque< T >::insert_range ( const_iterator position,
R && range )

Insert a range before position.

Template Parameters
RInput range whose value is convertible to T.
Parameters
positionInsert position.
rangeSource range.
Returns
Iterator to the first inserted element.
Exceptions
AllocationErrorA block could not be allocated.

◆ max_size()

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE size_type StormByte::Safe::Deque< T >::max_size ( ) const
inlinenoexcept

Return the largest representable element count.

Returns
Maximum element count for this element size.

◆ operator std::deque< T >()

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE StormByte::Safe::Deque< T >::operator std::deque< T > ( ) const
inlineexplicit

Copy into a caller-owned std::deque.

Returns
Caller-owned deque.

◆ operator=() [1/5]

template<Type::SafeValue T>
Deque & StormByte::Safe::Deque< T >::operator= ( const Deque< T > & other)

Copy-assign.

The previous blocks are released only after the copy exists.

Parameters
otherSource.
Returns
This deque.
Exceptions
AllocationErrorA block could not be allocated.

◆ operator=() [2/5]

template<Type::SafeValue T>
Deque & StormByte::Safe::Deque< T >::operator= ( const std::deque< T > & values)

Copy-assign a caller-owned STL deque.

Its state is unchanged.

Parameters
valuesSource.
Returns
This deque.
Exceptions
AllocationErrorA block could not be allocated.

◆ operator=() [3/5]

template<Type::SafeValue T>
Deque & StormByte::Safe::Deque< T >::operator= ( Deque< T > && other)
noexcept

Move-assign.

other is left empty.

Parameters
otherSource.
Returns
This deque.

◆ operator=() [4/5]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE Deque & StormByte::Safe::Deque< T >::operator= ( std::deque< T > && values)
inline

Move-assign elements from a caller-owned STL deque and leave it empty.

Parameters
valuesSource. Cleared before this function returns.
Returns
This deque.
Exceptions
AllocationErrorA block could not be allocated.

◆ operator=() [5/5]

template<Type::SafeValue T>
Deque & StormByte::Safe::Deque< T >::operator= ( std::initializer_list< T > values)

Replace the contents with an initializer list.

Parameters
valuesNew elements.
Returns
This deque.
Exceptions
AllocationErrorA block could not be allocated.

◆ operator[]() [1/2]

template<Type::SafeValue T>
const_reference StormByte::Safe::Deque< T >::operator[] ( size_type index) const
noexcept

Access an element.

Parameters
indexElement index.
Returns
Element reference. Valid until erasure of that element.

◆ operator[]() [2/2]

template<Type::SafeValue T>
reference StormByte::Safe::Deque< T >::operator[] ( size_type index)
noexcept

Access an element.

Parameters
indexElement index.
Returns
Element reference. Valid until erasure of that element.

◆ pop_back()

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::pop_back ( )

Destroy the last element.

◆ pop_front()

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::pop_front ( )

Destroy the first element.

◆ prepend_range()

template<Type::SafeValue T>
template<std::ranges::input_range R>
void StormByte::Safe::Deque< T >::prepend_range ( R && range)

Prepend a range.

Template Parameters
RInput range whose value is convertible to T.
Parameters
rangeSource range.
Exceptions
AllocationErrorA block could not be allocated.

◆ push_back() [1/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::push_back ( const T & value)

Append a copy.

Parameters
valueValue to copy.
Exceptions
AllocationErrorA block could not be allocated.

◆ push_back() [2/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::push_back ( T && value)

Append a moved value.

Parameters
valueValue to move.
Exceptions
AllocationErrorA block could not be allocated.

◆ push_front() [1/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::push_front ( const T & value)

Prepend a copy.

Parameters
valueValue to copy.
Exceptions
AllocationErrorA block could not be allocated.

◆ push_front() [2/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::push_front ( T && value)

Prepend a moved value.

Parameters
valueValue to move.
Exceptions
AllocationErrorA block could not be allocated.

◆ rbegin() [1/2]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE const_reverse_iterator StormByte::Safe::Deque< T >::rbegin ( ) const
inlinenoexcept

Return a read-only reverse iterator to the last element.

Returns
Reverse iterator.

◆ rbegin() [2/2]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE reverse_iterator StormByte::Safe::Deque< T >::rbegin ( )
inlinenoexcept

Return a mutable reverse iterator to the last element.

Returns
Reverse iterator.

◆ rend() [1/2]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE const_reverse_iterator StormByte::Safe::Deque< T >::rend ( ) const
inlinenoexcept

Return the read-only reverse end iterator.

Returns
Reverse end iterator.

◆ rend() [2/2]

template<Type::SafeValue T>
STORMBYTE_FORCE_INLINE reverse_iterator StormByte::Safe::Deque< T >::rend ( )
inlinenoexcept

Return the mutable reverse end iterator.

Returns
Reverse end iterator.

◆ resize() [1/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::resize ( size_type count)

Change the element count.

New elements are value-initialized.

Parameters
countNew element count.
Exceptions
AllocationErrorA block could not be allocated.

◆ resize() [2/2]

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::resize ( size_type count,
const T & value )

Change the element count.

New elements are copies of value.

Parameters
countNew element count.
valueValue copied into each new element.
Exceptions
AllocationErrorA block could not be allocated.

◆ shrink_to_fit()

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::shrink_to_fit ( )

Release unused blocks.

◆ size()

template<Type::SafeValue T>
size_type StormByte::Safe::Deque< T >::size ( ) const
noexcept

Return the element count.

Returns
Element count.

◆ swap()

template<Type::SafeValue T>
void StormByte::Safe::Deque< T >::swap ( Deque< T > & other)
noexcept

Exchange blocks.

Does not allocate.

Parameters
otherDeque to exchange with.

The documentation for this class was generated from the following file: