Return whether the specified address is aligned to the given boundary.
Declared in <bsls_alignmentutil.h>
static
bool
isAligned(
void const* address,
std::size_t alignment);
Return true if the specified address is aligned on the specified alignment boundary (i.e., the numerical value of address is evenly divisible by alignment), and false otherwise. The behavior is undefined unless alignment is a power of 2. Note that this function will true for a null address, regardless of alignment and for a 0 alignment regardless of address.
true if address is aligned to alignment, else false
| Name | Description |
|---|---|
| address | pointer whose alignment is tested |
| alignment | alignment boundary, a power of 2 |