std::experimental::is_simd, std::experimental::is_simd_mask
From cppreference.com
< cpp | experimental | simd
| Defined in header <experimental/simd>
|
||
| template< class T > struct is_simd; |
(1) | (parallelism TS v2) |
| template< class T > struct is_simd_mask; |
(2) | (parallelism TS v2) |
1) If
T is a specialization of the simd class template, provides the member constant value equal true. For any other type, value is false.2) If
T is a specialization of the simd_mask class template, provides the member constant value equal true. For any other type, value is false.Template parameters
| T | - | a type to check |
Helper variable template
| template< class T > inline constexpr bool is_simd_v = is_simd<T>::value; |
(parallelism TS v2) | |
| template< class T > inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; |
(parallelism TS v2) | |
Inherited from std::integral_constant
Member constants
| value [static] |
true if T is a simd/simd_mask type , false otherwise (public static member constant) |
Member functions
| operator bool |
converts the object to bool, returns value (public member function) |
| operator() (C++14) |
returns value (public member function) |
Member types
| Type | Definition |
value_type
|
bool
|
type
|
std::integral_constant<bool, value> |
Example
Run this code
#include <experimental/simd> #include <iostream> int main() { namespace stdx = std::experimental; std::cout << std::boolalpha << stdx::is_simd_v<stdx::simd<float>> << '\n'; << stdx::is_simd_v<int> << '\n'; << stdx::is_simd_mask_v<stdx::simd_mask<float>> << '\n'; << stdx::is_simd_mask_v<int> << '\n'; }
Output:
true false true false