00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef STLSOFT_INCL_H_STLSOFT
00060 # include "stlsoft.h"
00061 #endif
00062 #ifndef STLSOFT_INCL_H_STLSOFT_SIZE_TRAITS
00063 # include "stlsoft_size_traits.h"
00064 #endif
00065
00066
00067
00068
00069
00070 #ifndef _STLSOFT_NO_NAMESPACE
00071 namespace stlsoft
00072 {
00073 #endif
00074
00075
00076
00077
00078
00079
00080
00081 #ifdef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00092 template <ss_typename_param_k T>
00093 struct sign_traits
00094 {
00095 enum
00096 {
00097 bytes = 1
00098 , bits = 8
00099 };
00100
00101 typedef signed T signed_type;
00102 typedef unsigned T unsigned_type;
00103 typedef unsigned T alt_sign_type;
00104 };
00105
00106 #else
00107
00108 template <ss_typename_param_k T>
00109 struct sign_traits;
00110
00111
00112 STLSOFT_TEMPLATE_SPECIALISATION
00113 struct sign_traits<ss_char_a_t>
00114 {
00115 enum { bytes = 1, bits = 8 * bytes };
00116
00117 typedef ss_uint8_t signed_type;
00118 typedef ss_uint8_t unsigned_type;
00119
00120 };
00121
00122 #ifdef __STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
00123 STLSOFT_TEMPLATE_SPECIALISATION
00124 struct sign_traits<ss_char_w_t>
00125 {
00126 enum { bytes = sizeof(ss_char_w_t), bits = 8 * bytes };
00127
00128 typedef int_size_traits<bytes>::signed_type signed_type;
00129 typedef int_size_traits<bytes>::unsigned_type unsigned_type;
00130 };
00131 #endif
00132
00133
00134 STLSOFT_TEMPLATE_SPECIALISATION
00135 struct sign_traits<ss_sint8_t>
00136 {
00137 enum { bytes = 1, bits = 8 * bytes };
00138
00139 typedef ss_sint8_t signed_type;
00140 typedef ss_uint8_t unsigned_type;
00141 typedef ss_uint8_t alt_sign_type;
00142 };
00143
00144 STLSOFT_TEMPLATE_SPECIALISATION
00145 struct sign_traits<ss_uint8_t>
00146 {
00147 enum { bytes = 1, bits = 8 * bytes };
00148
00149 typedef ss_sint8_t signed_type;
00150 typedef ss_uint8_t unsigned_type;
00151 typedef ss_sint8_t alt_sign_type;
00152 };
00153
00154
00155 STLSOFT_TEMPLATE_SPECIALISATION
00156 struct sign_traits<ss_sint16_t>
00157 {
00158 enum { bytes = 2, bits = 8 * bytes };
00159
00160 typedef ss_sint16_t signed_type;
00161 typedef ss_uint16_t unsigned_type;
00162 typedef ss_uint16_t alt_sign_type;
00163 };
00164
00165 STLSOFT_TEMPLATE_SPECIALISATION
00166 struct sign_traits<ss_uint16_t>
00167 {
00168 enum { bytes = 2, bits = 8 * bytes };
00169
00170 typedef ss_sint16_t signed_type;
00171 typedef ss_uint16_t unsigned_type;
00172 typedef ss_sint16_t alt_sign_type;
00173 };
00174
00175
00176 STLSOFT_TEMPLATE_SPECIALISATION
00177 struct sign_traits<ss_sint32_t>
00178 {
00179 enum { bytes = 4, bits = 8 * bytes };
00180
00181 typedef ss_sint32_t signed_type;
00182 typedef ss_uint32_t unsigned_type;
00183 typedef ss_uint32_t alt_sign_type;
00184 };
00185
00186 STLSOFT_TEMPLATE_SPECIALISATION
00187 struct sign_traits<ss_uint32_t>
00188 {
00189 enum { bytes = 4, bits = 8 * bytes };
00190
00191 typedef ss_sint32_t signed_type;
00192 typedef ss_uint32_t unsigned_type;
00193 typedef ss_sint32_t alt_sign_type;
00194 };
00195
00196 #ifdef STLSOFT_CF_64BIT_INT_SUPPORT
00197
00198 STLSOFT_TEMPLATE_SPECIALISATION
00199 struct sign_traits<ss_sint64_t>
00200 {
00201 enum { bytes = 8, bits = 8 * bytes };
00202
00203 typedef ss_sint64_t signed_type;
00204 typedef ss_uint64_t unsigned_type;
00205 typedef ss_uint64_t alt_sign_type;
00206 };
00207
00208 STLSOFT_TEMPLATE_SPECIALISATION
00209 struct sign_traits<ss_uint64_t>
00210 {
00211 enum { bytes = 8, bits = 8 * bytes };
00212
00213 typedef ss_sint64_t signed_type;
00214 typedef ss_uint64_t unsigned_type;
00215 typedef ss_sint64_t alt_sign_type;
00216 };
00217 #endif
00218
00219 #endif
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231