SpECTRE
v2024.12.16
|
Namespaces | |
namespace | cpp20 |
C++ STL code present in C++20. | |
namespace | tt |
A collection of useful type traits. | |
Classes | |
struct | is_any_spin_weighted< T > |
This is a std::true_type if the provided type is a SpinWeighted of any type and spin, otherwise is a std::false_type . More... | |
struct | is_spin_weighted_of< InternalType, T > |
This is a std::true_type if the provided type T is a SpinWeighted of InternalType and any spin, otherwise is a std::false_type . More... | |
struct | is_spin_weighted_of_same_type< T1, T2 > |
This is a std::true_type if the provided type T1 is a SpinWeighted and T2 is a SpinWeighted , and both have the same internal type, but any combination of spin weights. More... | |
struct | tt::is_tensor_index< T > |
Check if a type T is a TensorIndex used in TensorExpressions. More... | |
struct | tt::is_time_index< T > |
Check if a type T is a TensorIndex representing a concrete time index. More... | |
struct | tt::is_tensor_index_type< T > |
Inherits from std::true_type if T is a TensorIndexType. More... | |
struct | get_vector_element_type< T, bool > |
Helper struct to determine the element type of a VectorImpl or container of VectorImpl. More... | |
struct | TypeDisplayer<... > |
Get compiler error with type of template parameter. More... | |
struct | cpp20::remove_cvref< T > |
struct | tt::can_be_copy_constructed< T> |
Check if T is copy constructible. More... | |
struct | tt::get_fundamental_type< T> |
Extracts the fundamental type for a container. More... | |
struct | tt::has_equivalence< T> |
Check if type T has operator== defined. More... | |
struct | tt::has_inequivalence< T, U > |
Check if type T has operator!= defined. More... | |
class | tt::is_callable< TT, TArgs > |
Check if a type T is callable, i.e. T(Args...) is evaluable. More... | |
struct | tt::is_complex_of_fundamental< T> |
Determines if a type T is a std::complex of a fundamental type, is a std::true_type if so, and otherwise is a std::false_type More... | |
struct | tt::is_integer< I > |
Check if I is an integer type (non-bool, non-character), unlike std::is_integral. More... | |
struct | tt::is_iterable< T> |
Check if type T has a begin() and end() function. More... | |
struct | tt::is_maplike< T> |
Check if type T is like a std::map or std::unordored_map. More... | |
struct | tt::is_std_array< T > |
Check if type T is a std::array. More... | |
struct | tt::is_std_array_of_size< N, T > |
Check if type T is a std::array of a given size. More... | |
struct | tt::is_streamable< S, T> |
Check if type T has operator<<(S , T ) defined. More... | |
struct | tt::remove_reference_wrapper< T > |
Gets the underlying type if the type is a std::reference_wrapper, otherwise returns the type itself. More... | |
struct | tt::remove_cvref_wrap< T > |
Removes std::reference_wrapper, references, and cv qualifiers. More... | |
Macros | |
#define | CREATE_GET_STATIC_MEMBER_VARIABLE_OR_DEFAULT(VARIABLE_NAME) |
Generate a metafunction that will retrieve the specified static constexpr member variable, or, if not present, a default. More... | |
#define | CREATE_GET_TYPE_ALIAS_OR_DEFAULT(ALIAS_NAME) |
Generate a metafunction that will retrieve the specified type alias, or if not present, assign a default type. More... | |
Typedefs | |
template<typename T > | |
using | is_derived_of_vector_impl = implementation defined* >())) |
This is std::true_type if the provided type possesses an implicit conversion to any VectorImpl , which is the primary feature of SpECTRE vectors generally. Otherwise, it is std::false_type . | |
template<class T > | |
using | cpp20::remove_cvref_t = typename remove_cvref< T >::type |
template<typename F > | |
using | tt::function_info = implementation defined |
Returns a struct that contains the return type, argument types, and the class type if the F is a non-static member function. More... | |
Variables | |
template<typename T > | |
constexpr bool | tt::is_complex_or_fundamental_v |
Evaluates to true if type T is a std::complex of a fundamental type or if T is a fundamental type. More... | |
template<typename Array > | |
using | tt::array_size = implementation defined |
Get the size of a std::array as a std::integral_constant. More... | |
template<template< typename... > class U, typename T > | |
using | tt::is_a = implementation defined |
Check if type T is a template specialization of U More... | |
template<template< typename... > class U, typename T > | |
using | tt::is_a_t = typename is_a< U, T >::type |
template<template< typename... > class U, typename T > | |
constexpr bool | tt::is_a_v = is_a<U, T>::value |
#define | CREATE_HAS_STATIC_MEMBER_VARIABLE(CONSTEXPR_NAME) |
Generate a type trait to check if a class has a static constexpr variable, optionally also checking its type. More... | |
#define | CREATE_HAS_STATIC_MEMBER_VARIABLE_V(CONSTEXPR_NAME) |
Generate a type trait to check if a class has a static constexpr variable, optionally also checking its type. More... | |
#define | CREATE_HAS_TYPE_ALIAS(ALIAS_NAME) |
Generate a type trait to check if a class has a type alias with a particular name, optionally also checking its type. More... | |
#define | CREATE_HAS_TYPE_ALIAS_V(ALIAS_NAME) |
Generate a type trait to check if a class has a type alias with a particular name, optionally also checking its type. More... | |
#define | CREATE_IS_CALLABLE(METHOD_NAME) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs... More... | |
#define | CREATE_IS_CALLABLE_R_V(METHOD_NAME) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs... More... | |
#define | CREATE_IS_CALLABLE_V(METHOD_NAME) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs... More... | |
A collection of useful type traits, including C++14 and C++17 additions to the standard library.
#define CREATE_GET_STATIC_MEMBER_VARIABLE_OR_DEFAULT | ( | VARIABLE_NAME | ) |
Generate a metafunction that will retrieve the specified static constexpr
member variable, or, if not present, a default.
#define CREATE_GET_TYPE_ALIAS_OR_DEFAULT | ( | ALIAS_NAME | ) |
Generate a metafunction that will retrieve the specified type alias, or if not present, assign a default type.
#define CREATE_HAS_STATIC_MEMBER_VARIABLE | ( | CONSTEXPR_NAME | ) |
Generate a type trait to check if a class has a static constexpr
variable, optionally also checking its type.
To generate the corresponding _v
metafunction, call CREATE_HAS_STATIC_MEMBER_VARIABLE
first and then CREATE_HAS_STATIC_MEMBER_VARIABLE_V
.
CREATE_IS_CALLABLE
#define CREATE_HAS_STATIC_MEMBER_VARIABLE_V | ( | CONSTEXPR_NAME | ) |
Generate a type trait to check if a class has a static constexpr
variable, optionally also checking its type.
To generate the corresponding _v
metafunction, call CREATE_HAS_STATIC_MEMBER_VARIABLE
first and then CREATE_HAS_STATIC_MEMBER_VARIABLE_V
.
CREATE_IS_CALLABLE
#define CREATE_HAS_TYPE_ALIAS | ( | ALIAS_NAME | ) |
Generate a type trait to check if a class has a type alias with a particular name, optionally also checking its type.
To generate the corresponding _v
metafunction, call CREATE_HAS_TYPE_ALIAS
first and then CREATE_HAS_TYPE_ALIAS_V
.
CREATE_IS_CALLABLE
#define CREATE_HAS_TYPE_ALIAS_V | ( | ALIAS_NAME | ) |
Generate a type trait to check if a class has a type alias with a particular name, optionally also checking its type.
To generate the corresponding _v
metafunction, call CREATE_HAS_TYPE_ALIAS
first and then CREATE_HAS_TYPE_ALIAS_V
.
CREATE_IS_CALLABLE
#define CREATE_IS_CALLABLE | ( | METHOD_NAME | ) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs...
The usage of the type trait is identical to the usage of the tt::is_callable
type trait. The name of the type trait is is_METHOD_NAME_callable
and is not placed in the tt
namespace. To avoid collisions it is highly recommended that type traits generated with this macro are generated into _detail
namespaces. This will reduce redefinition compilation errors.
Note that variable templates with _r
and _t
suffixes that follow the standard library's naming convention are also generated. To generate corresponding _v
metafunctions, call CREATE_IS_CALLABLE
first and then CREATE_IS_CALLABLE_V
and/or CREATE_IS_CALLABLE_R_V
.
#define CREATE_IS_CALLABLE_R_V | ( | METHOD_NAME | ) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs...
The usage of the type trait is identical to the usage of the tt::is_callable
type trait. The name of the type trait is is_METHOD_NAME_callable
and is not placed in the tt
namespace. To avoid collisions it is highly recommended that type traits generated with this macro are generated into _detail
namespaces. This will reduce redefinition compilation errors.
Note that variable templates with _r
and _t
suffixes that follow the standard library's naming convention are also generated. To generate corresponding _v
metafunctions, call CREATE_IS_CALLABLE
first and then CREATE_IS_CALLABLE_V
and/or CREATE_IS_CALLABLE_R_V
.
#define CREATE_IS_CALLABLE_V | ( | METHOD_NAME | ) |
Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs...
The usage of the type trait is identical to the usage of the tt::is_callable
type trait. The name of the type trait is is_METHOD_NAME_callable
and is not placed in the tt
namespace. To avoid collisions it is highly recommended that type traits generated with this macro are generated into _detail
namespaces. This will reduce redefinition compilation errors.
Note that variable templates with _r
and _t
suffixes that follow the standard library's naming convention are also generated. To generate corresponding _v
metafunctions, call CREATE_IS_CALLABLE
first and then CREATE_IS_CALLABLE_V
and/or CREATE_IS_CALLABLE_R_V
.
using tt::array_size = implementation defined |
Get the size of a std::array as a std::integral_constant.
Given a std::array, Array
, returns a std::integral_constant that has the size of the array as its value
For a std::array T
Returns: std::integral_constant<std::size_t>
Semantics: For a type T
,
Array | the whose size should be stored in value of array_size |
using tt::function_info = implementation defined |
Returns a struct that contains the return type, argument types, and the class type if the F
is a non-static member function.
The return class has member type aliases:
return_type
The return type of the functionargument_types
A tmpl::list
of the arguments types of the functionclass_type
The type of the class if the function is a non-static member function, otherwise void
void
because they are effectively free functions. using tt::is_a = implementation defined |
Check if type T
is a template specialization of U
Requires: U
is a class template
Effects: If T
is a template specialization of U
, then inherits from std::true_type, otherwise inherits from std::false_type
For any type T
and class template U
Returns: std::bool_constant
Semantics: If the type T
is a template specialization of the type U
, then
otherwise
T | type to check |
U | the type that T might be a template specialization of |
using tt::is_a_t = typedef typename is_a<U, T>::type |
|
constexpr |
|
constexpr |
Evaluates to true
if type T
is a std::complex
of a fundamental type or if T
is a fundamental type.