Skip to content
Snippets Groups Projects

F cpp to string

1 file
+ 10
2
Compare changes
  • Side-by-side
  • Inline
+ 10
2
@@ -58,7 +58,11 @@ public:
* serialization.
*/
inline auto operator==(const ProtoMessageWrapper<P> &other) const noexcept -> bool {
return this->wrapped->SerializeAsString() == other.wrapped->SerializeAsString();
if (this->wrapped != nullptr && other.wrapped != nullptr) {
return this->wrapped->SerializeAsString() == other.wrapped->SerializeAsString();
}
// both nullptr?
return this->wrapped == other.wrapped;
}
/**
@@ -66,7 +70,11 @@ public:
* serialization.
*/
inline auto operator!=(const ProtoMessageWrapper<P> &other) const noexcept -> bool {
return this->wrapped->SerializeAsString() != other.wrapped->SerializeAsString();
if (this->wrapped != nullptr && other.wrapped != nullptr) {
return this->wrapped->SerializeAsString() != other.wrapped->SerializeAsString();
}
// only one is nullptr?
return this->wrapped != other.wrapped;
}
protected:
Loading