numeric.int.operator.unsigned

Copyright: (c) Microsoft Corporation. All rights reserved.

Unsigned arithmetic operators.


template <typename T, typename U>
inline T sub(T t, U u) §

Returns t - u. The result type is the same (unsigned) type as t. u must be no greater than t (to ensure the result is non-negative).

template <typename T>
inline T decrement(T t) §

Returns t - 1. The result type is the same (unsigned) type as t. t must be positive (to ensure the result is positive)

template <typename T>
inline T decrement_if(T t, bool b) §

If b is true, then returns t - 1. Returns t otherwise. The result type is the same (unsigned) type as t. The caller must ensure that the decrement would not result in a negative number.