Type Traits
xsimd provides a few type traits to interact with scalar and batch types in an uniformeous manner.
Type check:
|
batch type detection |
|
mask batch type detection |
|
complex batch type detection |
Type access:
|
batch element type |
|
batch mask type |
-
template<class T>
struct is_batch : public std::false_type type traits that inherits from
std::true_type
forbatch<...>
types and fromstd::false_type
otherwise.- Template Parameters:
T – type to analyze.
-
template<class T>
struct is_batch_bool : public std::false_type - #include <xsimd_traits.hpp>
type traits that inherits from
std::true_type
forbatch_bool<...>
types and fromstd::false_type
otherwise.- Template Parameters:
T – type to analyze.
-
template<class T>
struct is_batch_complex : public std::false_type - #include <xsimd_traits.hpp>
type traits that inherits from
std::true_type
forbatch<std::complex<...>>
types and fromstd::false_type
otherwise.- Template Parameters:
T – type to analyze.
-
template<class T>
struct scalar_type - #include <xsimd_traits.hpp>
type traits whose
type
field is set toT::value_type
ifis_batch<T>::value
and toT
otherwise.- Template Parameters:
T – type to analyze.
-
template<class T>
struct mask_type - #include <xsimd_traits.hpp>
type traits whose
type
field is set toT::value_type
ifis_batch_bool<T>::value
and tobool
otherwise.- Template Parameters:
T – type to analyze.