Type Alias Simd

Source
pub type Simd<T, const N: usize> = <T as HasVector<N>>::Vector;
Expand description

An alternative way of naming SIMD types.

This allows for functions to be written which are generic in the type or length of a vector.

ยงExample

type MyVector = Simd<u8, 16>; // The same as U8x16.

fn my_length_generic_code<const N: usize>(x: Simd<u32, N>, y: Simd<u32, N>) -> Simd<u32, N>
    where u32: HasVector<N>
{
    x + x + y
}