Make == operator for YGStyle free function

Summary:
@public

Makes it work nicely with gtest.

Also allows rhs *and* lhs to offer `operator(YGStyle)()`.

Reviewed By: SidharthGuglani

Differential Revision: D13942573

fbshipit-source-id: ff8b3a9aa6f05ca1b0572eb97d0ad23b09d77871
This commit is contained in:
David Aurelio
2019-02-04 10:21:37 -08:00
committed by Facebook Github Bot
parent 9378a7a439
commit 3645f43cea
2 changed files with 31 additions and 30 deletions

View File

@@ -66,10 +66,10 @@ public:
flexWrap(YGWrapNoWrap),
overflow(YGOverflowVisible),
display(YGDisplayFlex) {}
bool operator==(const YGStyle& style);
bool operator!=(YGStyle style) {
return !(*this == style);
}
~YGStyle() = default;
};
bool operator==(const YGStyle& lhs, const YGStyle& rhs);
inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) {
return !(lhs == rhs);
}