Skip to content

Commit

Permalink
Fixing build on older compilers (gcc < 4.5).
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumedh Wale committed Feb 2, 2017
1 parent c3a1d67 commit f7b1844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions compiler/cpp/src/thrift/generate/t_cpp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ void t_cpp_generator::generate_struct_declaration(ofstream& out,
if (swap) {
// Generate a namespace-scope swap() function
out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
<< " &b) noexcept;" << endl << endl;
<< " &b);" << endl << endl;
}

if (is_user_struct) {
Expand Down Expand Up @@ -1649,14 +1649,13 @@ void t_cpp_generator::generate_struct_result_writer(ofstream& out,
*/
void t_cpp_generator::generate_struct_swap(ofstream& out, t_struct* tstruct) {
out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
<< " &b) noexcept {" << endl;
<< " &b) {" << endl;
indent_up();

// Let argument-dependent name lookup find the correct swap() function to
// use based on the argument types. If none is found in the arguments'
// namespaces, fall back to ::std::swap().
out << indent() << "using ::std::swap;" << endl;
out << indent() << "static_assert(noexcept(swap(a, b)), \"throwing swap\");" << endl;

bool has_nonrequired_fields = false;
const vector<t_field*>& fields = tstruct->get_members();
Expand Down
4 changes: 2 additions & 2 deletions lib/cpp/src/thrift/transport/THeaderTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class THeaderTransport : public TVirtualTransport<THeaderTransport, TFramedTrans

/// Use default buffer sizes.
explicit THeaderTransport(const boost::shared_ptr<TTransport>& transport)
: TVirtualTransport(transport),
: TVirtualTransport<THeaderTransport, TFramedTransport>(transport),
outTransport_(transport),
protoId(T_COMPACT_PROTOCOL),
clientType(THRIFT_HEADER_CLIENT_TYPE),
Expand All @@ -83,7 +83,7 @@ class THeaderTransport : public TVirtualTransport<THeaderTransport, TFramedTrans

THeaderTransport(const boost::shared_ptr<TTransport> inTransport,
const boost::shared_ptr<TTransport> outTransport)
: TVirtualTransport(inTransport),
: TVirtualTransport<THeaderTransport, TFramedTransport>(inTransport),
outTransport_(outTransport),
protoId(T_COMPACT_PROTOCOL),
clientType(THRIFT_HEADER_CLIENT_TYPE),
Expand Down

0 comments on commit f7b1844

Please sign in to comment.