SpECTRE  v2024.03.19
get_vector_element_type< T, bool > Struct Template Reference

Helper struct to determine the element type of a VectorImpl or container of VectorImpl. More...

Detailed Description

template<typename T, bool = static_cast<bool>(tt::is_complex_of_fundamental_v<T> or std::is_fundamental_v<T>)>
struct get_vector_element_type< T, bool >

Helper struct to determine the element type of a VectorImpl or container of VectorImpl.

Details

Extracts the element type of a VectorImpl, a std::array of VectorImpl, or a reference or pointer to a VectorImpl. In any of these cases, the type member is defined as the ElementType of the VectorImpl in question. If, instead, get_vector_element_type is passed an arithmetic or complex arithemetic type, the type member is defined as the passed type.

static_assert(std::is_same_v<get_vector_element_type_t<DataVector>, double>,
"Failed testing type trait get_vector_element_type");
static_assert(std::is_same_v<
get_vector_element_type_t<std::array<DataVector, 2>>, double>,
"Failed testing type trait get_vector_element_type");
static_assert(std::is_same_v<get_vector_element_type_t<std::complex<double>*>,
"Failed testing type trait get_vector_element_type");
static_assert(std::is_same_v<get_vector_element_type_t<DataVector&>, double>,
"Failed testing type trait get_vector_element_type");

The documentation for this struct was generated from the following file: