Skip to main content

## vec_insert

# Function vec_insert

Source

    pub unsafe fn vec_insert<T, const IDX: u32>(
        a: T,
        b: <T as VectorInsert>::Scalar,
    ) -> Twhere
        T: VectorInsert,

🔬This is a nightly-only experimental API. (`stdarch_powerpc` #111145)
Available on PowerPC and target feature `altivec` and (PowerPC or PowerPC64) only.
Expand description

Vector Insert

### §Purpose

Returns a copy of vector b with element c replaced by the value of a.

### §Result value

r contains a copy of vector b with element c replaced by the value of a. This function uses modular arithmetic on c to determine the element number. For example, if c is out of range, the compiler uses c modulo the number of elements in the vector to determine the element position.