STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
msl::utilities::SafeInt< T, E > Class Template Reference

#include <safeint.h>

Public Member Functions

 SafeInt () throw ()
 
 SafeInt (const T &i) throw ()
 
 SafeInt (bool b) throw ()
 
template<typename U >
 SafeInt (const SafeInt< U, E > &u)
 
template<typename U >
 SafeInt (const U &i)
 
template<typename U >
SafeInt< T, E > & operator= (const U &rhs)
 
SafeInt< T, E > & operator= (const T &rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator= (const SafeInt< U, E > &rhs)
 
SafeInt< T, E > & operator= (const SafeInt< T, E > &rhs) throw ()
 
 operator bool () const throw ()
 
 operator char () const
 
 operator signed char () const
 
 operator unsigned char () const
 
 operator __int16 () const
 
 operator unsigned __int16 () const
 
 operator __int32 () const
 
 operator unsigned __int32 () const
 
 operator long () const
 
 operator unsigned long () const
 
 operator __int64 () const
 
 operator unsigned __int64 () const
 
T * Ptr () throw ()
 
const T * Ptr () const throw ()
 
const T & Ref () const throw ()
 
bool operator! () const throw ()
 
const SafeInt< T, E > & operator+ () const throw ()
 
SafeInt< T, E > operator- () const
 
SafeInt< T, E > & operator++ ()
 
SafeInt< T, E > & operator-- ()
 
SafeInt< T, E > operator++ (int)
 
SafeInt< T, E > operator-- (int)
 
SafeInt< T, E > operator~ () const throw ()
 
template<typename U >
SafeInt< T, E > operator% (U rhs) const
 
SafeInt< T, E > operator% (SafeInt< T, E > rhs) const
 
template<typename U >
SafeInt< T, E > & operator%= (U rhs)
 
template<typename U >
SafeInt< T, E > & operator%= (SafeInt< U, E > rhs)
 
template<typename U >
SafeInt< T, E > operator* (U rhs) const
 
SafeInt< T, E > operator* (SafeInt< T, E > rhs) const
 
SafeInt< T, E > & operator*= (SafeInt< T, E > rhs)
 
template<typename U >
SafeInt< T, E > & operator*= (U rhs)
 
template<typename U >
SafeInt< T, E > & operator*= (SafeInt< U, E > rhs)
 
template<typename U >
SafeInt< T, E > operator/ (U rhs) const
 
SafeInt< T, E > operator/ (SafeInt< T, E > rhs) const
 
SafeInt< T, E > & operator/= (SafeInt< T, E > i)
 
template<typename U >
SafeInt< T, E > & operator/= (U i)
 
template<typename U >
SafeInt< T, E > & operator/= (SafeInt< U, E > i)
 
SafeInt< T, E > operator+ (SafeInt< T, E > rhs) const
 
template<typename U >
SafeInt< T, E > operator+ (U rhs) const
 
SafeInt< T, E > & operator+= (SafeInt< T, E > rhs)
 
template<typename U >
SafeInt< T, E > & operator+= (U rhs)
 
template<typename U >
SafeInt< T, E > & operator+= (SafeInt< U, E > rhs)
 
template<typename U >
SafeInt< T, E > operator- (U rhs) const
 
SafeInt< T, E > operator- (SafeInt< T, E > rhs) const
 
SafeInt< T, E > & operator-= (SafeInt< T, E > rhs)
 
template<typename U >
SafeInt< T, E > & operator-= (U rhs)
 
template<typename U >
SafeInt< T, E > & operator-= (SafeInt< U, E > rhs)
 
template<typename U >
bool operator< (U rhs) const throw ()
 
bool operator< (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
bool operator>= (U rhs) const throw ()
 
bool operator>= (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
bool operator> (U rhs) const throw ()
 
bool operator> (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
bool operator<= (U rhs) const throw ()
 
bool operator<= (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
bool operator== (U rhs) const throw ()
 
bool operator== (bool rhs) const throw ()
 
bool operator== (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
bool operator!= (U rhs) const throw ()
 
bool operator!= (bool b) const throw ()
 
bool operator!= (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
SafeInt< T, E > operator<< (U bits) const throw ()
 
template<typename U >
SafeInt< T, E > operator<< (SafeInt< U, E > bits) const throw ()
 
template<typename U >
SafeInt< T, E > & operator<<= (U bits) throw ()
 
template<typename U >
SafeInt< T, E > & operator<<= (SafeInt< U, E > bits) throw ()
 
template<typename U >
SafeInt< T, E > operator>> (U bits) const throw ()
 
template<typename U >
SafeInt< T, E > operator>> (SafeInt< U, E > bits) const throw ()
 
template<typename U >
SafeInt< T, E > & operator>>= (U bits) throw ()
 
template<typename U >
SafeInt< T, E > & operator>>= (SafeInt< U, E > bits) throw ()
 
SafeInt< T, E > operator& (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
SafeInt< T, E > operator& (U rhs) const throw ()
 
SafeInt< T, E > & operator&= (SafeInt< T, E > rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator&= (U rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator&= (SafeInt< U, E > rhs) throw ()
 
SafeInt< T, E > operator^ (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
SafeInt< T, E > operator^ (U rhs) const throw ()
 
SafeInt< T, E > & operator^= (SafeInt< T, E > rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator^= (U rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator^= (SafeInt< U, E > rhs) throw ()
 
SafeInt< T, E > operator| (SafeInt< T, E > rhs) const throw ()
 
template<typename U >
SafeInt< T, E > operator| (U rhs) const throw ()
 
SafeInt< T, E > & operator|= (SafeInt< T, E > rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator|= (U rhs) throw ()
 
template<typename U >
SafeInt< T, E > & operator|= (SafeInt< U, E > rhs) throw ()
 
SafeInt< T, E > Min (SafeInt< T, E > test, SafeInt< T, E > floor=SafeInt< T, E >(details::IntTraits< T >::minInt)) const throw ()
 
SafeInt< T, E > Max (SafeInt< T, E > test, SafeInt< T, E > upper=SafeInt< T, E >(details::IntTraits< T >::maxInt)) const throw ()
 
void Swap (SafeInt< T, E > &with) throw ()
 
template<int bits>
const SafeInt< T, E > & Align ()
 
const SafeInt< T, E > & Align2 ()
 
const SafeInt< T, E > & Align4 ()
 
const SafeInt< T, E > & Align8 ()
 
const SafeInt< T, E > & Align16 ()
 
const SafeInt< T, E > & Align32 ()
 
const SafeInt< T, E > & Align64 ()
 

Private Attributes

m_int
 

Constructor & Destructor Documentation

template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::SafeInt ( )
throw (
)
inline
408  {
409  static_assert( details::NumericType< T >::isInt , "SafeInt<T>: T needs to be an integer type" );
410  m_int = 0;
411  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::SafeInt ( const T &  i)
throw (
)
inline
417  {
418  static_assert( details::NumericType< T >::isInt , "SafeInt<T>: T needs to be an integer type" );
419  //always safe
420  m_int = i;
421  }
int i[4]
Definition: dvec.h:70
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::SafeInt ( bool  b)
throw (
)
inline
425  {
426  static_assert( details::NumericType< T >::isInt , "SafeInt<T>: T needs to be an integer type" );
427  m_int = b ? 1 : 0;
428  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
msl::utilities::SafeInt< T, E >::SafeInt ( const SafeInt< U, E > &  u)
inline
432  {
433  static_assert( details::NumericType< T >::isInt , "SafeInt<T>: T needs to be an integer type" );
434  *this = SafeInt< T, E >( (U)u );
435  }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
msl::utilities::SafeInt< T, E >::SafeInt ( const U &  i)
inline
439  {
440  static_assert( details::NumericType< T >::isInt , "SafeInt<T>: T needs to be an integer type" );
441  // SafeCast will throw exceptions if i won't fit in type T
442  details::SafeCastHelper< T, U, E >::Cast( i, m_int );
443  }
int i[4]
Definition: dvec.h:70
T m_int
Definition: safeint.h:1218

Member Function Documentation

template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<int bits>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align ( )
inline
1185  {
1186  // Zero is always aligned
1187  if( m_int == 0 )
1188  return *this;
1189 
1190  // We don't support aligning negative numbers at this time
1191  // Can't align unsigned numbers on bitCount (e.g., 8 bits = 256, unsigned char max = 255)
1192  // or signed numbers on bitCount-1 (e.g., 7 bits = 128, signed char max = 127).
1193  // Also makes no sense to try to align on negative or no bits.
1194 
1195  _SAFEINT_SHIFT_ASSERT( ( ( details::IntTraits<T>::isSigned && bits < (int)details::IntTraits< T >::bitCount - 1 )
1196  || ( !details::IntTraits<T>::isSigned && bits < (int)details::IntTraits< T >::bitCount ) ) &&
1197  bits >= 0 && ( !details::IntTraits<T>::isSigned || m_int > 0 ) );
1198 
1199  const T AlignValue = ( (T)1 << bits ) - 1;
1200 
1201  m_int = ( m_int + AlignValue ) & ~AlignValue;
1202 
1203  if( m_int <= 0 )
1204  E::SafeIntOnOverflow();
1205 
1206  return *this;
1207  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align16 ( )
inline
1213 { return Align< 4 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align2 ( )
inline
1210 { return Align< 1 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align32 ( )
inline
1214 { return Align< 5 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align4 ( )
inline
1211 { return Align< 2 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align64 ( )
inline
1215 { return Align< 6 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::Align8 ( )
inline
1212 { return Align< 3 >(); }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::Max ( SafeInt< T, E >  test,
SafeInt< T, E >  upper = SafeInt< T, E >( details::IntTraits< T >::maxInt ) 
) const
throw (
)
inline
1171  {
1172  T tmp = test > m_int ? test : m_int;
1173  return tmp > upper ? upper : tmp;
1174  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::Min ( SafeInt< T, E >  test,
SafeInt< T, E >  floor = SafeInt< T, E >( details::IntTraits< T >::minInt ) 
) const
throw (
)
inline
1165  {
1166  T tmp = test < m_int ? test : m_int;
1167  return tmp < floor ? floor : tmp;
1168  }
_CRTIMP double __cdecl floor(_In_ double _X)
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator __int16 ( ) const
inline
508  {
509  __int16 val;
510  details::SafeCastHelper< __int16, T, E >::Cast( m_int, val );
511  return val;
512  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator __int32 ( ) const
inline
522  {
523  __int32 val;
524  details::SafeCastHelper< __int32, T, E >::Cast( m_int, val );
525  return val;
526  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator __int64 ( ) const
inline
552  {
553  __int64 val;
554  details::SafeCastHelper< __int64, T, E >::Cast( m_int, val );
555  return val;
556  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator bool ( ) const
throw (
)
inline
482  {
483  return !!m_int;
484  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator char ( ) const
inline
487  {
488  char val;
489  details::SafeCastHelper< char, T, E >::Cast( m_int, val );
490  return val;
491  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator long ( ) const
inline
538  {
539  long val;
540  details::SafeCastHelper< long, T, E >::Cast( m_int, val );
541  return val;
542  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator signed char ( ) const
inline
494  {
495  signed char val;
496  details::SafeCastHelper< signed char, T, E >::Cast( m_int, val );
497  return val;
498  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator unsigned __int16 ( ) const
inline
515  {
516  unsigned __int16 val;
517  details::SafeCastHelper< unsigned __int16, T, E >::Cast( m_int, val );
518  return val;
519  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator unsigned __int32 ( ) const
inline
529  {
530  unsigned __int32 val;
531  details::SafeCastHelper< unsigned __int32, T, E >::Cast( m_int, val );
532  return val;
533  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator unsigned __int64 ( ) const
inline
559  {
560  unsigned __int64 val;
561  details::SafeCastHelper< unsigned __int64, T, E >::Cast( m_int, val );
562  return val;
563  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator unsigned char ( ) const
inline
501  {
502  unsigned char val;
503  details::SafeCastHelper< unsigned char, T, E >::Cast( m_int, val );
504  return val;
505  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
msl::utilities::SafeInt< T, E >::operator unsigned long ( ) const
inline
545  {
546  unsigned long val;
547  details::SafeCastHelper< unsigned long, T, E >::Cast( m_int, val );
548  return val;
549  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator! ( ) const
throw (
)
inline
583 { return (!m_int) ? true : false; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator!= ( rhs) const
throw (
)
inline
945  {
946  return !details::EqualityTest< T, U >::IsEquals( m_int, rhs );
947  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator!= ( bool  b) const
throw (
)
inline
950  {
951  return ( m_int == 0 ? false : true ) != b;
952  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator!= ( SafeInt< T, E >  rhs) const
throw (
)
inline
954 { return m_int != (T)rhs; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator% ( rhs) const
inline
699  {
700  T result;
701  details::ModulusHelper< T, U, E >::Modulus( m_int, rhs, result );
702  return SafeInt< T, E >( result );
703  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator% ( SafeInt< T, E >  rhs) const
inline
706  {
707  T result;
708  details::ModulusHelper< T, T, E >::Modulus( m_int, rhs, result );
709  return SafeInt< T, E >( result );
710  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator%= ( rhs)
inline
715  {
716  details::ModulusHelper< T, U, E >::Modulus( m_int, rhs, m_int );
717  return *this;
718  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator%= ( SafeInt< U, E >  rhs)
inline
722  {
723  details::ModulusHelper< T, U, E >::Modulus( m_int, (U)rhs, m_int );
724  return *this;
725  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator& ( SafeInt< T, E >  rhs) const
throw (
)
inline
1050  {
1051  return SafeInt< T, E >( m_int & (T)rhs );
1052  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator& ( rhs) const
throw (
)
inline
1056  {
1057  // we want to avoid setting bits by surprise
1058  // consider the case of lhs = int, value = 0xffffffff
1059  // rhs = char, value = 0xff
1060  //
1061  // programmer intent is to get only the lower 8 bits
1062  // normal behavior is to upcast both sides to an int
1063  // which then sign extends rhs, setting all the bits
1064 
1065  // If you land in the assert, this is because the bitwise operator
1066  // was causing unexpected behavior. Fix is to properly cast your inputs
1067  // so that it works like you meant, not unexpectedly
1068 
1069  return SafeInt< T, E >( details::BinaryAndHelper< T, U >::And( m_int, rhs ) );
1070  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator&= ( SafeInt< T, E >  rhs)
throw (
)
inline
1074  {
1075  m_int &= (T)rhs;
1076  return *this;
1077  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator&= ( rhs)
throw (
)
inline
1081  {
1082  m_int = details::BinaryAndHelper< T, U >::And( m_int, rhs );
1083  return *this;
1084  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator&= ( SafeInt< U, E >  rhs)
throw (
)
inline
1088  {
1089  m_int = details::BinaryAndHelper< T, U >::And( m_int, (U)rhs );
1090  return *this;
1091  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator* ( rhs) const
inline
730  {
731  T ret( 0 );
732  details::MultiplicationHelper< T, U, E >::Multiply( m_int, rhs, ret );
733  return SafeInt< T, E >( ret );
734  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator* ( SafeInt< T, E >  rhs) const
inline
737  {
738  T ret( 0 );
739  details::MultiplicationHelper< T, T, E >::Multiply( m_int, (T)rhs, ret );
740  return SafeInt< T, E >( ret );
741  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator*= ( SafeInt< T, E >  rhs)
inline
745  {
746  details::MultiplicationHelper< T, T, E >::Multiply( m_int, (T)rhs, m_int );
747  return *this;
748  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator*= ( rhs)
inline
752  {
753  details::MultiplicationHelper< T, U, E >::Multiply( m_int, rhs, m_int );
754  return *this;
755  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator*= ( SafeInt< U, E >  rhs)
inline
759  {
760  details::MultiplicationHelper< T, U, E >::Multiply( m_int, rhs.Ref(), m_int );
761  return *this;
762  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator+ ( ) const
throw (
)
inline
588 { return *this; };
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator+ ( SafeInt< T, E >  rhs) const
inline
803  {
804  T ret( 0 );
805  details::AdditionHelper< T, T, E >::Addition( m_int, (T)rhs, ret );
806  return SafeInt< T, E >( ret );
807  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator+ ( rhs) const
inline
811  {
812  T ret( 0 );
813  details::AdditionHelper< T, U, E >::Addition( m_int, rhs, ret );
814  return SafeInt< T, E >( ret );
815  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator++ ( )
inline
602  {
603  if( m_int != details::IntTraits< T >::maxInt )
604  {
605  ++m_int;
606  return *this;
607  }
608  E::SafeIntOnOverflow();
609  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator++ ( int  )
inline
627  {
628  if( m_int != details::IntTraits< T >::maxInt )
629  {
630  SafeInt< T, E > tmp( m_int );
631 
632  m_int++;
633  return tmp;
634  }
635  E::SafeIntOnOverflow();
636  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator+= ( SafeInt< T, E >  rhs)
inline
819  {
820  details::AdditionHelper< T, T, E >::Addition( m_int, (T)rhs, m_int );
821  return *this;
822  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator+= ( rhs)
inline
826  {
827  details::AdditionHelper< T, U, E >::Addition( m_int, rhs, m_int );
828  return *this;
829  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator+= ( SafeInt< U, E >  rhs)
inline
833  {
834  details::AdditionHelper< T, U, E >::Addition( m_int, (U)rhs, m_int );
835  return *this;
836  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator- ( void  ) const
inline
592  {
593  // Note - unsigned still performs the bitwise manipulation
594  // will warn at level 2 or higher if the value is 32-bit or larger
595  T tmp;
596  details::NegationHelper< T, E, details::IntTraits< T >::isSigned >::Negative( m_int, tmp );
597  return SafeInt< T, E >( tmp );
598  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator- ( rhs) const
inline
841  {
842  T ret( 0 );
843  details::SubtractionHelper< T, U, E >::Subtract( m_int, rhs, ret );
844  return SafeInt< T, E >( ret );
845  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator- ( SafeInt< T, E >  rhs) const
inline
848  {
849  T ret( 0 );
850  details::SubtractionHelper< T, T, E >::Subtract( m_int, (T)rhs, ret );
851  return SafeInt< T, E >( ret );
852  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator-- ( )
inline
613  {
614  if( m_int != details::IntTraits< T >::minInt )
615  {
616  --m_int;
617  return *this;
618  }
619  E::SafeIntOnOverflow();
620  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator-- ( int  )
inline
640  {
641  if( m_int != details::IntTraits< T >::minInt )
642  {
643  SafeInt< T, E > tmp( m_int );
644  m_int--;
645  return tmp;
646  }
647  E::SafeIntOnOverflow();
648  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator-= ( SafeInt< T, E >  rhs)
inline
856  {
857  details::SubtractionHelper< T, T, E >::Subtract( m_int, (T)rhs, m_int );
858  return *this;
859  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator-= ( rhs)
inline
863  {
864  details::SubtractionHelper< T, U, E >::Subtract( m_int, rhs, m_int );
865  return *this;
866  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator-= ( SafeInt< U, E >  rhs)
inline
870  {
871  details::SubtractionHelper< T, U, E >::Subtract( m_int, (U)rhs, m_int );
872  return *this;
873  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator/ ( rhs) const
inline
767  {
768  T ret( 0 );
769  details::DivisionHelper< T, U, E >::Divide( m_int, rhs, ret );
770  return SafeInt< T, E >( ret );
771  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator/ ( SafeInt< T, E >  rhs) const
inline
774  {
775  T ret( 0 );
776  details::DivisionHelper< T, T, E >::Divide( m_int, (T)rhs, ret );
777  return SafeInt< T, E >( ret );
778  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator/= ( SafeInt< T, E >  i)
inline
782  {
783  details::DivisionHelper< T, T, E >::Divide( m_int, (T)i, m_int );
784  return *this;
785  }
int i[4]
Definition: dvec.h:70
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator/= ( i)
inline
788  {
789  details::DivisionHelper< T, U, E >::Divide( m_int, i, m_int );
790  return *this;
791  }
int i[4]
Definition: dvec.h:70
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator/= ( SafeInt< U, E >  i)
inline
794  {
795  details::DivisionHelper< T, U, E >::Divide( m_int, (U)i, m_int );
796  return *this;
797  }
int i[4]
Definition: dvec.h:70
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator< ( rhs) const
throw (
)
inline
882  {
883  return details::GreaterThanTest< U, T >::GreaterThan( rhs, m_int );
884  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator< ( SafeInt< T, E >  rhs) const
throw (
)
inline
887  {
888  return m_int < (T)rhs;
889  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator<< ( SafeInt< U, E >  bits) const
throw (
)
inline
975  {
976  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || (U)bits >= 0 );
977  _SAFEINT_SHIFT_ASSERT( (U)bits < (int)details::IntTraits< T >::bitCount );
978 
979  return SafeInt< T, E >( (T)( m_int << (U)bits ) );
980  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator<< ( bits) const
throw (
)
inline
966  {
967  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || bits >= 0 );
968  _SAFEINT_SHIFT_ASSERT( bits < (int)details::IntTraits< T >::bitCount );
969 
970  return SafeInt< T, E >( (T)( m_int << bits ) );
971  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator<<= ( bits)
throw (
)
inline
986  {
987  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || bits >= 0 );
988  _SAFEINT_SHIFT_ASSERT( bits < (int)details::IntTraits< T >::bitCount );
989 
990  m_int <<= bits;
991  return *this;
992  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator<<= ( SafeInt< U, E >  bits)
throw (
)
inline
996  {
997  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || (U)bits >= 0 );
998  _SAFEINT_SHIFT_ASSERT( (U)bits < (int)details::IntTraits< T >::bitCount );
999 
1000  m_int <<= (U)bits;
1001  return *this;
1002  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator<= ( rhs) const
throw (
)
inline
918  {
919  return !details::GreaterThanTest< T, U >::GreaterThan( m_int, rhs );
920  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator<= ( SafeInt< T, E >  rhs) const
throw (
)
inline
923  {
924  return m_int <= (T)rhs;
925  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator= ( const U &  rhs)
inline
451  {
452  // use constructor to test size
453  // constructor is optimized to do minimal checking based
454  // on whether T can contain U
455  // note - do not change this
456  *this = SafeInt< T, E >( rhs );
457  return *this;
458  }
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator= ( const T &  rhs)
throw (
)
inline
461  {
462  m_int = rhs;
463  return *this;
464  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator= ( const SafeInt< U, E > &  rhs)
inline
468  {
469  details::SafeCastHelper< T, U, E >::Cast( rhs.Ref(), m_int );
470  return *this;
471  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator= ( const SafeInt< T, E > &  rhs)
throw (
)
inline
474  {
475  m_int = rhs.m_int;
476  return *this;
477  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator== ( rhs) const
throw (
)
inline
930  {
931  return details::EqualityTest< T, U >::IsEquals( m_int, rhs );
932  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator== ( bool  rhs) const
throw (
)
inline
936  {
937  return ( m_int == 0 ? false : true ) == rhs;
938  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator== ( SafeInt< T, E >  rhs) const
throw (
)
inline
940 { return m_int == (T)rhs; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator> ( rhs) const
throw (
)
inline
906  {
907  return details::GreaterThanTest< T, U >::GreaterThan( m_int, rhs );
908  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator> ( SafeInt< T, E >  rhs) const
throw (
)
inline
911  {
912  return m_int > (T)rhs;
913  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
bool msl::utilities::SafeInt< T, E >::operator>= ( rhs) const
throw (
)
inline
894  {
895  return !details::GreaterThanTest< U, T >::GreaterThan( rhs, m_int );
896  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
bool msl::utilities::SafeInt< T, E >::operator>= ( SafeInt< T, E >  rhs) const
throw (
)
inline
899  {
900  return m_int >= (T)rhs;
901  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator>> ( bits) const
throw (
)
inline
1007  {
1008  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || bits >= 0 );
1009  _SAFEINT_SHIFT_ASSERT( bits < (int)details::IntTraits< T >::bitCount );
1010 
1011  return SafeInt< T, E >( (T)( m_int >> bits ) );
1012  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator>> ( SafeInt< U, E >  bits) const
throw (
)
inline
1016  {
1017  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || (U)bits >= 0 );
1018  _SAFEINT_SHIFT_ASSERT( bits < (int)details::IntTraits< T >::bitCount );
1019 
1020  return SafeInt< T, E >( (T)(m_int >> (U)bits) );
1021  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator>>= ( bits)
throw (
)
inline
1026  {
1027  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || bits >= 0 );
1028  _SAFEINT_SHIFT_ASSERT( bits < (int)details::IntTraits< T >::bitCount );
1029 
1030  m_int >>= bits;
1031  return *this;
1032  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator>>= ( SafeInt< U, E >  bits)
throw (
)
inline
1036  {
1037  _SAFEINT_SHIFT_ASSERT( !details::IntTraits< U >::isSigned || (U)bits >= 0 );
1038  _SAFEINT_SHIFT_ASSERT( (U)bits < (int)details::IntTraits< T >::bitCount );
1039 
1040  m_int >>= (U)bits;
1041  return *this;
1042  }
T m_int
Definition: safeint.h:1218
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:229
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator^ ( SafeInt< T, E >  rhs) const
throw (
)
inline
1095  {
1096  return SafeInt< T, E >( (T)( m_int ^ (T)rhs ) );
1097  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator^ ( rhs) const
throw (
)
inline
1101  {
1102  // If you land in the assert, this is because the bitwise operator
1103  // was causing unexpected behavior. Fix is to properly cast your inputs
1104  // so that it works like you meant, not unexpectedly
1105 
1106  return SafeInt< T, E >( details::BinaryXorHelper< T, U >::Xor( m_int, rhs ) );
1107  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator^= ( SafeInt< T, E >  rhs)
throw (
)
inline
1111  {
1112  m_int ^= (T)rhs;
1113  return *this;
1114  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator^= ( rhs)
throw (
)
inline
1118  {
1119  m_int = details::BinaryXorHelper< T, U >::Xor( m_int, rhs );
1120  return *this;
1121  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator^= ( SafeInt< U, E >  rhs)
throw (
)
inline
1125  {
1126  m_int = details::BinaryXorHelper< T, U >::Xor( m_int, (U)rhs );
1127  return *this;
1128  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator| ( SafeInt< T, E >  rhs) const
throw (
)
inline
1132  {
1133  return SafeInt< T, E >( (T)( m_int | (T)rhs ) );
1134  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator| ( rhs) const
throw (
)
inline
1138  {
1139  return SafeInt< T, E >( details::BinaryOrHelper< T, U >::Or( m_int, rhs ) );
1140  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator|= ( SafeInt< T, E >  rhs)
throw (
)
inline
1144  {
1145  m_int |= (T)rhs;
1146  return *this;
1147  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator|= ( rhs)
throw (
)
inline
1151  {
1152  m_int = details::BinaryOrHelper< T, U >::Or( m_int, rhs );
1153  return *this;
1154  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
template<typename U >
SafeInt< T, E >& msl::utilities::SafeInt< T, E >::operator|= ( SafeInt< U, E >  rhs)
throw (
)
inline
1158  {
1159  m_int = details::BinaryOrHelper< T, U >::Or( m_int, (U)rhs );
1160  return *this;
1161  }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
SafeInt< T, E > msl::utilities::SafeInt< T, E >::operator~ ( ) const
throw (
)
inline
653 { return SafeInt< T, E >( (T)~m_int ); }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
T* msl::utilities::SafeInt< T, E >::Ptr ( )
throw (
)
inline
578 { return &m_int; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const T* msl::utilities::SafeInt< T, E >::Ptr ( ) const
throw (
)
inline
579 { return &m_int; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
const T& msl::utilities::SafeInt< T, E >::Ref ( ) const
throw (
)
inline
580 { return m_int; }
T m_int
Definition: safeint.h:1218
template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
void msl::utilities::SafeInt< T, E >::Swap ( SafeInt< T, E > &  with)
throw (
)
inline
1177  {
1178  T temp( m_int );
1179  m_int = with.m_int;
1180  with.m_int = temp;
1181  }
T m_int
Definition: safeint.h:1218

Member Data Documentation

template<typename T, typename E = _SAFEINT_DEFAULT_ERROR_POLICY>
T msl::utilities::SafeInt< T, E >::m_int
private

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