◆ extract()

template<typename Value , typename Offset >
scalar_of_t<Value> boost::simd::extract ( Value const &  v,
Offset const &  o 
)

Random-access extraction of a value subcomponent.

Extract a sub-element of a given value v

Header <boost/simd/function/extract.hpp>
Semantic

For any value v of type Value and o of type Offset:

auto x = extract(v,o);

is similar to:

  • If v is a scalar value:
x = v;
  • If v is a SIMD value:
x = v[o];
Parameters
vValue to extract
oPosition to extract from (offset)
Returns
The extracted value