Pigweed
|
#include <layout.h>
Public Member Functions | |
constexpr | Layout (size_t size) |
constexpr | Layout (size_t size, size_t alignment) |
constexpr Layout | Extend (size_t size) const |
constexpr size_t | size () const |
constexpr size_t | alignment () const |
Static Public Member Functions | |
template<typename T > | |
static constexpr Layout | Of () |
Creates a Layout for the given type. | |
static constexpr Layout | Unwrap (const Result< Layout > &result) |
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:
|
inlinestaticconstexpr |
If the result is okay, returns its contained layout; otherwise, returns a default layout.