STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Enumerations | Functions
safeint.h File Reference
#include <corecrt.h>
#include <crtdbg.h>
#include "safeint_internal.h"

Go to the source code of this file.

Classes

class  msl::utilities::SafeIntException
 
struct  msl::utilities::SafeIntErrorPolicy_SafeIntException
 
struct  msl::utilities::SafeIntErrorPolicy_InvalidParameter
 
class  msl::utilities::SafeInt< T, E >
 

Namespaces

 msl
 
 msl::utilities
 

Macros

#define _SAFEINT_DEFAULT_ERROR_POLICY   SafeIntErrorPolicy_SafeIntException
 
#define _SAFEINT_SHIFT_ASSERT(x)   _ASSERTE(x)
 
#define _SAFEINT_BINARY_ASSERT(x)   _ASSERTE(x)
 
#define _SAFEINT_EXCEPTION_ASSERT()
 
#define _SAFEINT_UNSIGNED_NEGATION_BEHAVIOR()
 
#define _SAFEINT_USE_ANSI_CONVERSIONS   0
 

Enumerations

enum  msl::utilities::SafeIntError { msl::utilities::SafeIntNoError = 0, msl::utilities::SafeIntArithmeticOverflow, msl::utilities::SafeIntDivideByZero }
 

Functions

template<typename T , typename U >
bool msl::utilities::SafeCast (const T From, U &To) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeEquals (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeNotEquals (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeGreaterThan (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeGreaterThanEquals (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeLessThan (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeLessThanEquals (const T t, const U u) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeModulus (const T &t, const U &u, T &result) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeMultiply (T t, U u, T &result) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeDivide (T t, U u, T &result) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeAdd (T t, U u, T &result) throw ()
 
template<typename T , typename U >
bool msl::utilities::SafeSubtract (T t, U u, T &result) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator< (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator< (SafeInt< U, E > lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator> (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator> (SafeInt< T, E > lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator>= (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator>= (SafeInt< T, E > lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator<= (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator<= (SafeInt< T, E > lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename E >
bool msl::utilities::operator== (bool lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator== (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator== (SafeInt< T, E > lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator!= (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename E >
bool msl::utilities::operator!= (bool lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
bool msl::utilities::operator!= (SafeInt< T, E > lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator% (U lhs, SafeInt< T, E > rhs)
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator* (U lhs, SafeInt< T, E > rhs)
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator/ (U lhs, SafeInt< T, E > rhs)
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator+ (U lhs, SafeInt< T, E > rhs)
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator- (U lhs, SafeInt< T, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator+= (T &lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator-= (T &lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator*= (T &lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator/= (T &lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator%= (T &lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T & msl::utilities::operator&= (T &lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
T & msl::utilities::operator^= (T &lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
T & msl::utilities::operator|= (T &lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
T & msl::utilities::operator<<= (T &lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
T & msl::utilities::operator>>= (T &lhs, SafeInt< U, E > rhs) throw ()
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator+= (T *&lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator-= (T *&lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator*= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator/= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator%= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator&= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator^= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator|= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator<<= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
T *& msl::utilities::operator>>= (T *lhs, SafeInt< U, E > rhs)
 
template<typename T , typename U , typename E >
SafeInt< U, E > msl::utilities::operator<< (U lhs, SafeInt< T, E > bits) throw ()
 
template<typename T , typename U , typename E >
SafeInt< U, E > msl::utilities::operator>> (U lhs, SafeInt< T, E > bits) throw ()
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator& (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator^ (U lhs, SafeInt< T, E > rhs) throw ()
 
template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator| (U lhs, SafeInt< T, E > rhs) throw ()
 

Macro Definition Documentation

#define _SAFEINT_BINARY_ASSERT (   x)    _ASSERTE(x)
#define _SAFEINT_DEFAULT_ERROR_POLICY   SafeIntErrorPolicy_SafeIntException
#define _SAFEINT_EXCEPTION_ASSERT ( )
#define _SAFEINT_SHIFT_ASSERT (   x)    _ASSERTE(x)
#define _SAFEINT_UNSIGNED_NEGATION_BEHAVIOR ( )
#define _SAFEINT_USE_ANSI_CONVERSIONS   0