macro_rules! aligned { ($align:ty, $e_ty:ty, $e:expr) => { ... }; }
Expand description
Returns a static reference of the expression $e
with requested alignment.
Unfortunately it is required to specify the type of the expression $e
because it is stored in a static
.
ยงExamples
use align_data::{aligned, Align16};
let five = aligned!(Align16, i32, 5);
assert_eq!(five as *const _ as usize % 0x10, 0);