diff --git a/src/core/common/equatable.hpp b/src/core/common/equatable.hpp index 06fdda993..d9130150f 100644 --- a/src/core/common/equatable.hpp +++ b/src/core/common/equatable.hpp @@ -87,7 +87,10 @@ public: * @retval FALSE If the two `Type` instances are not equal. * */ - bool operator==(const Type &aOther) const { return memcmp(this, &aOther, sizeof(Type)) == 0; } + bool operator==(const Type &aOther) const + { + return memcmp(static_cast(this), &aOther, sizeof(Type)) == 0; + } }; } // namespace ot