alignForSize

Order the provided members to minimize size while preserving alignment. Alignment is not always optimal for 80-bit reals, nor for structs declared as align(1).

string
alignForSize
(
E...
)
(
const char[][] names...
)

Parameters

E

A list of the types to be aligned, representing fields of an aggregate such as a struct or class.

names char[][]

The names of the fields that are to be aligned.

Return Value

Type: string

A string to be mixed in to an aggregate, such as a struct or class.

Examples

struct Banner {
    mixin(alignForSize!(byte[6], double)(["name", "height"]));
}

Meta

Suggestion Box / Bug Report