namespace alps { typedef ... type_tag_t; template <class T> struct type_traits; template <> struct type_traits<int8_t>; template <> struct type_traits<uint8_t>; template <> struct type_traits<int16_t>; template <> struct type_traits<uint16_t>; template <> struct type_traits<int32_t>; template <> struct type_traits<uint32_t>; template <> struct type_traits<int64_t>; template <> struct type_traits<uint64_t>; template <> struct type_traits<float>; template <> struct type_traits<double>; template <> struct type_traits<long double>; template <> struct type_traits<std::complex<float> >; template <> struct type_traits<std::complex<double> >; template <> struct type_traits<std::complex<long double> >; template <> struct type_traits<bool>; template <> struct type_traits<std::string>; template <class T> struct NumericTypeConversion; }
Member | Type | Description |
type_traits<T>::is_specialized | bool | true if the template has been specialized for the template parameter |
type_traits<T>::is_complex | bool | true if the type T is complex |
type_traits<T>::type_tag | palm::type_tag_t | a unique integral identifier for all types for which the template has been specialized |
type_traits<T>::norm_t | type to store the norm of a number of typeT | |
type_traits<T>::average_t | type to store averages of numbers of typeT | |
type_traits<T>::signed_t | for integral types, the signed version of the type T, otherwise the type itself | |
type_traits<T>::unsigned_t | for integral types, the unsigned version of the type T, otherwise the type itself | |
type_traits<T>::real_t | for complex types, the real base type of type T, otherwise the type itself | |
type_traits<T>::epsilon() | the machine precision of type_traits<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
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)