SUNphi  1.0
TypeTraits.hpp File Reference

Defines convenient adaptation of the std type_traits library, and extensions useful for the expression handling. More...

#include <type_traits>
#include <utility>
#include <metaprogramming/SwallowSemicolon.hpp>

Go to the source code of this file.

Classes

struct  SUNphi::_EnableIf< B, T >
 
struct  SUNphi::_EnableIf< true, T >
 
class  SUNphi::ConstrainAreSame< Args >
 Forces a set of types to be the same. More...
 
struct  SUNphi::_Conditional< B, T, F >
 
struct  SUNphi::_Conditional< true, T, F >
 
struct  SUNphi::_Conditional< false, T, F >
 
struct  SUNphi::ConstrainIsBaseOf< Base, Derived >
 Forces type Derived to be derived from Base. More...
 
struct  SUNphi::ConstrainIsNotBaseOf< Base, Derived >
 Forces type Derived not to be derived from Base. More...
 
struct  SUNphi::ConstrainNTypes< N, Args >
 Forces types to be in the given number. More...
 
struct  SUNphi::ConstrainIsFloatingPoint< T >
 Forces the type to be a floating-point. More...
 
struct  SUNphi::ConstrainIsIntegral< T >
 Forces the type to be integer-like. More...
 
struct  SUNphi::ConstrainAreIntegrals< Args >
 Forces the type to be integer-like. More...
 
struct  SUNphi::CanPrint< S, T >
 
struct  SUNphi::HasMember_begin< Type >
 
struct  SUNphi::HasMember_begin< Type >::Fallback
 
struct  SUNphi::HasMember_begin< Type >::Derived
 
struct  SUNphi::HasMember_begin< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_begin< T >
 Class forcing T to have a member "begin" defined. More...
 
struct  SUNphi::HasMember_size< Type >
 
struct  SUNphi::HasMember_size< Type >::Fallback
 
struct  SUNphi::HasMember_size< Type >::Derived
 
struct  SUNphi::HasMember_size< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_size< T >
 Class forcing T to have a member "size" defined. More...
 
struct  SUNphi::HasMember_resize< Type >
 
struct  SUNphi::HasMember_resize< Type >::Fallback
 
struct  SUNphi::HasMember_resize< Type >::Derived
 
struct  SUNphi::HasMember_resize< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_resize< T >
 Class forcing T to have a member "resize" defined. More...
 
struct  SUNphi::HasMember_end< Type >
 
struct  SUNphi::HasMember_end< Type >::Fallback
 
struct  SUNphi::HasMember_end< Type >::Derived
 
struct  SUNphi::HasMember_end< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_end< T >
 Class forcing T to have a member "end" defined. More...
 
class  SUNphi::internal::FallTrhough
 Class returned from fall-through methods. More...
 

Macros

#define NON_CONST_QUALIF
 Empty token to be used in macro expecting qualifier.
 
#define CONST_QUALIF   const
 Token to be used in macro indicating "const" keyword.
 
#define NON_REF
 Empty token to be used in macro expecting the kind of reference.
 
#define LVALUE_REF   &
 Token to be used in macro indicating "l-value" reference.
 
#define RVALUE_REF   &&
 Token to be used in macro indicating "r-value" reference.
 
#define FORBID_CONSTRUCT_BY_COPY(CLASS)
 Delete the copy-constructor. More...
 
#define STATIC_ASSERT_ARE_SAME(...)   static_assert(areSame<__VA_ARGS__>,"Error, types are not the same")
 Assert if types are not the same.
 
#define CALL_CLASS_CONST_METHOD_REMOVING_CONST(...)   asMutable(std::as_const(*this).__VA_ARGS__)
 Call a const method removing any const qualifier.
 
#define PROVIDE_ALSO_NON_CONST_METHOD(NAME)
 
#define STATIC_ASSERT_IS_BASE_OF(BASE, DERIVED)   static_assert(isBaseOf<BASE,DERIVED>,"Error, type not derived from what expected")
 Static assert if DERIVED does not derive from BASE.
 
#define STATIC_ASSERT_IS_NOT_BASE_OF(BASE, DERIVED)   static_assert(not isBaseOf<BASE,DERIVED>,"Error, type derived from what not expected")
 Static assert if DERIVED does derive from BASE.
 
#define STATIC_ASSERT_ARE_N_TYPES(N, UNEXP_PARPACK)   static_assert(N==sizeof...(UNEXP_PARPACK),"Error, expecting a different number of types")
 Static assert if not passing exactly N types.
 
#define STATIC_ASSERT_IS_FLOATING_POINT(T)   static_assert(isFloatingPoint<T>,"Error, type is not a floating point")
 Static assert if the type T is not a floating-point.
 
#define STATIC_ASSERT_IS_INTEGRAL(T)   static_assert(isIntegral<T>,"Error, type is not an integral")
 Static assert if the type T is not an integer-like.
 
#define STATIC_ASSERT_ARE_INTEGRALS(...)   static_assert(areIntegrals<__VA_ARGS__>,"Error, types are not all an integral")
 Static assert if the types T are not an integer-like.
 
#define PROVIDE_ENABLE_IF_FOR(TYPE, ...)
 
#define PROVIDE_ENABLE_IF_FOR_IS_TYPE(TYPE)
 Provides an EnableIf with the given name if isTYPE exists. More...
 
#define PROVIDE_ENABLE_IF_FOR_TYPE(TYPE)
 Provides an EnableIf with the given type. More...
 
#define DEFINE_BASE_TYPE(TYPE, ...)
 
#define STATIC_ASSERT_HAS_MEMBER(TAG, ...)   static_assert(hasMember_ ## TAG<__VA_ARGS__>,"Type does not have member " #TAG) \
 
#define DEFINE_HAS_MEMBER(TAG)
 
#define DEFINE_BINARY_OPERATOR_IMPLEMENTATION_CHECK(CHECK_NAME, STRUCT_NAME, OPERATOR)
 Check that the binary operator exists. More...
 
#define DEFINE_IS_THE_TEMPLATED_CLASS(CLASS)
 Provides a check returning whether the class is of a given kind. More...
 

Typedefs

using SUNphi::TrueType = std::true_type
 
using SUNphi::FalseType = std::false_type
 
template<bool B, typename T = void>
using SUNphi::EnableIf = typename _EnableIf< B, T >::type
 
template<bool B>
using SUNphi::VoidIf = EnableIf< B >
 
template<bool B, typename T >
using SUNphi::TypeIf = EnableIf< B, T >
 
template<bool B, typename T , typename F >
using SUNphi::Conditional = typename _Conditional< B, T, F >::type
 
template<typename T >
using SUNphi::RemRef = typename std::remove_reference< T >::type
 Returns the type T without any reference.
 
template<bool B, typename _T , typename T = RemRef<_T>>
using SUNphi::RefIf = Conditional< B, T &, T >
 Returns reference of plain type depending on condition.
 
template<typename T >
using SUNphi::RemoveCV = typename std::remove_cv< T >::type
 Returns the type T without any constant volatile qualification.
 
template<bool B, typename _T , typename T = RemoveCV<_T>>
using SUNphi::ConstIf = Conditional< B, const T, T >
 Returns const or non const T depending on condition.
 
template<typename T >
using SUNphi::Unqualified = RemoveCV< RemRef< T >>
 Returns the type T without any reference or qualifier.
 
template<typename T >
using SUNphi::Fundamental = decltype(fundamentalHelper< T >())
 Returns the type T without any reference or qualifier or pointer.
 
template<typename F >
using SUNphi::AddPointer = std::add_pointer_t< F >
 Returns a pointer-version of F.
 
template<typename F >
using SUNphi::AddPointerIfFunction = Conditional< isFunction< F >, AddPointer< F >, F >
 Returns F or F* if F is not a function.
 
template<typename T >
using SUNphi::SignedOf = RefIf< isLvalue< T >, std::make_signed_t< RemRef< T >>>
 Returns the signed version of the passed type.
 
template<typename T >
using SUNphi::UnsignedOf = RefIf< isLvalue< T >, std::make_unsigned_t< RemRef< T >>>
 Returns the unsigned version of the passed type.
 

Functions

template<typename T = void, typename... Tail>
constexpr bool SUNphi::_areSame ()
 
template<typename T >
constexpr auto SUNphi::fundamentalHelper ()
 
template<typename T >
constexpr T & SUNphi::asMutable (const T &v) noexcept
 
template<typename Type >
constexpr bool SUNphi::hasMember_beginHelper ()
 
template<typename Type >
constexpr bool SUNphi::hasMember_sizeHelper ()
 
template<typename Type >
constexpr bool SUNphi::hasMember_resizeHelper ()
 
template<typename Type >
constexpr bool SUNphi::hasMember_endHelper ()
 
template<typename T >
constexpr bool SUNphi::canBeGet ()
 Check if the class T can be get.
 

Variables

template<typename T >
static constexpr bool SUNphi::isClass
 Checks if a type is a class. More...
 
template<typename From , typename To >
static constexpr bool SUNphi::canBeConverted
 Checks if a type can be cast into another one. More...
 
template<typename T >
static constexpr bool SUNphi::isTriviallyCopyable
 Checks if an object can be trivially copied. More...
 
template<typename T1 , typename T2 >
static constexpr bool SUNphi::isSame
 
template<typename T >
static constexpr bool SUNphi::isSame< T, T >
 
template<typename... Ts>
constexpr bool SUNphi::areSame
 
template<typename T >
constexpr bool SUNphi::isLvalue
 Check if the type is lvalue reference. More...
 
template<typename T >
constexpr bool SUNphi::isRvalue
 Check if the type is rvalue reference. More...
 
template<typename _T , typename T = RemRef<_T>>
constexpr bool SUNphi::isConst
 
template<typename T >
static constexpr bool SUNphi::isPointer
 Checks if it is pointer. More...
 
template<typename Base , typename Derived >
constexpr bool SUNphi::isBaseOf
 Identifies whether Base is a base class of Derived. More...
 
template<typename F >
constexpr bool SUNphi::isFunction
 Returns whether the passed argument is a function. More...
 
template<typename T >
constexpr bool SUNphi::isFloatingPoint =std::is_floating_point<T>::value
 Identifies whether a type is a floating-point.
 
template<typename T >
constexpr bool SUNphi::isIntegral =std::is_integral<T>::value
 Identifies whether a type is an integer-like.
 
template<typename Head = int, typename... Tail>
constexpr bool SUNphi::areIntegrals
 Identifies whether a set of types are a integer-like. More...
 
template<typename T >
constexpr bool SUNphi::areIntegrals< T >
 Identifies whether a single types is integer-like. More...
 
template<typename S , typename T >
constexpr bool SUNphi::canPrint = CanPrint <S,T>::res
 
template<typename Type >
constexpr bool SUNphi::hasMember_begin = hasMember_beginHelper<RemRef<Type>>()
 
template<typename Type >
constexpr bool SUNphi::hasMember_size = hasMember_sizeHelper<RemRef<Type>>()
 
template<typename Type >
constexpr bool SUNphi::hasMember_resize = hasMember_resizeHelper<RemRef<Type>>()
 
template<typename Type >
constexpr bool SUNphi::hasMember_end = hasMember_endHelper<RemRef<Type>>()
 
template<typename T >
constexpr bool SUNphi::isVectorLike
 Check if the class T is vector-like. More...
 
template<int , typename T >
FallTrhough SUNphi::internal::get (T)
 Default getter.
 
template<typename T >
constexpr bool SUNphi::isTupleLike
 Check if the class T is tuple-like. More...
 

Detailed Description

Defines convenient adaptation of the std type_traits library, and extensions useful for the expression handling.

Definition in file TypeTraits.hpp.

Macro Definition Documentation

#define DEFINE_BASE_TYPE (   TYPE,
  ... 
)
Value:
struct Base ## TYPE __VA_ARGS__ {}; \
\ \
template <typename T> \
[[ maybe_unused ]] \
constexpr bool is ## TYPE= \
isBaseOf<Base ## TYPE,T>; \
\ \
template <typename T> \
using ConstrainIs ## TYPE= \
ConstrainIsBaseOf<Base ## TYPE,T>; \
\ \
template <typename T> \
using ConstrainIsNot ## TYPE= \
ConstrainIsNotBaseOf<Base ## TYPE,T>; \
\ \
template <typename...Args> \
struct ConstrainAre ## TYPE ## s \
{ \
static_assert((is ## TYPE<Args> && ...), \
"Error, types are not all " #TYPE); \
}
#define PROVIDE_ENABLE_IF_FOR_IS_TYPE(TYPE)
Provides an EnableIf with the given name if isTYPE exists.
Definition: TypeTraits.hpp:509

Defines a "Base" identifier and checks for it

Given a TYPE, defines another empty type prefixing its name with "Base", and defines a check IsTYPE to probe wheter a certain type inherit from TYPE. All extra arguments can be used to specify inheritance from other classes

Definition at line 526 of file TypeTraits.hpp.

#define DEFINE_BINARY_OPERATOR_IMPLEMENTATION_CHECK (   CHECK_NAME,
  STRUCT_NAME,
  OPERATOR 
)
Value:
\
template <typename S, \
typename T> \
struct STRUCT_NAME \
{ \ \
template <typename U, \
typename V> \
static auto test(U*)->decltype(std::declval<U>() \
OPERATOR \
std::declval<V>()); \
\ \
template <typename, \
typename> \
static auto test(...)->std::false_type; \
\ \
static constexpr bool res= \
not isSame<std::false_type,decltype(test<S,T>(0))>; \
}; \
\ \
template <typename S, \
typename T> \
[[ maybe_unused ]] \
constexpr bool CHECK_NAME= \
STRUCT_NAME<S,T>::res
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263

Check that the binary operator exists.

Definition at line 667 of file TypeTraits.hpp.

#define DEFINE_HAS_MEMBER (   TAG)

Define a member detecter named hasMember_TAG

Example:

1 DEFINE_HAS_MEMBER(ciccio);
2 
3 struct fuffa
4 {
5  int ciccio();
6 };
7 
8 int main()
9 {
10  bool has=hasMember_ciccio(fuffa);
11  return 0;
12 }

Definition at line 581 of file TypeTraits.hpp.

#define DEFINE_IS_THE_TEMPLATED_CLASS (   CLASS)
Value:
\ \ \
template <typename T> \
constexpr bool _is ## CLASS(const T*) \
{ \
return \
false; \
} \
\ \ \ \
template <typename...Ts> \
constexpr bool _is ## CLASS(const CLASS<Ts...>*) \
{ \
return \
true; \
} \
\ \ \ \
template <typename T> \
[[ maybe_unused ]] \
constexpr bool is ## CLASS= \
_is ## CLASS((RemRef<T>*)nullptr); \
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263
#define PROVIDE_ENABLE_IF_FOR_IS_TYPE(TYPE)
Provides an EnableIf with the given name if isTYPE exists.
Definition: TypeTraits.hpp:509

Provides a check returning whether the class is of a given kind.

Definition at line 716 of file TypeTraits.hpp.

#define FORBID_CONSTRUCT_BY_COPY (   CLASS)
Value:
CLASS(const CLASS&)= \
delete

Delete the copy-constructor.

Definition at line 55 of file TypeTraits.hpp.

#define PROVIDE_ALSO_NON_CONST_METHOD (   NAME)
Value:
\
template <typename...Ts> /* Type of all arguments */ \
DECLAUTO NAME(Ts&&...ts) \
{ \
CALL_CLASS_CONST_METHOD_REMOVING_CONST(NAME(forw<Ts>(ts)...)); \
}
#define CALL_CLASS_CONST_METHOD_REMOVING_CONST(...)
Call a const method removing any const qualifier.
Definition: TypeTraits.hpp:352
#define DECLAUTO
Short name for decltype(auto)

Provides also a non-const version of the method NAME

See https://stackoverflow.com/questions/123758/how-do-i-remove-code-duplication-between-similar-const-and-non-const-member-func A const method NAME must be already present Example

1 // class ciccio
2  {
3  double e{0};
4 
5  public:
6 
7  const double& get() const
8  {
9  return e;
10  }
11 
12  PROVIDE_ALSO_NON_CONST_METHOD(get);
13  };

Definition at line 376 of file TypeTraits.hpp.

#define PROVIDE_ENABLE_IF_FOR (   TYPE,
  ... 
)
Value:
\
template <typename T, \
typename Ret=void> \
using EnableIfIs ## TYPE= \
EnableIf<__VA_ARGS__,Ret>
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263

Provides an EnableIf with the given name for a certain condition

Must be declared with deduced type to void template parameters that cannot be deduced

Definition at line 500 of file TypeTraits.hpp.

#define PROVIDE_ENABLE_IF_FOR_IS_TYPE (   TYPE)
Value:
\
PROVIDE_ENABLE_IF_FOR(TYPE,is ## TYPE<T>)
#define PROVIDE_ENABLE_IF_FOR(TYPE,...)
Definition: TypeTraits.hpp:500

Provides an EnableIf with the given name if isTYPE exists.

Definition at line 509 of file TypeTraits.hpp.

#define PROVIDE_ENABLE_IF_FOR_TYPE (   TYPE)
Value:
\
PROVIDE_ENABLE_IF_FOR(TYPE,isSame<T,TYPE>)
#define PROVIDE_ENABLE_IF_FOR(TYPE,...)
Definition: TypeTraits.hpp:500

Provides an EnableIf with the given type.

Definition at line 514 of file TypeTraits.hpp.

#define STATIC_ASSERT_HAS_MEMBER (   TAG,
  ... 
)    static_assert(hasMember_ ## TAG<__VA_ARGS__>,"Type does not have member " #TAG) \

Assert type T to have member TAG

Note that you need to have defined DEFINE_HAS_MEMBER before

Definition at line 560 of file TypeTraits.hpp.

Typedef Documentation

template<bool B, typename T , typename F >
using SUNphi::Conditional = typedef typename _Conditional<B,T,F>::type

Provides type T if B is true, or F if is false

Wraps the internal implementation

Definition at line 217 of file TypeTraits.hpp.

template<bool B, typename T = void>
using SUNphi::EnableIf = typedef typename _EnableIf<B,T>::type

Defines type T (default to void) if parameter B is true

Gives visibility to the internal implementation

Definition at line 88 of file TypeTraits.hpp.

using SUNphi::FalseType = typedef std::false_type

A bool constant type holding value "false"

Useful to create SFINAE tests

Definition at line 30 of file TypeTraits.hpp.

using SUNphi::TrueType = typedef std::true_type

A bool constant type holding value "true"

Useful to create SFINAE tests

Definition at line 24 of file TypeTraits.hpp.

template<bool B, typename T >
using SUNphi::TypeIf = typedef EnableIf<B,T>

Defines type T if parameter B is true

Explicit specialization of EnableIf forcing an explicit type.

Definition at line 103 of file TypeTraits.hpp.

template<bool B>
using SUNphi::VoidIf = typedef EnableIf<B>

Defines void if parameter B is true

Explicit specialization of EnableIf for T=void .

Definition at line 95 of file TypeTraits.hpp.

Function Documentation

template<typename T = void, typename... Tail>
constexpr bool SUNphi::_areSame ( )

Returns true if all types Ts are the same

Internal implementation

Definition at line 151 of file TypeTraits.hpp.

template<typename T >
constexpr T& SUNphi::asMutable ( const T &  v)
noexcept

Remove const qualifier from anything

Todo:
Check that the "dangling reference forbidding" below, currently not working, is not actually necessary

Definition at line 342 of file TypeTraits.hpp.

template<typename T >
constexpr auto SUNphi::fundamentalHelper ( )

Returns the type T without any reference or qualifier or pointer

Helper to the actual implementation

Definition at line 287 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_beginHelper ( )

Intemediate function to distinguish the non-class case

Definition at line 749 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_endHelper ( )

Intemediate function to distinguish the non-class case

Definition at line 752 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_resizeHelper ( )

Intemediate function to distinguish the non-class case

Definition at line 751 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_sizeHelper ( )

Intemediate function to distinguish the non-class case

Definition at line 750 of file TypeTraits.hpp.

Variable Documentation

template<typename Head = int, typename... Tail>
constexpr bool SUNphi::areIntegrals
Initial value:
=
areIntegrals<Head> and areIntegrals<Tail...>
constexpr bool areIntegrals
Identifies whether a set of types are a integer-like.
Definition: TypeTraits.hpp:475

Identifies whether a set of types are a integer-like.

Definition at line 475 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::areIntegrals< T >
Initial value:
=
isIntegral<T>

Identifies whether a single types is integer-like.

Definition at line 480 of file TypeTraits.hpp.

template<typename... Ts>
constexpr bool SUNphi::areSame
Initial value:
=
_areSame<Ts...>()
constexpr bool _areSame()
Definition: TypeTraits.hpp:151

Returns true if all Ts are the same type

Gives visibility to internal representation

Definition at line 164 of file TypeTraits.hpp.

template<typename From , typename To >
constexpr bool SUNphi::canBeConverted
static
Initial value:
=
std::is_convertible_v<From,To>

Checks if a type can be cast into another one.

Definition at line 117 of file TypeTraits.hpp.

template<typename S , typename T >
constexpr bool SUNphi::canPrint = CanPrint <S,T>::res

Check that operator << is implemented

Definition at line 699 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_begin = hasMember_beginHelper<RemRef<Type>>()

Detect if Type has member (variable or method) begin

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 749 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_end = hasMember_endHelper<RemRef<Type>>()

Detect if Type has member (variable or method) end

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 752 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_resize = hasMember_resizeHelper<RemRef<Type>>()

Detect if Type has member (variable or method) resize

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 751 of file TypeTraits.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_size = hasMember_sizeHelper<RemRef<Type>>()

Detect if Type has member (variable or method) size

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 750 of file TypeTraits.hpp.

template<typename Base , typename Derived >
constexpr bool SUNphi::isBaseOf
Initial value:
=
std::is_base_of<Base,RemRef<Derived>>::value

Identifies whether Base is a base class of Derived.

Definition at line 312 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isClass
static
Initial value:
=
std::is_class_v<T>

Checks if a type is a class.

Definition at line 110 of file TypeTraits.hpp.

template<typename _T , typename T = RemRef<_T>>
constexpr bool SUNphi::isConst
Initial value:
=
not isSame<RemoveCV<T>,T>
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263

Returns whether T is const or not

Warning!!! This is not the same than asking std::is_const

Definition at line 258 of file TypeTraits.hpp.

template<typename F >
constexpr bool SUNphi::isFunction
Initial value:
=
std::is_function_v<F>

Returns whether the passed argument is a function.

Definition at line 320 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isLvalue
Initial value:
=
std::is_lvalue_reference<T>::value

Check if the type is lvalue reference.

Definition at line 229 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isPointer
static
Initial value:
=
std::is_pointer_v<T>

Checks if it is pointer.

Definition at line 278 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isRvalue
Initial value:
=
std::is_rvalue_reference<T>::value

Check if the type is rvalue reference.

Definition at line 235 of file TypeTraits.hpp.

template<typename T1 , typename T2 >
constexpr bool SUNphi::isSame
static
Initial value:
=
false

Checks if two types are the same

Default (false) case

Definition at line 134 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isSame< T, T >
static
Initial value:
=
true

Checks if two types are the same

True case

Definition at line 141 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isTriviallyCopyable
static
Initial value:
=
std::is_trivially_copyable_v<T>

Checks if an object can be trivially copied.

Definition at line 123 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isTupleLike
Initial value:
=
canBeGet<T>()

Check if the class T is tuple-like.

Definition at line 793 of file TypeTraits.hpp.

template<typename T >
constexpr bool SUNphi::isVectorLike
Initial value:
=
hasMember_begin<T> and
hasMember_end<T> and
hasMember_resize<T> and
hasMember_size<T>

Check if the class T is vector-like.

Definition at line 757 of file TypeTraits.hpp.