namespace alps {
typedef ... type_tag_t;
template <class T> struct TypeTraits;
template <> struct TypeTraits<int8_t>;
template <> struct TypeTraits<uint8_t>;
template <> struct TypeTraits<int16_t>;
template <> struct TypeTraits<uint16_t>;
template <> struct TypeTraits<int32_t>;
template <> struct TypeTraits<uint32_t>;
template <> struct TypeTraits<int64_t>;
template <> struct TypeTraits<uint64_t>;
template <> struct TypeTraits<float>;
template <> struct TypeTraits<double>;
template <> struct TypeTraits<long double>;
template <> struct TypeTraits<std::complex<float> >;
template <> struct TypeTraits<std::complex<double> >;
template <> struct TypeTraits<std::complex<long double> >;
template <> struct TypeTraits<bool>;
template <> struct TypeTraits<std::string>;
template <class T> struct NumericTypeConversion;
}
| Member | Type | Description |
| TypeTraits<T>::is_specialized | bool | true if the template has been specialized for the template parameter |
| TypeTraits<T>::is_complex | bool | true if the type T is complex |
| TypeTraits<T>::type_tag | palm::type_tag_t | a unique integral identifier for all types for which the template has been specialized |
| TypeTraits<T>::norm_t | type to store the norm of a number of typeT | |
| TypeTraits<T>::average_t | type to store averages of numbers of typeT | |
| TypeTraits<T>::signed_t | for integral types, the signed version of the type T, otherwise the type itself | |
| TypeTraits<T>::unsigned_t | for integral types, the unsigned version of the type T, otherwise the type itself | |
| TypeTraits<T>::real_t | for complex types, the real base type of type T, otherwise the type itself | |
| TypeTraits<T>::epsilon() | the machine precision of TypeTraits<T>::norm_t |
The appropriate_type is a type to which X can be converted without loss of precision when afterwards a numeric operation with type T is planned. As there are far fewer appropriate_types than types T code proliferation can be reduced.NumericTypeConversion<T,X>::appropriate_type