home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / Rw / rwdispat.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  3.6 KB  |  140 lines

  1. #ifndef __RWDISPAT_H
  2. #define __RWDISPAT_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  4. // -*- C++ -*-
  5. /***************************************************************************
  6.  *
  7.  * rwdispatch.h - functions used for method selection in containers
  8.  *
  9.  ***************************************************************************
  10.  *
  11.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  12.  *
  13.  * This computer software is owned by Rogue Wave Software, Inc. and is
  14.  * protected by U.S. copyright laws and other laws and by international
  15.  * treaties.  This computer software is furnished by Rogue Wave Software,
  16.  * Inc. pursuant to a written license agreement and may be used, copied,
  17.  * transmitted, and stored only in accordance with the terms of such
  18.  * license and with the inclusion of the above copyright notice.  This
  19.  * computer software or any other copies thereof may not be provided or
  20.  * otherwise made available to any other person.
  21.  *
  22.  * U.S. Government Restricted Rights.  This computer software is provided
  23.  * with Restricted Rights.  Use, duplication, or disclosure by the
  24.  * Government is subject to restrictions as set forth in subparagraph (c)
  25.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  26.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  27.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  28.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  29.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  30.  *
  31.  **************************************************************************/
  32.  
  33. #ifndef __RWDISPATCH__
  34. #define __RWDISPATCH__
  35.  
  36. template <class _T>
  37. inline bool _RW_is_integral_type(_T)
  38. { return false; }
  39.  
  40. inline bool _RW_is_integral_type(int)
  41. { return true; }
  42.  
  43. inline bool _RW_is_integral_type(unsigned int)
  44. { return true; }
  45.  
  46. inline bool _RW_is_integral_type(short)
  47. { return true; }
  48.  
  49. inline bool _RW_is_integral_type(unsigned short)
  50. { return true; }
  51.  
  52. inline bool _RW_is_integral_type(long)
  53. { return true; }
  54.  
  55. inline bool _RW_is_integral_type(unsigned long)
  56. { return true; }
  57.  
  58. inline bool _RW_is_integral_type(char)
  59. { return true; }
  60.  
  61. inline bool _RW_is_integral_type(unsigned char)
  62. { return true; }
  63.  
  64. #ifndef _RWSTD_NO_BOOL
  65. inline bool _RW_is_integral_type(bool)
  66. { return true; }
  67. #endif
  68.  
  69. #ifndef _RWSTD_NO_OVERLOAD_WCHAR
  70. inline bool _RW_is_integral_type(wchar_t)
  71. { return true; }
  72. #endif
  73.  
  74. struct _RW_is_integer {};
  75. struct _RW_is_not_integer {};
  76.  
  77. template <class _T>
  78. struct _RWdispatch {
  79.   typedef _RW_is_not_integer _RWtype;
  80. };
  81.  
  82. _RWSTD_TEMPLATE
  83. struct _RWdispatch<int> {
  84.   typedef _RW_is_integer _RWtype;
  85. };
  86.  
  87. _RWSTD_TEMPLATE
  88.    struct _RWdispatch<unsigned int> {
  89.     typedef _RW_is_integer _RWtype;
  90. };
  91.  
  92. _RWSTD_TEMPLATE
  93.    struct _RWdispatch<long> {
  94.     typedef _RW_is_integer _RWtype;
  95. };
  96.  
  97. _RWSTD_TEMPLATE
  98.    struct _RWdispatch<unsigned long> {
  99.     typedef _RW_is_integer _RWtype;
  100. };
  101.  
  102. _RWSTD_TEMPLATE
  103.    struct _RWdispatch<short> {
  104.     typedef _RW_is_integer _RWtype;
  105. };
  106.  
  107. _RWSTD_TEMPLATE
  108.    struct _RWdispatch<unsigned short> {
  109.     typedef _RW_is_integer _RWtype;
  110. };
  111.  
  112. _RWSTD_TEMPLATE
  113.    struct _RWdispatch<char> {
  114.     typedef _RW_is_integer _RWtype;
  115. };
  116.  
  117. _RWSTD_TEMPLATE
  118.    struct _RWdispatch<unsigned char> {
  119.     typedef _RW_is_integer _RWtype;
  120. };
  121.  
  122. #ifndef _RWSTD_NO_BOOL
  123. _RWSTD_TEMPLATE
  124.    struct _RWdispatch<bool> {
  125.     typedef _RW_is_integer _RWtype;
  126. };
  127. #endif
  128.  
  129. #ifndef _RWSTD_NO_OVERLOAD_WCHAR
  130. _RWSTD_TEMPLATE
  131.    struct _RWdispatch<wchar_t> {
  132.     typedef _RW_is_integer _RWtype;
  133. };
  134. #endif
  135.  
  136. #endif //__RWDISPATCH__
  137.  
  138. #pragma option pop
  139. #endif /* __RWDISPAT_H */
  140.