Type Traits

xsimd provides a few type traits to interact with scalar and batch types in an uniformeous manner.

Type check:

is_batch

batch type detection

is_batch_bool

mask batch type detection

is_batch_complex

complex batch type detection

Type access:

scalar_type

batch element type

mask_type

batch mask type


template <class T>
struct xsimd::is_batch
#include <xsimd_traits.hpp>

type traits that inherits from std::true_type for batch<...> types and from std::false_type otherwise.

Template Parameters
  • T: type to analyze.

Inherits from false_type

template <class T>
struct xsimd::is_batch_bool
#include <xsimd_traits.hpp>

type traits that inherits from std::true_type for batch_bool<...> types and from std::false_type otherwise.

Template Parameters
  • T: type to analyze.

Inherits from false_type

template <class T>
struct xsimd::is_batch_complex
#include <xsimd_traits.hpp>

type traits that inherits from std::true_type for batch<std::complex<...>> types and from std::false_type otherwise.

Template Parameters
  • T: type to analyze.

Inherits from false_type

template <class T>
struct xsimd::scalar_type
#include <xsimd_traits.hpp>

type traits whose type field is set to T::value_type if is_batch<T>::value and to T otherwise.

Template Parameters
  • T: type to analyze.

template <class T>
struct xsimd::mask_type
#include <xsimd_traits.hpp>

type traits whose type field is set to T::value_type if is_batch_bool<T>::value and to bool otherwise.

Template Parameters
  • T: type to analyze.