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
00047 #ifndef STLSOFT_INCL_STLSOFT_CONVERSION_HPP_EXPLICIT_CAST
00048 # error This file is included from within stlsoft/conversion/explicit_cast.hpp, and cannot be included directly
00049 #else
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_MAJOR 4
00053 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_MINOR 0
00054 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_REVISION 1
00055 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_EDIT 21
00056 #endif
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 STLSOFT_TEMPLATE_SPECIALISATION
00072 class explicit_cast<char const&>
00073 {
00074 public:
00075 typedef char value_type;
00076 typedef explicit_cast<char> class_type;
00077
00078
00079 public:
00080 explicit_cast(char const& t)
00081 : m_t(t)
00082 {}
00083
00084
00085 public:
00086 operator char const& () const
00087 {
00088 return m_t;
00089 }
00090
00091
00092 private:
00093 char const& m_t;
00094 };
00095
00096 #ifdef STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
00097
00098 STLSOFT_TEMPLATE_SPECIALISATION
00099 class explicit_cast<wchar_t const&>
00100 {
00101 public:
00102 typedef wchar_t value_type;
00103 typedef explicit_cast<wchar_t> class_type;
00104
00105
00106 public:
00107 explicit_cast(wchar_t const& t)
00108 : m_t(t)
00109 {}
00110
00111
00112 public:
00113 operator wchar_t const& () const
00114 {
00115 return m_t;
00116 }
00117
00118
00119 private:
00120 wchar_t const& m_t;
00121 };
00122
00123 #endif
00124
00125 STLSOFT_TEMPLATE_SPECIALISATION
00126 class explicit_cast<unsigned char const&>
00127 {
00128 public:
00129 typedef unsigned char value_type;
00130 typedef explicit_cast<unsigned char> class_type;
00131
00132
00133 public:
00134 explicit_cast(unsigned char const& t)
00135 : m_t(t)
00136 {}
00137
00138
00139 public:
00140 operator unsigned char const& () const
00141 {
00142 return m_t;
00143 }
00144
00145
00146 private:
00147 unsigned char const& m_t;
00148 };
00149
00150 STLSOFT_TEMPLATE_SPECIALISATION
00151 class explicit_cast<signed char const&>
00152 {
00153 public:
00154 typedef signed char value_type;
00155 typedef explicit_cast<signed char> class_type;
00156
00157
00158 public:
00159 explicit_cast(signed char const& t)
00160 : m_t(t)
00161 {}
00162
00163
00164 public:
00165 operator signed char const& () const
00166 {
00167 return m_t;
00168 }
00169
00170
00171 private:
00172 signed char const& m_t;
00173 };
00174
00175 STLSOFT_TEMPLATE_SPECIALISATION
00176 class explicit_cast<signed short const&>
00177 {
00178 public:
00179 typedef signed short value_type;
00180 typedef explicit_cast<signed short> class_type;
00181
00182
00183 public:
00184 explicit_cast(signed short const& t)
00185 : m_t(t)
00186 {}
00187
00188
00189 public:
00190 operator signed short const& () const
00191 {
00192 return m_t;
00193 }
00194
00195
00196 private:
00197 signed short const& m_t;
00198 };
00199
00200 STLSOFT_TEMPLATE_SPECIALISATION
00201 class explicit_cast<unsigned short const&>
00202 {
00203 public:
00204 typedef unsigned short value_type;
00205 typedef explicit_cast<unsigned short> class_type;
00206
00207
00208 public:
00209 explicit_cast(unsigned short const& t)
00210 : m_t(t)
00211 {}
00212
00213
00214 public:
00215 operator unsigned short const& () const
00216 {
00217 return m_t;
00218 }
00219
00220
00221 private:
00222 unsigned short const& m_t;
00223 };
00224
00225 STLSOFT_TEMPLATE_SPECIALISATION
00226 class explicit_cast<signed int const&>
00227 {
00228 public:
00229 typedef signed int value_type;
00230 typedef explicit_cast<signed int> class_type;
00231
00232
00233 public:
00234 explicit_cast(signed int const& t)
00235 : m_t(t)
00236 {}
00237
00238
00239 public:
00240 operator signed int const& () const
00241 {
00242 return m_t;
00243 }
00244
00245
00246 private:
00247 signed int const& m_t;
00248 };
00249
00250 STLSOFT_TEMPLATE_SPECIALISATION
00251 class explicit_cast<unsigned int const&>
00252 {
00253 public:
00254 typedef unsigned int value_type;
00255 typedef explicit_cast<unsigned int> class_type;
00256
00257
00258 public:
00259 explicit_cast(unsigned int const& t)
00260 : m_t(t)
00261 {}
00262
00263
00264 public:
00265 operator unsigned int const& () const
00266 {
00267 return m_t;
00268 }
00269
00270
00271 private:
00272 unsigned int const& m_t;
00273 };
00274
00275 STLSOFT_TEMPLATE_SPECIALISATION
00276 class explicit_cast<signed long const&>
00277 {
00278 public:
00279 typedef signed long value_type;
00280 typedef explicit_cast<signed long> class_type;
00281
00282
00283 public:
00284 explicit_cast(signed long const& t)
00285 : m_t(t)
00286 {}
00287
00288
00289 public:
00290 operator signed long const& () const
00291 {
00292 return m_t;
00293 }
00294
00295
00296 private:
00297 signed long const& m_t;
00298 };
00299
00300 STLSOFT_TEMPLATE_SPECIALISATION
00301 class explicit_cast<unsigned long const&>
00302 {
00303 public:
00304 typedef unsigned long value_type;
00305 typedef explicit_cast<unsigned long> class_type;
00306
00307
00308 public:
00309 explicit_cast(unsigned long const& t)
00310 : m_t(t)
00311 {}
00312
00313
00314 public:
00315 operator unsigned long const& () const
00316 {
00317 return m_t;
00318 }
00319
00320
00321 private:
00322 unsigned long const& m_t;
00323 };
00324
00325 #ifdef STLSOFT_CF_64BIT_INT_IS_long_long
00326
00327 STLSOFT_TEMPLATE_SPECIALISATION
00328 class explicit_cast<signed long long const&>
00329 {
00330 public:
00331 typedef signed long long value_type;
00332 typedef explicit_cast<signed long long> class_type;
00333
00334
00335 public:
00336 explicit_cast(signed long long const& t)
00337 : m_t(t)
00338 {}
00339
00340
00341 public:
00342 operator signed long long const& () const
00343 {
00344 return m_t;
00345 }
00346
00347
00348 private:
00349 signed long long const& m_t;
00350 };
00351
00352 STLSOFT_TEMPLATE_SPECIALISATION
00353 class explicit_cast<unsigned long long const&>
00354 {
00355 public:
00356 typedef unsigned long long value_type;
00357 typedef explicit_cast<unsigned long long> class_type;
00358
00359
00360 public:
00361 explicit_cast(unsigned long long const& t)
00362 : m_t(t)
00363 {}
00364
00365
00366 public:
00367 operator unsigned long long const& () const
00368 {
00369 return m_t;
00370 }
00371
00372
00373 private:
00374 unsigned long long const& m_t;
00375 };
00376
00377 #elif defined(STLSOFT_CF_64BIT_INT_IS___int64)
00378
00379 STLSOFT_TEMPLATE_SPECIALISATION
00380 class explicit_cast<signed __int64 const&>
00381 {
00382 public:
00383 typedef signed __int64 value_type;
00384 typedef explicit_cast<signed __int64> class_type;
00385
00386
00387 public:
00388 explicit_cast(signed __int64 const& t)
00389 : m_t(t)
00390 {}
00391
00392
00393 public:
00394 operator signed __int64 const& () const
00395 {
00396 return m_t;
00397 }
00398
00399
00400 private:
00401 signed __int64 const& m_t;
00402 };
00403
00404 STLSOFT_TEMPLATE_SPECIALISATION
00405 class explicit_cast<unsigned __int64 const&>
00406 {
00407 public:
00408 typedef unsigned __int64 value_type;
00409 typedef explicit_cast<unsigned __int64> class_type;
00410
00411
00412 public:
00413 explicit_cast(unsigned __int64 const& t)
00414 : m_t(t)
00415 {}
00416
00417
00418 public:
00419 operator unsigned __int64 const& () const
00420 {
00421 return m_t;
00422 }
00423
00424
00425 private:
00426 unsigned __int64 const& m_t;
00427 };
00428
00429 #else
00430
00431 # error 64-bit discrimination not handled correctly
00432
00433 #endif
00434
00435 STLSOFT_TEMPLATE_SPECIALISATION
00436 class explicit_cast<float const&>
00437 {
00438 public:
00439 typedef float value_type;
00440 typedef explicit_cast<float> class_type;
00441
00442
00443 public:
00444 explicit_cast(float const& t)
00445 : m_t(t)
00446 {}
00447
00448
00449 public:
00450 operator float const& () const
00451 {
00452 return m_t;
00453 }
00454
00455
00456 private:
00457 float const& m_t;
00458 };
00459
00460 STLSOFT_TEMPLATE_SPECIALISATION
00461 class explicit_cast<double const&>
00462 {
00463 public:
00464 typedef double value_type;
00465 typedef explicit_cast<double> class_type;
00466
00467
00468 public:
00469 explicit_cast(double const& t)
00470 : m_t(t)
00471 {}
00472
00473
00474 public:
00475 operator double const& () const
00476 {
00477 return m_t;
00478 }
00479
00480
00481 private:
00482 double const& m_t;
00483 };
00484
00485 STLSOFT_TEMPLATE_SPECIALISATION
00486 class explicit_cast<long double const&>
00487 {
00488 public:
00489 typedef long double value_type;
00490 typedef explicit_cast<long double> class_type;
00491
00492
00493 public:
00494 explicit_cast(long double const& t)
00495 : m_t(t)
00496 {}
00497
00498
00499 public:
00500 operator long double const& () const
00501 {
00502 return m_t;
00503 }
00504
00505
00506 private:
00507 long double const& m_t;
00508 };
00509
00510 #ifdef STLSOFT_CF_NATIVE_BOOL_SUPPORT
00511
00512 STLSOFT_TEMPLATE_SPECIALISATION
00513 class explicit_cast<bool const&>
00514 {
00515 public:
00516 typedef bool value_type;
00517 typedef explicit_cast<bool> class_type;
00518
00519
00520 public:
00521 explicit_cast(bool const& t)
00522 : m_t(t)
00523 {}
00524
00525
00526 public:
00527 operator bool const& () const
00528 {
00529 return m_t;
00530 }
00531
00532
00533 private:
00534 bool const& m_t;
00535 };
00536
00537 #endif
00538
00539
00540
00541 #endif
00542
00543