[simd.permute.dynamic]

# 29 Numerics library [[numerics]](./#numerics)

## 29.10 Data-parallel types [[simd]](simd#permute.dynamic)

### 29.10.8 basic_vec non-member operations [[simd.nonmembers]](simd.nonmembers#simd.permute.dynamic)

#### 29.10.8.8 vec dynamic permute [simd.permute.dynamic]

[ð](#lib:permute,simd)

`template<[simd-vec-type](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I>
  constexpr resize_t<I::size(), V> permute(const V& v, const I& indices);
template<[simd-mask-type](simd.expos#concept:simd-mask-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") M, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I>
  constexpr resize_t<I::size(), M> permute(const M& v, const I& indices);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18825)

*Preconditions*: All values in indices are in the range [0, V​::​size())[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18829)

*Returns*: A data-parallel object where the ith element is initialized to the result of v[indices[i]] for all i in
the range [0, I​::​size())[.](#2.sentence-1)
