std::experimental::is_simd, std::experimental::is_simd_mask
Min standard notice:
Header: <experimental/simd>
- If T is a specialization of the simd class template, provides the member constant value equal true. For any other type, value is false.
# Declarations
template< class T >
struct is_simd;
(parallelism TS v2)
template< class T >
struct is_simd_mask;
(parallelism TS v2)
# Notes
is_simd_v
# Example
#include <experimental/simd>
#include <iostream>
#include <string_view>
namespace stdx = std::experimental;
template<typename T>
void test_simd(std::string_view type_name)
{
std::cout << std::boolalpha
<< "Type: " << type_name << '\n'
<< " is_simd: " << stdx::is_simd_v<T> << '\n'
<< " is_constructible: " << std::is_constructible_v<T> << '\n';
}
template<typename T>
void test_simd_mask(std::string_view type_name)
{
std::cout << std::boolalpha
<< "Type: " << type_name << '\n'
<< " is_simd_mask: " << stdx::is_simd_mask_v<T> << '\n'
<< " is_constructible: " << std::is_constructible_v<T> << "\n\n";
}
int main()
{
test_simd<int>("int");
test_simd_mask<int>("int");
test_simd<stdx::simd<float>>("simd<float>");
test_simd_mask<stdx::simd_mask<float>>("simd_mask<float>");
test_simd<stdx::simd<bool>>("simd<bool>");
test_simd_mask<stdx::simd_mask<bool>>("simd_mask<bool>");
}