std::experimental::simd_cast, std::experimental::static_simd_cast

From cppreference.com
< cpp‎ | experimental‎ | simd
 
 
Technical specifications
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals 2 TS)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Concepts (concepts TS)
Ranges (ranges TS)
Special mathematical functions (special math TR)
 
 
 
Defined in header <experimental/simd>
template < class V, class T, class Abi >
/*see below*/ simd_cast( const simd<T, Abi>& v );
(1)
template < class V, class T, class Abi >
/*see below*/ static_simd_cast( const simd<T, Abi>& v );
(2)

Cast a simd object to another simd object. If V is T, returns simd<T, Abi>; otherwise, if V is a scalar type, returns simd<V, simd_abi::fixed_size<simd<T, Abi>::size()>>. Otherwise, V must be a simd type, and the function returns V.

1) This function does not participate in overloading resolution unless
  • every possible value of the input element can be represented with the output element
  • either is_simd_v<V> is false, or V::size() is simd<T, Abi>::size()
2) This function does not participate in overloading resolution unless either is_simd_v<V> is false, or V::size() is simd<T, Abi>::size().

Parameters

v - the input simd object

Return value

A simd object with the i-th element initialized to static_cast<To>(v[i]), where To is the output element type as specified.

Example