payloadEqualityTraits
Functions
-
template<typename T>
bool supportsPayloadEquality() noexcept Returns true if a field-wise equality comparison is defined for payload type T.
-
template<typename T>
bool payloadsAreEqual(const T &lhs, const T &rhs) Compare two payloads field-wise.
Will not compile for payload types that lack a PayloadEqualityTraits<T> specialization. Guard calls with supportsPayloadEquality<T>() via if constexpr, or add a specialization.
-
template<typename T>
struct PayloadEqualityTraits - #include <payloadEqualityTraits.h>
Primary template: equality comparison not supported for this payload type by default.
To enable recordOnChange() for a payload type, provide a specialization either:
automatically, via generatePayloadEqualityHeader.py (for fully-supported struct fields), or
manually, as a PayloadEqualityTraits<T> specialization in the payload header file (guarded by #ifdef __cplusplus) when the comparison semantics can be defined safely.
Public Static Attributes
-
static bool supported = false
Indicates whether equality comparison is supported for this payload type.