mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-21 05:57:33 +00:00
[C++] Vector of Tables equality (#7415)
* Vector of Tables equality * support nullptr and fix for not being able to use auto in lambda * use different std::equal overload * use flatbuffers::unique_ptr * go back to auto and clang-format fix
This commit is contained in:
@@ -556,7 +556,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) {
|
||||
(lhs.name == rhs.name) &&
|
||||
(lhs.inventory == rhs.inventory) &&
|
||||
(lhs.color == rhs.color) &&
|
||||
(lhs.weapons == rhs.weapons) &&
|
||||
(lhs.weapons.size() == rhs.weapons.size() && std::equal(lhs.weapons.cbegin(), lhs.weapons.cend(), rhs.weapons.cbegin(), [](flatbuffers::unique_ptr<MyGame::Sample::WeaponT> const &a, flatbuffers::unique_ptr<MyGame::Sample::WeaponT> const &b) { return (a == b) || (a && b && *a == *b); })) &&
|
||||
(lhs.equipped == rhs.equipped) &&
|
||||
(lhs.path == rhs.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user