STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Static Public Attributes | List of all members
msl::utilities::details::IntTraits< T > Class Template Reference

#include <safeint_internal.h>

Public Types

enum  {
  isSigned = ( (T)(-1) < 0 ), is64Bit = ( sizeof(T) == 8 ), is32Bit = ( sizeof(T) == 4 ), is16Bit = ( sizeof(T) == 2 ),
  is8Bit = ( sizeof(T) == 1 ), isLT32Bit = ( sizeof(T) < 4 ), isLT64Bit = ( sizeof(T) < 8 ), isInt8 = ( sizeof(T) == 1 && isSigned ),
  isUint8 = ( sizeof(T) == 1 && !isSigned ), isInt16 = ( sizeof(T) == 2 && isSigned ), isUint16 = ( sizeof(T) == 2 && !isSigned ), isInt32 = ( sizeof(T) == 4 && isSigned ),
  isUint32 = ( sizeof(T) == 4 && !isSigned ), isInt64 = ( sizeof(T) == 8 && isSigned ), isUint64 = ( sizeof(T) == 8 && !isSigned ), bitCount = ( sizeof(T)*8 ),
  isBool = NumericType<T>::isBool
}
 

Static Public Attributes

static const T maxInt = isSigned ? ((T)~((T)1 << (T)(bitCount-1))) : ((T)(~(T)0))
 
static const T minInt = isSigned ? ((T)((T)1 << (T)(bitCount-1))) : ((T)0)
 

Member Enumeration Documentation

template<typename T>
anonymous enum
Enumerator
isSigned 
is64Bit 
is32Bit 
is16Bit 
is8Bit 
isLT32Bit 
isLT64Bit 
isInt8 
isUint8 
isInt16 
isUint16 
isInt32 
isUint32 
isInt64 
isUint64 
bitCount 
isBool 
62  {
63 #pragma warning(suppress:4804)
64  isSigned = ( (T)(-1) < 0 ),
65  is64Bit = ( sizeof(T) == 8 ),
66  is32Bit = ( sizeof(T) == 4 ),
67  is16Bit = ( sizeof(T) == 2 ),
68  is8Bit = ( sizeof(T) == 1 ),
69  isLT32Bit = ( sizeof(T) < 4 ),
70  isLT64Bit = ( sizeof(T) < 8 ),
71  isInt8 = ( sizeof(T) == 1 && isSigned ),
72  isUint8 = ( sizeof(T) == 1 && !isSigned ),
73  isInt16 = ( sizeof(T) == 2 && isSigned ),
74  isUint16 = ( sizeof(T) == 2 && !isSigned ),
75  isInt32 = ( sizeof(T) == 4 && isSigned ),
76  isUint32 = ( sizeof(T) == 4 && !isSigned ),
77  isInt64 = ( sizeof(T) == 8 && isSigned ),
78  isUint64 = ( sizeof(T) == 8 && !isSigned ),
79  bitCount = ( sizeof(T)*8 ),
80 #pragma warning(suppress:4804)
81  isBool = NumericType<T>::isBool
82  };
Definition: safeint_internal.h:70
Definition: safeint_internal.h:64
Definition: safeint_internal.h:77
Definition: safeint_internal.h:66
Definition: safeint_internal.h:76
Definition: safeint_internal.h:67
Definition: safeint_internal.h:75
Definition: safeint_internal.h:79
Definition: safeint_internal.h:74
Definition: safeint_internal.h:71
Definition: safeint_internal.h:72
Definition: safeint_internal.h:65
Definition: safeint_internal.h:68
Definition: safeint_internal.h:69
Definition: safeint_internal.h:81
Definition: safeint_internal.h:78
Definition: safeint_internal.h:73

Member Data Documentation

template<typename T>
const T msl::utilities::details::IntTraits< T >::maxInt = isSigned ? ((T)~((T)1 << (T)(bitCount-1))) : ((T)(~(T)0))
static
template<typename T>
const T msl::utilities::details::IntTraits< T >::minInt = isSigned ? ((T)((T)1 << (T)(bitCount-1))) : ((T)0)
static

The documentation for this class was generated from the following file: