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:
struct MyStruct {
uint8_t field1[3];
uint32_t field2[3];
};
constexpr Layout layout_for_struct = Layout::Of<MyStruct>();
|
|
template<typename T , std::enable_if_t<!std::is_array_v< T >, int > = 0> |
| static constexpr Layout | Of () |
| | Creates a Layout for the given type.
|
| |
|
template<typename T , std::enable_if_t< is_bounded_array_v< T >, int > = 0> |
| static constexpr Layout | Of () |
| | Creates a Layout for the given bounded array type, e.g. Foo[kN].
|
| |
|
template<typename T , std::enable_if_t< is_unbounded_array_v< T >, int > = 0> |
| static constexpr Layout | Of (size_t count) |
| | Creates a Layout for the given array type, e.g. Foo[].
|
| |
| static constexpr Layout | Unwrap (const Result< Layout > &result) |
| |