Add position type check to layout metrics == operator (#42020)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42020

I added position type in D51412428 (https://github.com/facebook/react-native/pull/41819). I didn't notice this == override which makes it so position type in layout metrics will not be updated if it changes.

To use this cpp 20 feature we needed to change a few buck files which is also done here

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52339890

fbshipit-source-id: e77ee092477dbf786e4a72e6a33138ccbc450645
This commit is contained in:
Joe Vilches
2024-01-03 09:34:58 -08:00
committed by Facebook GitHub Bot
parent 82f8cf1836
commit 0e533f3081
@@ -65,24 +65,7 @@ struct LayoutMetrics {
frame.size.height - borderWidth.top - borderWidth.bottom}};
}
bool operator==(const LayoutMetrics& rhs) const {
return std::tie(
this->frame,
this->contentInsets,
this->borderWidth,
this->displayType,
this->layoutDirection,
this->pointScaleFactor,
this->overflowInset) ==
std::tie(
rhs.frame,
rhs.contentInsets,
rhs.borderWidth,
rhs.displayType,
rhs.layoutDirection,
rhs.pointScaleFactor,
rhs.overflowInset);
}
bool operator==(const LayoutMetrics& rhs) const = default;
bool operator!=(const LayoutMetrics& rhs) const {
return !(*this == rhs);