3 #ifndef DUNE_PROMOTIONTRAITS_HH
4 #define DUNE_PROMOTIONTRAITS_HH
26 template <
typename T1,
typename T2>
27 struct PromotionTraits { };
31 template <
typename T1>
32 struct PromotionTraits<T1,T1> {
typedef T1 PromotedType; };
35 template <
typename T1>
36 struct PromotionTraits<std::complex<T1>,T1> {
typedef std::complex<T1> PromotedType; };
39 template <
typename T1>
40 struct PromotionTraits<T1,std::complex<T1> > {
typedef std::complex<T1> PromotedType; };
43 template<>
struct PromotionTraits<std::complex<double>,std::complex<double> > {
typedef std::complex<double> PromotedType; };
44 template<>
struct PromotionTraits<std::complex<double>,double> {
typedef std::complex<double> PromotedType; };
45 template<>
struct PromotionTraits<double,std::complex<double> > {
typedef std::complex<double> PromotedType; };
46 template<>
struct PromotionTraits<double,double> {
typedef double PromotedType; };
48 template<>
struct PromotionTraits<std::complex<float>,float> {
typedef std::complex<float> PromotedType; };
49 template<>
struct PromotionTraits<float,std::complex<float> > {
typedef std::complex<float> PromotedType; };
50 template<>
struct PromotionTraits<std::complex<float>,std::complex<float> > {
typedef std::complex<float> PromotedType; };
51 template<>
struct PromotionTraits<float,float> {
typedef float PromotedType; };
53 template<>
struct PromotionTraits<std::complex<int>,int> {
typedef std::complex<int> PromotedType; };
54 template<>
struct PromotionTraits<int,std::complex<int> > {
typedef std::complex<int> PromotedType; };
55 template<>
struct PromotionTraits<std::complex<int>,std::complex<int> > {
typedef std::complex<int> PromotedType; };
56 template<>
struct PromotionTraits<int,int> {
typedef int PromotedType; };
63 #endif // DUNE_PROMOTIONTRAITS_HH