MCPcopy Create free account
hub / github.com/SlimeVR/SlimeVR-Tracker-ESP / byteCompare

Function byteCompare

src/sensorinterface/SensorInterfaceManager.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T>
27bool byteCompare(const T& lhs, const T& rhs) {
28 const auto* lhsBytes = reinterpret_cast<const uint8_t*>(&lhs);
29 const auto* rhsBytes = reinterpret_cast<const uint8_t*>(&rhs);
30
31 for (size_t i = 0; i < sizeof(T); i++) {
32 if (lhsBytes[i] < rhsBytes[i]) {
33 return true;
34 }
35 }
36
37 return false;
38}
39
40bool operator<(const SPISettings& lhs, const SPISettings& rhs) {
41 return byteCompare(lhs, rhs);

Callers 1

operator<Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected