ReactOS 0.4.16-dev-927-g467dec4
msl::utilities Namespace Reference

Namespaces

namespace  details
 

Classes

class  SafeInt
 
struct  SafeIntErrorPolicy_InvalidParameter
 
struct  SafeIntErrorPolicy_SafeIntException
 
class  SafeIntException
 

Enumerations

enum  SafeIntError { SafeIntNoError = 0 , SafeIntArithmeticOverflow , SafeIntDivideByZero }
 

Functions

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

Enumeration Type Documentation

◆ SafeIntError

Enumerator
SafeIntNoError 
SafeIntArithmeticOverflow 
SafeIntDivideByZero 

Definition at line 270 of file safeint.h.

271{
272 SafeIntNoError = 0,
275};
@ SafeIntDivideByZero
Definition: safeint.h:274
@ SafeIntArithmeticOverflow
Definition: safeint.h:273

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename E >
bool msl::utilities::operator!= ( bool  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1310 of file safeint.h.

1311{
1312 return ( (T)rhs == 0 ? false : true ) != lhs;
1313}
#define T
Definition: mbstring.h:31

◆ operator!=() [2/3]

template<typename T , typename U , typename E >
bool msl::utilities::operator!= ( SafeInt< T, E lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1316 of file safeint.h.

◆ operator!=() [3/3]

template<typename T , typename U , typename E >
bool msl::utilities::operator!= ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1304 of file safeint.h.

1305{
1306 return !details::EqualityTest< T, U >::IsEquals( rhs, lhs );
1307}

◆ operator%()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator% ( U  lhs,
SafeInt< T, E rhs 
)

Definition at line 1323 of file safeint.h.

1324{
1325 // Value of return depends on sign of lhs
1326 // This one may not be safe - bounds check in constructor
1327 // if lhs is negative and rhs is unsigned, this will throw an exception.
1328
1329 // Fast-track the simple case
1330 // same size and same sign
1331#pragma warning(suppress:4127 6326)
1333 {
1334 if( rhs != 0 )
1335 {
1336 if( details::IntTraits< T >::isSigned && (T)rhs == -1 )
1337 return 0;
1338
1339 return SafeInt< T, E >( (T)( lhs % (T)rhs ) );
1340 }
1341
1342 E::SafeIntOnDivZero();
1343 }
1344
1345 return SafeInt< T, E >( ( SafeInt< U, E >( lhs ) % (T)rhs ) );
1346}
#define U(x)
Definition: wordpad.c:45

◆ operator%=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator%= ( T lhs,
SafeInt< U, E rhs 
)

Definition at line 1484 of file safeint.h.

1485{
1486 T ret( 0 );
1488 lhs = ret;
1489 return lhs;
1490}
int ret

◆ operator%=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator%= ( T lhs,
SafeInt< U, E  
)

Definition at line 1569 of file safeint.h.

1570{
1571 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1572 return lhs;
1573}

◆ operator&()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator& ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1639 of file safeint.h.

◆ operator&=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator&= ( T lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1493 of file safeint.h.

1494{
1495 lhs = details::BinaryAndHelper< T, U >::And( lhs, (U)rhs );
1496 return lhs;
1497}

◆ operator&=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator&= ( T lhs,
SafeInt< U, E  
)

Definition at line 1576 of file safeint.h.

1577{
1578 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1579 return lhs;
1580}

◆ operator*()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator* ( U  lhs,
SafeInt< T, E rhs 
)

Definition at line 1350 of file safeint.h.

◆ operator*=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator*= ( T lhs,
SafeInt< U, E rhs 
)

Definition at line 1466 of file safeint.h.

1467{
1468 T ret( 0 );
1470 lhs = ret;
1471 return lhs;
1472}

◆ operator*=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator*= ( T lhs,
SafeInt< U, E  
)

Definition at line 1555 of file safeint.h.

1556{
1557 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1558 return lhs;
1559}

◆ operator+()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator+ ( U  lhs,
SafeInt< T, E rhs 
)

Definition at line 1427 of file safeint.h.

◆ operator+=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator+= ( T lhs,
SafeInt< U, E rhs 
)

Definition at line 1448 of file safeint.h.

1449{
1450 T ret( 0 );
1452 lhs = ret;
1453 return lhs;
1454}

◆ operator+=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator+= ( T *&  lhs,
SafeInt< U, E rhs 
)

Definition at line 1532 of file safeint.h.

1533{
1534 // Cast the pointer to a number so we can do arithmetic
1535 SafeInt< uintptr_t, E > ptr_val = reinterpret_cast< uintptr_t >( lhs );
1536 // Check first that rhs is valid for the type of ptrdiff_t
1537 // and that multiplying by sizeof( T ) doesn't overflow a ptrdiff_t
1538 // Next, we need to add 2 SafeInts of different types, so unbox the ptr_diff
1539 // Finally, cast the number back to a pointer of the correct type
1540 lhs = reinterpret_cast< T* >( (uintptr_t)( ptr_val + (ptrdiff_t)( SafeInt< ptrdiff_t, E >( rhs ) * sizeof( T ) ) ) );
1541 return lhs;
1542}
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
unsigned int uintptr_t
Definition: intrin.h:47

◆ operator-()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator- ( U  lhs,
SafeInt< T, E rhs 
)

Definition at line 1436 of file safeint.h.

◆ operator-=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator-= ( T lhs,
SafeInt< U, E rhs 
)

Definition at line 1457 of file safeint.h.

1458{
1459 T ret( 0 );
1461 lhs = ret;
1462 return lhs;
1463}

◆ operator-=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator-= ( T *&  lhs,
SafeInt< U, E rhs 
)

Definition at line 1545 of file safeint.h.

1546{
1547 // Cast the pointer to a number so we can do arithmetic
1548 SafeInt< size_t, E > ptr_val = reinterpret_cast< uintptr_t >( lhs );
1549 // See above for comments
1550 lhs = reinterpret_cast< T* >( (uintptr_t)( ptr_val - (ptrdiff_t)( SafeInt< ptrdiff_t, E >( rhs ) * sizeof( T ) ) ) );
1551 return lhs;
1552}

◆ operator/()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator/ ( U  lhs,
SafeInt< T, E rhs 
)

Definition at line 1358 of file safeint.h.

1359{
1360#pragma warning(push)
1361#pragma warning(disable: 4127 4146 4307 4310 6326)
1362 // Corner case - has to be handled separately
1363 if( details::DivisionMethod< U, T >::method == details::DivisionState_UnsignedSigned )
1364 {
1365 if( (T)rhs > 0 )
1366 return SafeInt< T, E >( lhs/(T)rhs );
1367
1368 // Now rhs is either negative, or zero
1369 if( (T)rhs != 0 )
1370 {
1371 if( sizeof( U ) >= 4 && sizeof( T ) <= sizeof( U ) )
1372 {
1373 // Problem case - normal casting behavior changes meaning
1374 // flip rhs to positive
1375 // any operator casts now do the right thing
1376 U tmp;
1377 if( sizeof(T) == 4 )
1378 tmp = lhs/(U)(unsigned __int32)( -(T)rhs );
1379 else
1380 tmp = lhs/(U)( -(T)rhs );
1381
1383 return SafeInt< T, E >( -( (T)tmp ) );
1384
1385 // Corner case
1386 // Note - this warning happens because we're not using partial
1387 // template specialization in this case. For any real cases where
1388 // this block isn't optimized out, the warning won't be present.
1389 if( tmp == (U)details::IntTraits< T >::maxInt + 1 )
1391
1392 E::SafeIntOnOverflow();
1393 }
1394
1395 return SafeInt< T, E >(lhs/(T)rhs);
1396 }
1397
1398 E::SafeIntOnDivZero();
1399 } // method == DivisionState_UnsignedSigned
1400
1401 if( details::SafeIntCompare< T, U >::isBothSigned )
1402 {
1403 if( lhs == details::IntTraits< U >::minInt && (T)rhs == -1 )
1404 {
1405 // corner case of a corner case - lhs = min int, rhs = -1,
1406 // but rhs is the return type, so in essence, we can return -lhs
1407 // if rhs is a larger type than lhs
1408 if( sizeof( U ) < sizeof( T ) )
1409 {
1410 return SafeInt< T, E >( (T)( -(T)details::IntTraits< U >::minInt ) );
1411 }
1412
1413 // If rhs is smaller or the same size int, then -minInt won't work
1414 E::SafeIntOnOverflow();
1415 }
1416 }
1417
1418 // Otherwise normal logic works with addition of bounds check when casting from U->T
1419 U ret;
1420 details::DivisionHelper< U, T, E >::Divide( lhs, (T)rhs, ret );
1421 return SafeInt< T, E >( ret );
1422#pragma warning(pop)
1423}
#define __int32
Definition: basetyps.h:19

◆ operator/=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator/= ( T lhs,
SafeInt< U, E rhs 
)

Definition at line 1475 of file safeint.h.

1476{
1477 T ret( 0 );
1479 lhs = ret;
1480 return lhs;
1481}

◆ operator/=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator/= ( T lhs,
SafeInt< U, E  
)

Definition at line 1562 of file safeint.h.

1563{
1564 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1565 return lhs;
1566}

◆ operator<() [1/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator< ( SafeInt< U, E lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1238 of file safeint.h.

◆ operator<() [2/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator< ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1232 of file safeint.h.

1233{
1235}

◆ operator<<()

template<typename T , typename U , typename E >
SafeInt< U, E > msl::utilities::operator<< ( U  lhs,
SafeInt< T, E bits 
)
throw (
)

Definition at line 1604 of file safeint.h.

1616{
1619
1620 return SafeInt< U, E >( (U)( lhs << (T)bits ) );
1621}
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define _SAFEINT_SHIFT_ASSERT(x)
Definition: safeint.h:238

◆ operator<<=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator<<= ( T lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1514 of file safeint.h.

1515{
1516 lhs = (T)( SafeInt< T, E >( lhs ) << (U)rhs );
1517 return lhs;
1518}

◆ operator<<=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator<<= ( T lhs,
SafeInt< U, E  
)

Definition at line 1597 of file safeint.h.

1598{
1599 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1600 return lhs;
1601}

◆ operator<=() [1/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator<= ( SafeInt< T, E lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1277 of file safeint.h.

1278{
1280}

◆ operator<=() [2/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator<= ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1271 of file safeint.h.

1272{
1274}

◆ operator==() [1/3]

template<typename T , typename E >
bool msl::utilities::operator== ( bool  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1285 of file safeint.h.

1286{
1287 return lhs == ( (T)rhs == 0 ? false : true );
1288}

◆ operator==() [2/3]

template<typename T , typename U , typename E >
bool msl::utilities::operator== ( SafeInt< T, E lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1297 of file safeint.h.

1298{
1299 return details::EqualityTest< T, U >::IsEquals( (T)lhs, (U)rhs );
1300}

◆ operator==() [3/3]

template<typename T , typename U , typename E >
bool msl::utilities::operator== ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1291 of file safeint.h.

1292{
1294}

◆ operator>() [1/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator> ( SafeInt< T, E lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1251 of file safeint.h.

1252{
1254}

◆ operator>() [2/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator> ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1245 of file safeint.h.

1246{
1248}

◆ operator>=() [1/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator>= ( SafeInt< T, E lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1264 of file safeint.h.

1265{
1267}

◆ operator>=() [2/2]

template<typename T , typename U , typename E >
bool msl::utilities::operator>= ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1258 of file safeint.h.

1259{
1261}

◆ operator>>()

template<typename T , typename U , typename E >
SafeInt< U, E > msl::utilities::operator>> ( U  lhs,
SafeInt< T, E bits 
)
throw (
)

Definition at line 1625 of file safeint.h.

1626{
1629
1630 return SafeInt< U, E >( (U)( lhs >> (T)bits ) );
1631}

◆ operator>>=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator>>= ( T lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1521 of file safeint.h.

1522{
1523 lhs = (T)( SafeInt< T, E >( lhs ) >> (U)rhs );
1524 return lhs;
1525}

◆ operator>>=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator>>= ( T lhs,
SafeInt< U, E  
)

Definition at line 1604 of file safeint.h.

1605{
1606 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1607 return lhs;
1608}

◆ operator^()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator^ ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1646 of file safeint.h.

◆ operator^=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator^= ( T lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1500 of file safeint.h.

1501{
1502 lhs = details::BinaryXorHelper< T, U >::Xor( lhs, (U)rhs );
1503 return lhs;
1504}

◆ operator^=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator^= ( T lhs,
SafeInt< U, E  
)

Definition at line 1583 of file safeint.h.

1584{
1585 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1586 return lhs;
1587}

◆ operator|()

template<typename T , typename U , typename E >
SafeInt< T, E > msl::utilities::operator| ( U  lhs,
SafeInt< T, E rhs 
)
throw (
)

Definition at line 1653 of file safeint.h.

◆ operator|=() [1/2]

template<typename T , typename U , typename E >
T & msl::utilities::operator|= ( T lhs,
SafeInt< U, E rhs 
)
throw (
)

Definition at line 1507 of file safeint.h.

1508{
1509 lhs = details::BinaryOrHelper< T, U >::Or( lhs, (U)rhs );
1510 return lhs;
1511}

◆ operator|=() [2/2]

template<typename T , typename U , typename E >
T *& msl::utilities::operator|= ( T lhs,
SafeInt< U, E  
)

Definition at line 1590 of file safeint.h.

1591{
1592 static_assert( details::DependentFalse< T >::value, "SafeInt<T>: This operator explicitly not supported" );
1593 return lhs;
1594}

◆ SafeAdd()

template<typename T , typename U >
bool msl::utilities::SafeAdd ( T  t,
U  u,
T result 
)
throw (
)
inline

Definition at line 398 of file safeint.h.

399{
400 return ( details::AdditionHelper< T, U,
401 details::SafeIntErrorPolicy_NoThrow >::Addition( t, u, result ) == SafeIntNoError );
402}
GLdouble GLdouble t
Definition: gl.h:2047
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

◆ SafeCast()

template<typename T , typename U >
bool msl::utilities::SafeCast ( const T  From,
U To 
)
throw (
)
inline

Definition at line 335 of file safeint.h.

336{
337 return (details::SafeCastHelper< U, T,
338 details::SafeIntErrorPolicy_NoThrow >::Cast( From, To ) == SafeIntNoError);
339}

◆ SafeDivide()

template<typename T , typename U >
bool msl::utilities::SafeDivide ( T  t,
U  u,
T result 
)
throw (
)
inline

Definition at line 391 of file safeint.h.

392{
393 return ( details::DivisionHelper< T, U,
394 details::SafeIntErrorPolicy_NoThrow >::Divide( t, u, result ) == SafeIntNoError );
395}

◆ SafeEquals()

template<typename T , typename U >
bool msl::utilities::SafeEquals ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 342 of file safeint.h.

343{
345}

◆ SafeGreaterThan()

template<typename T , typename U >
bool msl::utilities::SafeGreaterThan ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 354 of file safeint.h.

◆ SafeGreaterThanEquals()

template<typename T , typename U >
bool msl::utilities::SafeGreaterThanEquals ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 360 of file safeint.h.

◆ SafeLessThan()

template<typename T , typename U >
bool msl::utilities::SafeLessThan ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 366 of file safeint.h.

◆ SafeLessThanEquals()

template<typename T , typename U >
bool msl::utilities::SafeLessThanEquals ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 372 of file safeint.h.

◆ SafeModulus()

template<typename T , typename U >
bool msl::utilities::SafeModulus ( const T t,
const U u,
T result 
)
throw (
)
inline

Definition at line 378 of file safeint.h.

◆ SafeMultiply()

template<typename T , typename U >
bool msl::utilities::SafeMultiply ( T  t,
U  u,
T result 
)
throw (
)
inline

Definition at line 384 of file safeint.h.

385{
387 details::SafeIntErrorPolicy_NoThrow >::Multiply( t, u, result ) == SafeIntNoError );
388}

◆ SafeNotEquals()

template<typename T , typename U >
bool msl::utilities::SafeNotEquals ( const T  t,
const U  u 
)
throw (
)
inline

Definition at line 348 of file safeint.h.

349{
351}

◆ SafeSubtract()

template<typename T , typename U >
bool msl::utilities::SafeSubtract ( T  t,
U  u,
T result 
)
throw (
)
inline

Definition at line 405 of file safeint.h.

406{
407 return ( details::SubtractionHelper< T, U,
408 details::SafeIntErrorPolicy_NoThrow >::Subtract( t, u, result ) == SafeIntNoError );
409}