mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-1452 generate a swap() method for all generated structs
fix compiler warnings, when having empty structs git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1212593 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8516f58b77
commit
e1d2458f1a
@ -1526,6 +1526,14 @@ void t_cpp_generator::generate_struct_swap(ofstream& out, t_struct* tstruct) {
|
||||
indent() << "swap(a.__isset, b.__isset);" << endl;
|
||||
}
|
||||
|
||||
// handle empty structs
|
||||
if (fields.size() == 0) {
|
||||
out <<
|
||||
indent() << "(void) a;" << endl;
|
||||
out <<
|
||||
indent() << "(void) b;" << endl;
|
||||
}
|
||||
|
||||
scope_down(out);
|
||||
out << endl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user