MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / circular_less_than

Function circular_less_than

concurrentqueue.h:490–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488
489 template<typename T>
490 static inline bool circular_less_than(T a, T b)
491 {
492 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");
493 return static_cast<T>(a - b) > static_cast<T>(static_cast<T>(1) << (static_cast<T>(sizeof(T) * CHAR_BIT - 1)));
494 // Note: extra parens around rhs of operator<< is MSVC bug: https://developercommunity2.visualstudio.com/t/C4554-triggers-when-both-lhs-and-rhs-is/10034931
495 // silencing the bug requires #pragma warning(disable: 4554) around the calling code and has no effect when done here.
496 }
497
498 template<typename U>
499 static inline char* align_for(char* ptr)

Callers 2

size_approxMethod · 0.70
~ImplicitProducerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected