OSDN Git Service

structure Add. (move from main roast)
[roast/pendding.git] / include / roast / structure / numeric.hpp
1 //      Roast+ License
2 /*
3 */
4 #ifndef __SFJP_ROAST__structure__numeric_HPP__
5 #define __SFJP_ROAST__structure__numeric_HPP__
6
7 namespace roast
8 {
9         namespace structure
10         {
11                 //////////////////////////////////////////////////////
12                 
13                 template <typename T>
14                 struct numeric_ : public _basic_type<T>
15                 {
16                         numeric_():_basic_type<T>(0){}
17                         numeric_(T v):_basic_type<T>(v){}
18                 };
19                 
20                 /////
21                 struct char_ : public numeric_<char>
22                 {
23                         char_(){}
24                         char_(char v):numeric_<char>(v){}
25                 };
26
27                 struct short_ : public numeric_<short>
28                 {
29                         short_(){}
30                         short_(short v):numeric_<short>(v){}
31                 };
32
33                 struct int_ : public numeric_<int>
34                 {
35                         int_(){}
36                         int_(int v):numeric_<int>(v){}
37                 };
38
39                 struct long_ : public numeric_<long>
40                 {
41                         long_(){}
42                         long_(long v):numeric_<long>(v){}
43                 };
44                 
45                 ///////
46                 
47                 struct uchar_ : public numeric_<unsigned char>
48                 {
49                         uchar_(){}
50                         uchar_(unsigned char v):numeric_<unsigned char>(v){}
51                 };
52
53                 struct ushort_ : public numeric_<unsigned short>
54                 {
55                         ushort_(){}
56                         ushort_(unsigned short v):numeric_<unsigned short>(v){}
57                 };
58
59                 struct uint_ : public numeric_<unsigned int>
60                 {
61                         uint_(){}
62                         uint_(unsigned int v):numeric_<unsigned int>(v){}
63                 };
64
65                 struct ulong_ : public numeric_<unsigned long>
66                 {
67                         ulong_(){}
68                         ulong_(unsigned long v):numeric_<unsigned long>(v){}
69                 };
70
71                 //////////////////////////////////////////////////////
72         }
73 }
74
75 #endif//__SFJP_ROAST__structure__numeric_HPP__