[#BloombergLP-bsls-Alignment] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::Alignment :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for enumerating the set of strategies for aligning arbitrary blocks of memory. == Synopsis Declared in `<bsls_alignment.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct Alignment; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/Alignment/Align.adoc[`Align`] | `struct` with most stringent alignment requirement. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/Alignment/MaxAlignedType.adoc[`MaxAlignedType`] | Primitive type with most stringent alignment requirement. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/Alignment/_04enum.adoc[`Unnamed enum`] | Define the minimum alignment that satisfies all types. | xref:BloombergLP/bsls/Alignment/Strategy.adoc[`Strategy`] | Types of alignment strategy. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/Alignment/calculateAlignmentFromSize.adoc[`calculateAlignmentFromSize`] | Calculate a usable alignment for an object of the specified `size`. | xref:BloombergLP/bsls/Alignment/calculateAlignmentOffset.adoc[`calculateAlignmentOffset`] | Return the byte offset needed to align the specified `address`. | xref:BloombergLP/bsls/Alignment/is2ByteAligned.adoc[`is2ByteAligned`] | Return `true` if the specified `address` is aligned on a 2‐byte boundary (i.e., the integer value of `address` is divisible by 2), and `false` otherwise. | xref:BloombergLP/bsls/Alignment/is4ByteAligned.adoc[`is4ByteAligned`] | Return `true` if the specified `address` is aligned on a 4‐byte boundary (i.e., the integer value of `address` is divisible by 4), and `false` otherwise. | xref:BloombergLP/bsls/Alignment/is8ByteAligned.adoc[`is8ByteAligned`] | Return `true` if the specified `address` is aligned on an 8‐byte boundary (i.e., the integer value of `address` is divisible by 8), and `false` otherwise. | xref:BloombergLP/bsls/Alignment/toAscii.adoc[`toAscii`] | Return the string representation of the specified enumerator `value`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#