1//
2//! Copyright (c) 2011-2012
3//! Brandon Kohn
4//
5// Distributed under the Boost Software License, Version 1.0. (See
6// accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9namespace boost { namespace numeric {
10
11
12 template <>
13 struct numeric_cast_traits
14 <
15 char
16 , boost::long_long_type
17 >
18 {
19 typedef def_overflow_handler overflow_policy;
20 typedef UseInternalRangeChecker range_checking_policy;
21 typedef Trunc<boost::long_long_type> rounding_policy;
22 };
23
24 template <>
25 struct numeric_cast_traits
26 <
27 char
28 , boost::ulong_long_type
29 >
30 {
31 typedef def_overflow_handler overflow_policy;
32 typedef UseInternalRangeChecker range_checking_policy;
33 typedef Trunc<boost::ulong_long_type> rounding_policy;
34 };
35
36 template <>
37 struct numeric_cast_traits
38 <
39 signed char
40 , boost::long_long_type
41 >
42 {
43 typedef def_overflow_handler overflow_policy;
44 typedef UseInternalRangeChecker range_checking_policy;
45 typedef Trunc<boost::long_long_type> rounding_policy;
46 };
47
48 template <>
49 struct numeric_cast_traits
50 <
51 signed char
52 , boost::ulong_long_type
53 >
54 {
55 typedef def_overflow_handler overflow_policy;
56 typedef UseInternalRangeChecker range_checking_policy;
57 typedef Trunc<boost::ulong_long_type> rounding_policy;
58 };
59
60 template <>
61 struct numeric_cast_traits
62 <
63 unsigned char
64 , boost::long_long_type
65 >
66 {
67 typedef def_overflow_handler overflow_policy;
68 typedef UseInternalRangeChecker range_checking_policy;
69 typedef Trunc<boost::long_long_type> rounding_policy;
70 };
71
72 template <>
73 struct numeric_cast_traits
74 <
75 unsigned char
76 , boost::ulong_long_type
77 >
78 {
79 typedef def_overflow_handler overflow_policy;
80 typedef UseInternalRangeChecker range_checking_policy;
81 typedef Trunc<boost::ulong_long_type> rounding_policy;
82 };
83
84 template <>
85 struct numeric_cast_traits
86 <
87 short
88 , boost::long_long_type
89 >
90 {
91 typedef def_overflow_handler overflow_policy;
92 typedef UseInternalRangeChecker range_checking_policy;
93 typedef Trunc<boost::long_long_type> rounding_policy;
94 };
95
96 template <>
97 struct numeric_cast_traits
98 <
99 short
100 , boost::ulong_long_type
101 >
102 {
103 typedef def_overflow_handler overflow_policy;
104 typedef UseInternalRangeChecker range_checking_policy;
105 typedef Trunc<boost::ulong_long_type> rounding_policy;
106 };
107
108 template <>
109 struct numeric_cast_traits
110 <
111 unsigned short
112 , boost::long_long_type
113 >
114 {
115 typedef def_overflow_handler overflow_policy;
116 typedef UseInternalRangeChecker range_checking_policy;
117 typedef Trunc<boost::long_long_type> rounding_policy;
118 };
119
120 template <>
121 struct numeric_cast_traits
122 <
123 unsigned short
124 , boost::ulong_long_type
125 >
126 {
127 typedef def_overflow_handler overflow_policy;
128 typedef UseInternalRangeChecker range_checking_policy;
129 typedef Trunc<boost::ulong_long_type> rounding_policy;
130 };
131
132 template <>
133 struct numeric_cast_traits
134 <
135 int
136 , boost::long_long_type
137 >
138 {
139 typedef def_overflow_handler overflow_policy;
140 typedef UseInternalRangeChecker range_checking_policy;
141 typedef Trunc<boost::long_long_type> rounding_policy;
142 };
143
144 template <>
145 struct numeric_cast_traits
146 <
147 int
148 , boost::ulong_long_type
149 >
150 {
151 typedef def_overflow_handler overflow_policy;
152 typedef UseInternalRangeChecker range_checking_policy;
153 typedef Trunc<boost::ulong_long_type> rounding_policy;
154 };
155
156 template <>
157 struct numeric_cast_traits
158 <
159 unsigned int
160 , boost::long_long_type
161 >
162 {
163 typedef def_overflow_handler overflow_policy;
164 typedef UseInternalRangeChecker range_checking_policy;
165 typedef Trunc<boost::long_long_type> rounding_policy;
166 };
167
168 template <>
169 struct numeric_cast_traits
170 <
171 unsigned int
172 , boost::ulong_long_type
173 >
174 {
175 typedef def_overflow_handler overflow_policy;
176 typedef UseInternalRangeChecker range_checking_policy;
177 typedef Trunc<boost::ulong_long_type> rounding_policy;
178 };
179
180 template <>
181 struct numeric_cast_traits
182 <
183 long
184 , boost::long_long_type
185 >
186 {
187 typedef def_overflow_handler overflow_policy;
188 typedef UseInternalRangeChecker range_checking_policy;
189 typedef Trunc<boost::long_long_type> rounding_policy;
190 };
191
192 template <>
193 struct numeric_cast_traits
194 <
195 long
196 , boost::ulong_long_type
197 >
198 {
199 typedef def_overflow_handler overflow_policy;
200 typedef UseInternalRangeChecker range_checking_policy;
201 typedef Trunc<boost::ulong_long_type> rounding_policy;
202 };
203
204 template <>
205 struct numeric_cast_traits
206 <
207 unsigned long
208 , boost::long_long_type
209 >
210 {
211 typedef def_overflow_handler overflow_policy;
212 typedef UseInternalRangeChecker range_checking_policy;
213 typedef Trunc<boost::long_long_type> rounding_policy;
214 };
215
216 template <>
217 struct numeric_cast_traits
218 <
219 unsigned long
220 , boost::ulong_long_type
221 >
222 {
223 typedef def_overflow_handler overflow_policy;
224 typedef UseInternalRangeChecker range_checking_policy;
225 typedef Trunc<boost::ulong_long_type> rounding_policy;
226 };
227
228 template <>
229 struct numeric_cast_traits
230 <
231 float
232 , boost::long_long_type
233 >
234 {
235 typedef def_overflow_handler overflow_policy;
236 typedef UseInternalRangeChecker range_checking_policy;
237 typedef Trunc<boost::long_long_type> rounding_policy;
238 };
239
240 template <>
241 struct numeric_cast_traits
242 <
243 float
244 , boost::ulong_long_type
245 >
246 {
247 typedef def_overflow_handler overflow_policy;
248 typedef UseInternalRangeChecker range_checking_policy;
249 typedef Trunc<boost::ulong_long_type> rounding_policy;
250 };
251
252 template <>
253 struct numeric_cast_traits
254 <
255 double
256 , boost::long_long_type
257 >
258 {
259 typedef def_overflow_handler overflow_policy;
260 typedef UseInternalRangeChecker range_checking_policy;
261 typedef Trunc<boost::long_long_type> rounding_policy;
262 };
263
264 template <>
265 struct numeric_cast_traits
266 <
267 double
268 , boost::ulong_long_type
269 >
270 {
271 typedef def_overflow_handler overflow_policy;
272 typedef UseInternalRangeChecker range_checking_policy;
273 typedef Trunc<boost::ulong_long_type> rounding_policy;
274 };
275
276 template <>
277 struct numeric_cast_traits
278 <
279 long double
280 , boost::long_long_type
281 >
282 {
283 typedef def_overflow_handler overflow_policy;
284 typedef UseInternalRangeChecker range_checking_policy;
285 typedef Trunc<boost::long_long_type> rounding_policy;
286 };
287
288 template <>
289 struct numeric_cast_traits
290 <
291 long double
292 , boost::ulong_long_type
293 >
294 {
295 typedef def_overflow_handler overflow_policy;
296 typedef UseInternalRangeChecker range_checking_policy;
297 typedef Trunc<boost::ulong_long_type> rounding_policy;
298 };
299
300 template <>
301 struct numeric_cast_traits
302 <
303 boost::long_long_type
304 , boost::long_long_type
305 >
306 {
307 typedef def_overflow_handler overflow_policy;
308 typedef UseInternalRangeChecker range_checking_policy;
309 typedef Trunc<boost::long_long_type> rounding_policy;
310 };
311
312 template <>
313 struct numeric_cast_traits
314 <
315 boost::long_long_type
316 , boost::ulong_long_type
317 >
318 {
319 typedef def_overflow_handler overflow_policy;
320 typedef UseInternalRangeChecker range_checking_policy;
321 typedef Trunc<boost::ulong_long_type> rounding_policy;
322 };
323
324 template <>
325 struct numeric_cast_traits
326 <
327 boost::ulong_long_type
328 , boost::long_long_type
329 >
330 {
331 typedef def_overflow_handler overflow_policy;
332 typedef UseInternalRangeChecker range_checking_policy;
333 typedef Trunc<boost::long_long_type> rounding_policy;
334 };
335
336 template <>
337 struct numeric_cast_traits
338 <
339 boost::ulong_long_type
340 , boost::ulong_long_type
341 >
342 {
343 typedef def_overflow_handler overflow_policy;
344 typedef UseInternalRangeChecker range_checking_policy;
345 typedef Trunc<boost::ulong_long_type> rounding_policy;
346 };
347}}
348