Skip to content

Commit 4796bf6

Browse files
committed
Another update to make clang-tidy happy for the other equality operator
1 parent f8d8b3b commit 4796bf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/data-model/Nullable.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ struct Nullable : protected std::optional<T>
105105
// The only fabric-scoped objects in the spec are commands, events and structs inside lists, and none of those can be nullable.
106106
static constexpr bool kIsFabricScoped = false;
107107

108-
bool operator==(const T & other) const { return std::optional<T>::has_value() && (**this == other); }
109-
bool operator!=(const T & other) const { return !(*this == other); }
108+
inline bool operator==(const T & other) const { return static_cast<const std::optional<T> &>(*this) == other; }
109+
inline bool operator!=(const T & other) const { return !(*this == other); }
110110

111111
inline bool operator==(const Nullable<T> & other) const
112112
{
113113
return static_cast<const std::optional<T> &>(*this) == static_cast<const std::optional<T> &>(other);
114114
}
115-
bool operator!=(const Nullable<T> & other) const { return !(*this == other); }
115+
inline bool operator!=(const Nullable<T> & other) const { return !(*this == other); }
116116
};
117117

118118
template <class T>

0 commit comments

Comments
 (0)