MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / circular_less_than

Function circular_less_than

deps/concurrentqueue/concurrentqueue.h:469–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467
468 template<typename T>
469 static inline bool circular_less_than(T a, T b)
470 {
471#ifdef _MSC_VER
472#pragma warning(push)
473#pragma warning(disable: 4554)
474#endif
475 static_assert(std::is_integral<T>::value && !std::numeric_limits<T>::is_signed, "circular_less_than is intended to be used only with unsigned integer types");
476 return static_cast<T>(a - b) > static_cast<T>(static_cast<T>(1) << static_cast<T>(sizeof(T) * CHAR_BIT - 1));
477#ifdef _MSC_VER
478#pragma warning(pop)
479#endif
480 }
481
482 template<typename U>
483 static inline char* align_for(char* ptr)

Callers 2

size_approxMethod · 0.85
~ImplicitProducerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected