arrayref::array_refs!
[−]
[src]
macro_rules! array_refs { ( $arr:expr, $( $len:expr ),* ) => {{ { #[inline] #[allow(unused_assignments)] unsafe fn as_arrays<T>(a: &[T; $( $len + )* 0 ] ) -> ( $( &[T; $len], )* ) { let mut p = a.as_ptr() as *const T; ( $( { let aref = &*(p as *const [T; $len]); p = p.offset($len); aref } ),* ) } let input = $arr; unsafe { as_arrays(input) } } }} }
You can use array_refs
to generate a series of array references
to an input array reference. The idea is if you want to break an
array into a series of contiguous and non-overlapping arrays.