Describes the layout of a block of memory.
Layouts are passed to allocators, and consist of a (possibly padded) size and a power-of-two alignment no larger than the size. Layouts can be constructed for a type T using Layout::Of.
Example:
Public Member Functions | |
| constexpr | Layout (size_t size) |
| constexpr | Layout (size_t size, size_t alignment) |
| constexpr Layout | Extend (size_t size) const |
| constexpr Layout | Align (size_t alignment) const |
| constexpr size_t | size () const |
| constexpr size_t | alignment () const |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr std::enable_if_t<!std::is_array_v< T >, Layout > | Of () |
| Creates a Layout for the given type. | |
| template<typename T > | |
| static constexpr std::enable_if_t< internal::is_bounded_array_v< T >, Layout > | Of () |
| Creates a Layout for the given bounded array type, e.g. Foo[kN]. | |
| template<typename T > | |
| static constexpr std::enable_if_t< internal::is_unbounded_array_v< T >, Layout > | Of (size_t count) |
| Creates a Layout for the given array type, e.g. Foo[]. | |
| static constexpr Layout | Unwrap (const Result< Layout > &result) |
|
inlinestaticconstexpr |
If the result is okay, returns its contained layout; otherwise, returns a default layout.