STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | 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
}
 

Public Member Functions

 _STATIC_ASSERT (NumericType< T >::isInt||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 
59  {
60 #pragma warning(suppress:4804)
61  isSigned = ( (T)(-1) < 0 ),
62  is64Bit = ( sizeof(T) == 8 ),
63  is32Bit = ( sizeof(T) == 4 ),
64  is16Bit = ( sizeof(T) == 2 ),
65  is8Bit = ( sizeof(T) == 1 ),
66  isLT32Bit = ( sizeof(T) < 4 ),
67  isLT64Bit = ( sizeof(T) < 8 ),
68  isInt8 = ( sizeof(T) == 1 && isSigned ),
69  isUint8 = ( sizeof(T) == 1 && !isSigned ),
70  isInt16 = ( sizeof(T) == 2 && isSigned ),
71  isUint16 = ( sizeof(T) == 2 && !isSigned ),
72  isInt32 = ( sizeof(T) == 4 && isSigned ),
73  isUint32 = ( sizeof(T) == 4 && !isSigned ),
74  isInt64 = ( sizeof(T) == 8 && isSigned ),
75  isUint64 = ( sizeof(T) == 8 && !isSigned ),
76  bitCount = ( sizeof(T)*8 ),
77 #pragma warning(suppress:4804)
78  isBool = NumericType<T>::isBool
79  };
Definition: safeint_internal.h:63
Definition: safeint_internal.h:70
Definition: safeint_internal.h:74
Definition: safeint_internal.h:67
Definition: safeint_internal.h:71
Definition: safeint_internal.h:68
Definition: safeint_internal.h:76
Definition: safeint_internal.h:78
Definition: safeint_internal.h:66
Definition: safeint_internal.h:72
Definition: safeint_internal.h:69
Definition: safeint_internal.h:64
Definition: safeint_internal.h:61
Definition: safeint_internal.h:73
Definition: safeint_internal.h:65
Definition: safeint_internal.h:62
Definition: safeint_internal.h:75

Member Function Documentation

template<typename T>
msl::utilities::details::IntTraits< T >::_STATIC_ASSERT ( NumericType< T >::isInt||NumericType< T >::isBool  )

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: