tfel
Loading...
Searching...
No Matches
IsAssignableTo.hxx File Reference

This file implements the IsAssignableTo class traits and its partial specialisation for each standard numeric types. More...

#include <type_traits>
#include "TFEL/Config/TFELConfig.hxx"
#include "TFEL/TypeTraits/Promote.hxx"
#include "TFEL/Math/Forward/Complex.hxx"

Classes

class  tfel::typetraits::IsAssignableTo< A, B >
 Traits class which says if an object a of type A is assignable to an object b of type B, ie if b = a is valid. More...

Namespaces

namespace  tfel
 the namespace tfel encloses all the TFEL project. This namespace is empty.

Macros

#define TFEL_MATH_IS_ASSIGNABLE_(X, Y)
 An helper macro to specialise IsAssignableTo for each standard numeric types.
#define TFEL_MATH_IS_ASSIGNABLE(X)
 An helper macro to specialise IsAssignableTo for each standard numeric types.

Functions

 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (unsigned short)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (unsigned int)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (long unsigned int)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (short)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (int)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (long int)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (float)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (double)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (long double)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< unsigned short >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< unsigned int >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< long unsigned int >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< short >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< int >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< long int >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< float >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< double >)
 tfel::typetraits::TFEL_MATH_IS_ASSIGNABLE (tfel::math::Complex< long double >)
template<typename A, typename B>
TFEL_HOST_DEVICE constexpr bool tfel::typetraits::isAssignableTo ()
 an helper function around IsAssignableTo

Detailed Description

This file implements the IsAssignableTo class traits and its partial specialisation for each standard numeric types.

Author
Thomas Helfer
Date
28/06/2006

Macro Definition Documentation

◆ TFEL_MATH_IS_ASSIGNABLE

#define TFEL_MATH_IS_ASSIGNABLE ( X)
Value:
TFEL_MATH_IS_ASSIGNABLE_(X, unsigned short); \
TFEL_MATH_IS_ASSIGNABLE_(X, unsigned int); \
TFEL_MATH_IS_ASSIGNABLE_(X, long unsigned int); \
TFEL_MATH_IS_ASSIGNABLE_(X, short); \
TFEL_MATH_IS_ASSIGNABLE_(X, int); \
TFEL_MATH_IS_ASSIGNABLE_(X, long int); \
TFEL_MATH_IS_ASSIGNABLE_(X, float); \
TFEL_MATH_IS_ASSIGNABLE_(X, double); \
TFEL_MATH_IS_ASSIGNABLE_(X, long double); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<unsigned short>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<unsigned int>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<long unsigned int>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<short>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<int>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<long int>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<float>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<double>); \
TFEL_MATH_IS_ASSIGNABLE_(X, tfel::math::Complex<long double>)
#define TFEL_MATH_IS_ASSIGNABLE_(X, Y)
An helper macro to specialise IsAssignableTo for each standard numeric types.
Definition IsAssignableTo.hxx:31
std::complex< ValueType > Complex
an alias std::complex.
Definition Forward/Complex.hxx:47

An helper macro to specialise IsAssignableTo for each standard numeric types.

Author
Thomas Helfer
Date
28/06/2006

◆ TFEL_MATH_IS_ASSIGNABLE_

#define TFEL_MATH_IS_ASSIGNABLE_ ( X,
Y )
Value:
\
template <> \
struct IsAssignableTo<X, Y> { \ \
static constexpr bool value = std::is_same_v<Promote<X, Y>::type, Y>; \ \
static constexpr bool cond = std::is_same_v<Promote<X, Y>::type, Y>; \
}

An helper macro to specialise IsAssignableTo for each standard numeric types.

Author
Thomas Helfer
Date
28/06/2006

Function Documentation

◆ isAssignableTo()

template<typename A, typename B>
TFEL_HOST_DEVICE constexpr bool tfel::typetraits::isAssignableTo ( )
constexpr

an helper function around IsAssignableTo

Template Parameters
A,firsttype
B,secondtype