Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
promote.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_PROMOTE_H
2#define _RHEOLEF_PROMOTE_H
23#include "rheolef/compiler.h"
24namespace rheolef {
25template<class T1, class T2>
27
28template<class T1, class T2>
32#define skit_promote(T1,T2) typename promote<T1,T2>::type
33
34template <> struct promote<char, char > { typedef int type; };
35template <> struct promote<char, unsigned char > { typedef int type; };
36template <> struct promote<char, short int > { typedef int type; };
37template <> struct promote<char, short unsigned int > { typedef unsigned int type; };
38template <> struct promote<char, int > { typedef int type; };
39template <> struct promote<char, unsigned int > { typedef unsigned int type; };
40template <> struct promote<char, long > { typedef long type; };
41template <> struct promote<char, unsigned long > { typedef unsigned long type; };
42template <> struct promote<char, float > { typedef float type; };
43template <> struct promote<char, double > { typedef double type; };
44template <> struct promote<char, long double > { typedef long double type; };
45template <> struct promote<unsigned char, char > { typedef int type; };
46template <> struct promote<unsigned char, unsigned char > { typedef int type; };
47template <> struct promote<unsigned char, short int > { typedef int type; };
48template <> struct promote<unsigned char, short unsigned int > { typedef unsigned int type; };
49template <> struct promote<unsigned char, int > { typedef int type; };
50template <> struct promote<unsigned char, unsigned int > { typedef unsigned int type; };
51template <> struct promote<unsigned char, long > { typedef long type; };
52template <> struct promote<unsigned char, unsigned long > { typedef unsigned long type; };
53template <> struct promote<unsigned char, float > { typedef float type; };
54template <> struct promote<unsigned char, double > { typedef double type; };
55template <> struct promote<unsigned char, long double > { typedef long double type; };
56template <> struct promote<short int, char > { typedef int type; };
57template <> struct promote<short int, unsigned char > { typedef int type; };
58template <> struct promote<short int, short int > { typedef int type; };
59template <> struct promote<short int, short unsigned int > { typedef unsigned int type; };
60template <> struct promote<short int, int > { typedef int type; };
61template <> struct promote<short int, unsigned int > { typedef unsigned int type; };
62template <> struct promote<short int, long > { typedef long type; };
63template <> struct promote<short int, unsigned long > { typedef unsigned long type; };
64template <> struct promote<short int, float > { typedef float type; };
65template <> struct promote<short int, double > { typedef double type; };
66template <> struct promote<short unsigned int, char > { typedef unsigned int type; };
67template <> struct promote<short unsigned int, unsigned char > { typedef unsigned int type; };
68template <> struct promote<short unsigned int, short int > { typedef unsigned int type; };
69template <> struct promote<short unsigned int, short unsigned int > { typedef unsigned int type; };
70template <> struct promote<short unsigned int, int > { typedef unsigned int type; };
71template <> struct promote<short unsigned int, unsigned int > { typedef unsigned int type; };
72template <> struct promote<short unsigned int, long > { typedef long type; };
73template <> struct promote<short unsigned int, unsigned long > { typedef unsigned long type; };
74template <> struct promote<short unsigned int, float > { typedef float type; };
75template <> struct promote<short unsigned int, double > { typedef double type; };
76template <> struct promote<short unsigned int, long double > { typedef long double type; };
77template <> struct promote<int, char > { typedef int type; };
78template <> struct promote<int, unsigned char > { typedef int type; };
79template <> struct promote<int, short int > { typedef int type; };
80template <> struct promote<int, short unsigned int > { typedef unsigned int type; };
81template <> struct promote<int, int > { typedef int type; };
82template <> struct promote<int, unsigned int > { typedef unsigned int type; };
83template <> struct promote<int, long > { typedef long type; };
84template <> struct promote<int, unsigned long > { typedef unsigned long type; };
85template <> struct promote<int, float > { typedef float type; };
86template <> struct promote<int, double > { typedef double type; };
87template <> struct promote<int, long double > { typedef long double type; };
88template <> struct promote<unsigned int, char > { typedef unsigned int type; };
89template <> struct promote<unsigned int, unsigned char > { typedef unsigned int type; };
90template <> struct promote<unsigned int, short int > { typedef unsigned int type; };
91template <> struct promote<unsigned int, short unsigned int > { typedef unsigned int type; };
92template <> struct promote<unsigned int, int > { typedef unsigned int type; };
93template <> struct promote<unsigned int, unsigned int > { typedef unsigned int type; };
94template <> struct promote<unsigned int, long > { typedef long type; };
95template <> struct promote<unsigned int, unsigned long > { typedef unsigned long type; };
96template <> struct promote<unsigned int, float > { typedef float type; };
97template <> struct promote<unsigned int, double > { typedef double type; };
98template <> struct promote<unsigned int, long double > { typedef long double type; };
99template <> struct promote<long, char > { typedef long type; };
100template <> struct promote<long, unsigned char > { typedef long type; };
101template <> struct promote<long, short int > { typedef long type; };
102template <> struct promote<long, short unsigned int > { typedef long type; };
103template <> struct promote<long, int > { typedef long type; };
104template <> struct promote<long, unsigned int > { typedef long type; };
105template <> struct promote<long, long > { typedef long type; };
106template <> struct promote<long, unsigned long > { typedef unsigned long type; };
107template <> struct promote<long, float > { typedef float type; };
108template <> struct promote<long, double > { typedef double type; };
109template <> struct promote<long, long double > { typedef long double type; };
110template <> struct promote<unsigned long, char > { typedef unsigned long type; };
111template <> struct promote<unsigned long, unsigned char > { typedef unsigned long type; };
112template <> struct promote<unsigned long, short int > { typedef unsigned long type; };
113template <> struct promote<unsigned long, short unsigned int > { typedef unsigned long type; };
114template <> struct promote<unsigned long, int > { typedef unsigned long type; };
115template <> struct promote<unsigned long, unsigned int > { typedef unsigned long type; };
116template <> struct promote<unsigned long, long > { typedef unsigned long type; };
117template <> struct promote<unsigned long, unsigned long > { typedef unsigned long type; };
118template <> struct promote<unsigned long, float > { typedef float type; };
119template <> struct promote<unsigned long, double > { typedef double type; };
120template <> struct promote<unsigned long, long double > { typedef long double type; };
121template <> struct promote<float, char > { typedef float type; };
122template <> struct promote<float, unsigned char > { typedef float type; };
123template <> struct promote<float, short int > { typedef float type; };
124template <> struct promote<float, short unsigned int > { typedef float type; };
125template <> struct promote<float, int > { typedef float type; };
126template <> struct promote<float, unsigned int > { typedef float type; };
127template <> struct promote<float, long > { typedef float type; };
128template <> struct promote<float, unsigned long > { typedef float type; };
129template <> struct promote<float, float > { typedef float type; };
130template <> struct promote<float, double > { typedef double type; };
131template <> struct promote<float, long double > { typedef long double type; };
132template <> struct promote<double, char > { typedef double type; };
133template <> struct promote<double, unsigned char > { typedef double type; };
134template <> struct promote<double, short int > { typedef double type; };
135template <> struct promote<double, short unsigned int > { typedef double type; };
136template <> struct promote<double, int > { typedef double type; };
137template <> struct promote<double, unsigned int > { typedef double type; };
138template <> struct promote<double, long > { typedef double type; };
139template <> struct promote<double, unsigned long > { typedef double type; };
140template <> struct promote<double, float > { typedef double type; };
141template <> struct promote<double, double > { typedef double type; };
142template <> struct promote<double, long double > { typedef long double type; };
143template <> struct promote<long double, char > { typedef long double type; };
144template <> struct promote<long double, unsigned char > { typedef long double type; };
145template <> struct promote<long double, short int > { typedef long double type; };
146template <> struct promote<long double, short unsigned int > { typedef long double type; };
147template <> struct promote<long double, int > { typedef long double type; };
148template <> struct promote<long double, unsigned int > { typedef long double type; };
149template <> struct promote<long double, long > { typedef long double type; };
150template <> struct promote<long double, unsigned long > { typedef long double type; };
151template <> struct promote<long double, float > { typedef long double type; };
152template <> struct promote<long double, double > { typedef long double type; };
153template <> struct promote<long double, long double > { typedef long double type; };
154
155#ifdef _RHEOLEF_HAVE_FLOAT128
156 template <> struct promote<char, float128 > { typedef float128 type; };
157 template <> struct promote<unsigned char, float128 > { typedef float128 type; };
158 template <> struct promote<short unsigned int, float128 > { typedef float128 type; };
159 template <> struct promote<int, float128 > { typedef float128 type; };
160 template <> struct promote<unsigned int, float128 > { typedef float128 type; };
161 template <> struct promote<long, float128 > { typedef float128 type; };
162 template <> struct promote<unsigned long, float128 > { typedef float128 type; };
163 template <> struct promote<float, float128 > { typedef float128 type; };
164 template <> struct promote<double, float128 > { typedef float128 type; };
165 template <> struct promote<float128, char > { typedef float128 type; };
166 template <> struct promote<float128, unsigned char > { typedef float128 type; };
167 template <> struct promote<float128, short int > { typedef float128 type; };
168 template <> struct promote<float128, short unsigned int > { typedef float128 type; };
169 template <> struct promote<float128, int > { typedef float128 type; };
170 template <> struct promote<float128, unsigned int > { typedef float128 type; };
171 template <> struct promote<float128, long > { typedef float128 type; };
172 template <> struct promote<float128, unsigned long > { typedef float128 type; };
173 template <> struct promote<float128, float > { typedef float128 type; };
174 template <> struct promote<float128, double > { typedef float128 type; };
175 template <> struct promote<float128, float128 > { typedef float128 type; };
176#endif // _RHEOLEF_HAVE_FLOAT128
177
178} // namespace rheolef
179#endif /* _RHEOLEF_PROMOTE_H */
This file is part of Rheolef.
promote_not_specialized_for_this_case< T1, T2 > type
Definition promote.h:30