FixedDeque is a Deque that owns its statically allocated buffer.
This FixedDeque statically allocates its storage buffer internally. Similar to InlineDeque, the capacity is specified as a template parameter. Unlike InlineDeque, FixedDeque is usable as a generic Deque.
If the capacity is omitted (or set to containers::kAllocatedStorage), the dynamic specialization is used. Whether statically or dynamically allocated, the capacity never changes.
Public Member Functions | |
| constexpr | FixedDeque () |
| FixedDeque (FixedDeque &&other) noexcept | |
| FixedDeque & | operator= (FixedDeque &&other) noexcept |
| template<size_t kOtherCapacity> | |
| MoveItemsFrom (other) | |
| template<size_t kOtherCapacity> | |
| clear () | |
| this | MoveItemsFrom (other) |
| template<size_t kOtherCapacity> | |
| void | swap (FixedDeque< T, kOtherCapacity, SizeType > &other) |
Public Member Functions inherited from pw::Deque< T, SizeType > | |
| constexpr | Deque (span< std::byte > buffer) noexcept |
| template<size_t kAlignment, size_t kSizeBytes> | |
| constexpr | Deque (containers::Storage< kAlignment, kSizeBytes > &buffer) noexcept |
| Deque (const Deque &)=delete | |
| Copying is not supported since it can fail. | |
| Deque & | operator= (const Deque &)=delete |
| Deque (Deque &&)=delete | |
| Move is not supported to avoid confusion about deque/buffer pairings. | |
| Deque & | operator= (Deque &&)=delete |
| constexpr size_type | max_size () const noexcept |
Public Member Functions inherited from pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType > | |
| GenericDeque (const GenericDeque &)=delete | |
| GenericDeque (GenericDeque &&)=delete | |
| GenericDeque & | operator= (const GenericDeque &)=delete |
| GenericDeque && | operator= (GenericDeque &&)=delete |
| void | assign (size_type count, const value_type &value) |
Sets the contents to count copies of value. Crashes if cannot fit. | |
| template<typename It , int & ..., typename = containers::internal::EnableIfInputIterator<It>> | |
| void | assign (It start, It finish) |
| void | assign (const std::initializer_list< value_type > &list) |
| Sets contents to copies of the items from the list. Crashes if cannot fit. | |
| constexpr reference | at (size_type index) |
| constexpr const_reference | at (size_type index) const |
| constexpr reference | operator[] (size_type index) |
| constexpr const_reference | operator[] (size_type index) const |
| constexpr reference | front () |
| constexpr const_reference | front () const |
| constexpr reference | back () |
| constexpr const_reference | back () const |
| constexpr std::pair< span< const value_type >, span< const value_type > > | contiguous_data () const |
| Provides access to the valid data in a contiguous form. | |
| constexpr std::pair< span< value_type >, span< value_type > > | contiguous_data () |
| constexpr iterator | begin () noexcept |
| constexpr const_iterator | begin () const noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| constexpr iterator | end () noexcept |
| constexpr const_iterator | end () const noexcept |
| constexpr const_iterator | cend () const noexcept |
| constexpr void | clear () |
| iterator | erase (const_iterator pos) |
Erases the item at pos, which must be a dereferenceable iterator. | |
| iterator | erase (const_iterator first, const_iterator last) |
| void | push_back (const value_type &value) |
| void | push_back (value_type &&value) |
| template<typename... Args> | |
| void | emplace_back (Args &&... args) |
| void | pop_back () |
| void | push_front (const value_type &value) |
| void | push_front (value_type &&value) |
| template<typename... Args> | |
| void | emplace_front (Args &&... args) |
| void | pop_front () |
| template<typename... Args> | |
| iterator | emplace (const_iterator pos, Args &&... args) |
| iterator | insert (const_iterator pos, const value_type &value) |
| iterator | insert (const_iterator pos, value_type &&value) |
| iterator | insert (const_iterator pos, size_type count, const value_type &value) |
| template<typename InputIt , typename = containers::internal::EnableIfInputIterator<InputIt>> | |
| iterator | insert (const_iterator pos, InputIt first, InputIt last) |
| iterator | insert (const_iterator pos, std::initializer_list< value_type > ilist) |
| void | resize (size_type new_size) |
| void | resize (size_type new_size, const value_type &value) |
| template<typename... Args> | |
| std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > | try_emplace (const_iterator pos, Args &&... args) |
| template<typename ForwardIt , typename > | |
| std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > | try_insert (const_iterator pos, ForwardIt first, ForwardIt last) |
| template<typename... Args> | |
| std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > | try_emplace_shift_right (const_iterator pos, Args &&... args) |
| template<typename ForwardIt , typename > | |
| std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > | try_insert_shift_right (const_iterator pos, ForwardIt first, ForwardIt last) |
| constexpr size_type | capacity () const noexcept |
| Returns the maximum number of elements in the deque. | |
| constexpr bool | empty () const noexcept |
| constexpr size_type | size () const noexcept |
| Returns the number of elements in the deque. | |
Public Member Functions inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType > | |
| constexpr bool | empty () const noexcept |
| constexpr bool | full () const noexcept |
| constexpr size_type | size () const noexcept |
| Returns the number of elements in the deque. | |
| constexpr size_type | capacity () const noexcept |
| Returns the maximum number of elements in the deque. | |
Public Attributes | |
| return * | this |
Additional Inherited Members | |
Public Types inherited from pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType > | |
| using | value_type = ValueType |
| using | size_type = typename CountAndCapacityType::size_type |
| using | difference_type = ptrdiff_t |
| using | reference = value_type & |
| using | const_reference = const value_type & |
| using | pointer = value_type * |
| using | const_pointer = const value_type * |
| using | iterator = containers::internal::DequeIterator< Derived > |
| using | const_iterator = containers::internal::DequeIterator< const Derived > |
Public Types inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType > | |
| using | size_type = typename CountAndCapacityType::size_type |
Protected Member Functions inherited from pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType > | |
| constexpr | GenericDeque (size_type initial_capacity) noexcept |
| constexpr void | DestroyAll () |
| Derived & | operator= (const std::initializer_list< value_type > &list) |
| template<typename T , typename = containers::internal::EnableIfIterable<T>> | |
| Derived & | operator= (const T &other) |
| bool | try_assign (size_type count, const value_type &value) |
| template<typename It , int & ..., typename = containers::internal::EnableIfForwardIterator<It>> | |
| bool | try_assign (It start, It finish) |
| bool | try_assign (const std::initializer_list< value_type > &list) |
| template<typename... Args> | |
| std::optional< iterator > | try_emplace (const_iterator pos, Args &&... args) |
| std::optional< iterator > | try_insert (const_iterator pos, const value_type &value) |
| std::optional< iterator > | try_insert (const_iterator pos, value_type &&value) |
| std::optional< iterator > | try_insert (const_iterator pos, size_type count, const value_type &value) |
| template<typename ForwardIt , typename = containers::internal::EnableIfForwardIterator<ForwardIt>> | |
| std::optional< iterator > | try_insert (const_iterator pos, ForwardIt first, ForwardIt last) |
| std::optional< iterator > | try_insert (const_iterator pos, std::initializer_list< value_type > ilist) |
| bool | try_push_back (const value_type &value) |
| bool | try_push_back (value_type &&value) |
| template<typename... Args> | |
| bool | try_emplace_back (Args &&... args) |
| bool | try_push_front (const value_type &value) |
| bool | try_push_front (value_type &&value) |
| template<typename... Args> | |
| bool | try_emplace_front (Args &&... args) |
| bool | try_resize (size_type new_size) |
| bool | try_resize (size_type new_size, const value_type &value) |
| template<typename... Args> | |
| std::optional< iterator > | try_emplace_shift_right (const_iterator pos, Args &&... args) |
| std::optional< iterator > | try_insert_shift_right (const_iterator pos, size_type count, const value_type &value) |
| template<typename ForwardIt , typename = containers::internal::EnableIfForwardIterator<ForwardIt>> | |
| std::optional< iterator > | try_insert_shift_right (const_iterator pos, ForwardIt first, ForwardIt last) |
Protected Member Functions inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType > | |
| CountAndCapacityType & | count_and_capacity () noexcept |
| constexpr void | MoveAssignIndices (GenericDequeBase &other) noexcept |
| void | SwapIndices (GenericDequeBase &other) noexcept |
| bool | CanExtendBuffer () const |
| bool | CanShrinkBuffer () const |
| void | HandleNewBuffer (size_type new_capacity) |
| void | HandleExtendedBuffer (size_type new_capacity) |
| void | HandleShrunkBuffer (size_type new_capacity) |