MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / SaturatingSubtract

Function SaturatingSubtract

extra/yassl/taocrypt/include/misc.hpp:871–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869
870template <class T1, class T2>
871inline T1 SaturatingSubtract(T1 a, T2 b)
872{
873 TAOCRYPT_COMPILE_ASSERT_INSTANCE(T1(-1)>0, 0); // T1 is unsigned type
874 TAOCRYPT_COMPILE_ASSERT_INSTANCE(T2(-1)>0, 1); // T2 is unsigned type
875 return T1((a > b) ? (a - b) : 0);
876}
877
878
879// declares

Callers 2

UnPadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected