Skip to content

Commit

Permalink
Use codegen in struct's operator== (redo)
Browse files Browse the repository at this point in the history
Reviewed By: thedavekwon

Differential Revision: D49178168

fbshipit-source-id: dffc03926534df3513d5d5f9baf11fee93329551
  • Loading branch information
TJ Yin authored and facebook-github-bot committed Sep 15, 2023
1 parent a46bb81 commit a0e7fe5
Show file tree
Hide file tree
Showing 66 changed files with 341 additions and 5,275 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,5 @@

%>
bool <%struct:cpp_underlying_name%>::operator==(FOLLY_MAYBE_UNUSED const <%struct:cpp_underlying_name%>& rhs) const {
FOLLY_MAYBE_UNUSED auto& lhs = *this;
<%#struct:fields%><%#field:type%>
<%#field:lazy?%>
lhs.<%field:cpp_name%>_ref();
rhs.<%field:cpp_name%>_ref();
<%/field:lazy?%>
if (<% > field/neq%>) {
return false;
}
<%/field:type%><%/struct:fields%>
return true;
return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}
345 changes: 31 additions & 314 deletions thrift/compiler/test/fixtures/adapter/gen-cpp2/module_types.cpp

Large diffs are not rendered by default.

12 changes: 2 additions & 10 deletions thrift/compiler/test/fixtures/any/gen-cpp2/module_types.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 3 additions & 36 deletions thrift/compiler/test/fixtures/basic/gen-cpp2/module_types.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a0e7fe5

Please sign in to comment.