[#BloombergLP-bsls-AlignmentUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::AlignmentUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for a suite of compile&hyphen;time constants, types, and pure procedures that provide platform&hyphen;dependent alignment information&period;

== Synopsis

Declared in `&lt;bsls&lowbar;alignmentutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct AlignmentUtil;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/AlignmentUtil/MaxAlignedType.adoc[`MaxAlignedType`] 
| Alias for a primitive type that has the most stringent alignment requirement&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/AlignmentUtil/_04enum.adoc[`Unnamed enum`] 
| Maximum alignment supported on the current platform&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/AlignmentUtil/calculateAlignmentFromSize.adoc[`calculateAlignmentFromSize`] 
| Return the natural alignment for a memory block of the specified size&period;
| xref:BloombergLP/bsls/AlignmentUtil/calculateAlignmentOffset.adoc[`calculateAlignmentOffset`] 
| Return the offset needed to align the specified address&period;
| xref:BloombergLP/bsls/AlignmentUtil/defaultAlignmentOfAlignedStorage.adoc[`defaultAlignmentOfAlignedStorage`] 
| Return the default `std&colon;&colon;aligned&lowbar;storage` alignment for `t&lowbar;SIZE`&period;
| xref:BloombergLP/bsls/AlignmentUtil/is2ByteAligned.adoc[`is2ByteAligned`] 
| Return `true` if the specified `address` is aligned on a 2&hyphen;byte boundary (i&period;e&period;, the numerical value of `address` is evenly divisible by 2), and `false` otherwise&period;
| xref:BloombergLP/bsls/AlignmentUtil/is4ByteAligned.adoc[`is4ByteAligned`] 
| Return whether the specified `address` is aligned on a 4&hyphen;byte boundary&period;
| xref:BloombergLP/bsls/AlignmentUtil/is8ByteAligned.adoc[`is8ByteAligned`] 
| Return `true` if the specified `address` is aligned on an 8&hyphen;byte boundary (i&period;e&period;, the numerical value of `address` is evenly divisible by 8), and `false` otherwise&period;
| xref:BloombergLP/bsls/AlignmentUtil/isAligned.adoc[`isAligned`] 
| Return whether the specified address is aligned to the given boundary&period;
| xref:BloombergLP/bsls/AlignmentUtil/pointerAlignment.adoc[`pointerAlignment`] 
| Return the alignment of the specified `address`&period; Returns 0 if `address` is 0&period; Note that the returned value might be larger than `BSLS&lowbar;MAX&lowbar;ALIGNMENT`&period;
| xref:BloombergLP/bsls/AlignmentUtil/roundUpToMaximalAlignment.adoc[`roundUpToMaximalAlignment`] 
| Return the specified size rounded up to the maximum alignment&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `BloombergLP::bsls::AlignmentUtil::MaxAlignedUnion`
| 
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
