Fork me on GitHub

source: svn/trunk/Utilities/HepMC/interface/is_arithmetic.h@ 996

Last change on this file since 996 was 349, checked in by severine ovyn, 16 years ago

first test

File size: 1.9 KB
Line 
1#ifndef IS_ARITHMETIC
2#define IS_ARITHMETIC
3// author: Walter Brown
4
5// ----------------------------------------------------------------------
6// prolog
7
8namespace HepMC {
9
10///
11/// \namespace detail
12/// internal namespace
13///
14namespace detail {
15
16
17// ----------------------------------------------------------------------
18// is_arithmetic<>
19
20/// undefined and therefore non-arithmetic
21template< class T >
22 struct is_arithmetic
23{
24 static bool const value = false;
25};
26
27/// character is arithmetic
28template<>
29 struct is_arithmetic<char>
30{ static bool const value = true; };
31
32/// unsigned character is arithmetic
33template<>
34 struct is_arithmetic<unsigned char>
35{ static bool const value = true; };
36
37/// signed character is arithmetic
38template<>
39 struct is_arithmetic<signed char>
40{ static bool const value = true; };
41
42/// short is arithmetic
43template<>
44 struct is_arithmetic<short>
45{ static bool const value = true; };
46
47/// unsigned short is arithmetic
48template<>
49 struct is_arithmetic<unsigned short>
50{ static bool const value = true; };
51
52/// int is arithmetic
53template<>
54 struct is_arithmetic<int>
55{ static bool const value = true; };
56
57/// unsigned int is arithmetic
58template<>
59 struct is_arithmetic<unsigned int>
60{ static bool const value = true; };
61
62/// long is arithmetic
63template<>
64 struct is_arithmetic<long>
65{ static bool const value = true; };
66
67/// unsigned long is arithmetic
68template<>
69 struct is_arithmetic<unsigned long>
70{ static bool const value = true; };
71
72/// float is arithmetic
73template<>
74 struct is_arithmetic<float>
75{ static bool const value = true; };
76
77/// double is arithmetic
78template<>
79 struct is_arithmetic<double>
80{ static bool const value = true; };
81
82/// long double is arithmetic
83template<>
84 struct is_arithmetic<long double>
85{ static bool const value = true; };
86
87
88// ----------------------------------------------------------------------
89// epilog
90
91} // namespace detail
92} // namespace HepMC
93
94#endif // IS_ARITHMETIC
Note: See TracBrowser for help on using the repository browser.