Syntax
class SerialNumber
{
public:
template <typename UintType> static bool IsLess(UintType aFirst, UintType aSecond)
{
static_assert(TypeTraits::IsSame<UintType, uint8_t>::kValue || TypeTraits::IsSame<UintType, uint16_t>::kValue ||
TypeTraits::IsSame<UintType, uint32_t>::kValue ||
TypeTraits::IsSame<UintType, uint64_t>::kValue,
"UintType MUST be an 8, 16, 32, or 64 bit `uint` type");
static constexpr UintType kNegativeMask = (NumericLimits<UintType>::kMax >> 1) + 1;
return ((aFirst - aSecond) & kNegativeMask) != 0;
}
template <typename UintType> static bool IsGreater(UintType aFirst, UintType aSecond)
{
return IsLess(aSecond, aFirst);
}
};
Methods
IsLess()
IsGreater()
IsLess
![]()
class SerialNumber