C/C++ API Reference
Loading...
Searching...
No Matches
pw::containers::Storage< kAlignment, kSizeBytes > Class Template Reference

Overview

template<size_t kAlignment, size_t kSizeBytes>
class pw::containers::Storage< kAlignment, kSizeBytes >

Declares aligned storage as a std::byte array.

Storage provides aligned external storage for containers such as pw::Deque, avoiding the need for alignment checks.

Note that sizeof(Storage) may be larger than kSizeBytes due to padding for alignment.

Template Parameters
kAlignmentHow to align the storage; must be valid for use as alignas(kAlignment).
kSizeBytesStorage size.

Public Types

using value_type = std::byte
 
using size_type = size_t
 
using pointer = value_type *
 
using const_pointer = const value_type *
 

Public Member Functions

 Storage (const Storage &)=delete
 
Storageoperator= (const Storage &)=delete
 
 Storage (Storage &&)=delete
 
Storageoperator= (Storage &&)=delete
 
constexpr pointer data ()
 
constexpr const_pointer data () const
 
constexpr size_type size () const
 The size of the storage in bytes.
 
constexpr bool empty () const
 
constexpr void fill (std::byte value)
 

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