diff --git a/compiler/cpp/src/thrift/generate/go_validator_generator.cc b/compiler/cpp/src/thrift/generate/go_validator_generator.cc
index 1f5a3ad..0adff2e 100644
--- a/compiler/cpp/src/thrift/generate/go_validator_generator.cc
+++ b/compiler/cpp/src/thrift/generate/go_validator_generator.cc
@@ -82,19 +82,19 @@
   }
   if (type->is_enum()) {
     if (context.tgt[0] == '*') {
-      out << indent() << "if " << context.tgt.substr(1) << " != nil {" << endl;
+      out << indent() << "if " << context.tgt.substr(1) << " != nil {" << '\n';
       indent_up();
     }
     generate_enum_field_validator(out, context);
     if (context.tgt[0] == '*') {
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
     return;
   } else if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     if (context.tgt[0] == '*') {
-      out << indent() << "if " << context.tgt.substr(1) << " != nil {" << endl;
+      out << indent() << "if " << context.tgt.substr(1) << " != nil {" << '\n';
       indent_up();
     }
     switch (tbase) {
@@ -119,7 +119,7 @@
     }
     if (context.tgt[0] == '*') {
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
     return;
   } else if (type->is_list()) {
@@ -146,7 +146,7 @@
     if (key == "vt.in") {
       if (values.size() > 1) {
         std::string exist = GenID("_exist");
-        out << indent() << "var " << exist << " bool" << endl;
+        out << indent() << "var " << exist << " bool" << '\n';
 
         std::string src = GenID("_src");
         out << indent() << src << " := []int64{";
@@ -162,19 +162,19 @@
           }
           out << ")";
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if int64(" << context.tgt << ") == src {" << endl;
+        out << indent() << "if int64(" << context.tgt << ") == src {" << '\n';
         indent_up();
-        out << indent() << exist << " = true" << endl;
-        out << indent() << "break" << endl;
+        out << indent() << exist << " = true" << '\n';
+        out << indent() << "break" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
-        out << indent() << "if " << exist << " == false {" << endl;
+        out << indent() << "}" << '\n';
+        out << indent() << "if " << exist << " == false {" << '\n';
       } else {
         out << indent() << "if int64(" << context.tgt << ") != int64(";
         if (values[0]->is_field_reference()) {
@@ -182,18 +182,18 @@
         } else {
           out << values[0]->get_enum()->get_value();
         }
-        out << ") {" << endl;
+        out << ") {" << '\n';
       }
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.in check failed\")" << endl;
+          << " not valid, rule vt.in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       if (values.size() > 1) {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     } else if (key == "vt.not_in") {
       if (values.size() > 1) {
@@ -211,11 +211,11 @@
           }
           out << ")";
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if int64(" << context.tgt << ") == src {" << endl;
+        out << indent() << "if int64(" << context.tgt << ") == src {" << '\n';
       } else {
         out << indent() << "if int64(" << context.tgt << ") == ";
         out << "int64(";
@@ -224,18 +224,18 @@
         } else {
           out << values[0]->get_enum()->get_value();
         }
-        out << ") {" << endl;
+        out << ") {" << '\n';
       }
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.not_in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.not_in check failed\")" << endl;
+          << " not valid, rule vt.not_in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       if (values.size() > 1) {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     } else if (key == "vt.defined_only") {
       if (values[0]->get_bool()) {
@@ -243,14 +243,14 @@
       } else {
         continue;
       }
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
           << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-          << " check failed\")" << endl;
+          << " check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
   }
 }
@@ -276,14 +276,14 @@
         }
       }
     }
-    out << "{" << endl;
+    out << "{" << '\n';
     indent_up();
     out << indent()
         << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
         << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-        << " check failed\")" << endl;
+        << " check failed\")" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
 }
 
@@ -308,19 +308,19 @@
       } else {
         out << values[0]->get_double();
       }
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
           << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-          << " check failed\")" << endl;
+          << " check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       continue;
     } else if (key == "vt.in") {
       if (values.size() > 1) {
         std::string exist = GenID("_exist");
-        out << indent() << "var " << exist << " bool" << endl;
+        out << indent() << "var " << exist << " bool" << '\n';
 
         std::string src = GenID("_src");
         out << indent() << src << " := []float64{";
@@ -334,19 +334,19 @@
             out << (*it)->get_double();
           }
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if " << context.tgt << " == src {" << endl;
+        out << indent() << "if " << context.tgt << " == src {" << '\n';
         indent_up();
-        out << indent() << exist << " = true" << endl;
-        out << indent() << "break" << endl;
+        out << indent() << exist << " = true" << '\n';
+        out << indent() << "break" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
-        out << indent() << "if " << exist << " == false {" << endl;
+        out << indent() << "}" << '\n';
+        out << indent() << "if " << exist << " == false {" << '\n';
       } else {
         out << indent() << "if " << context.tgt << " != ";
         if (values[0]->is_field_reference()) {
@@ -354,16 +354,16 @@
         } else {
           out << values[0]->get_double();
         }
-        out << "{" << endl;
+        out << "{" << '\n';
       }
 
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.in check failed\")" << endl;
+          << " not valid, rule vt.in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.not_in") {
       if (values.size() > 1) {
         std::string src = GenID("_src");
@@ -378,11 +378,11 @@
             out << (*it)->get_double();
           }
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if " << context.tgt << " == src {" << endl;
+        out << indent() << "if " << context.tgt << " == src {" << '\n';
       } else {
         out << indent() << "if " << context.tgt << " == ";
         if (values[0]->is_field_reference()) {
@@ -390,18 +390,18 @@
         } else {
           out << values[0]->get_double();
         }
-        out << "{" << endl;
+        out << "{" << '\n';
       }
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.not_in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.not_in check failed\")" << endl;
+          << " not valid, rule vt.not_in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       if (values.size() > 1) {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     }
   }
@@ -460,18 +460,18 @@
       } else {
         out << values[0]->get_int();
       }
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
           << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-          << " check failed\")" << endl;
+          << " check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.in") {
       if (values.size() > 1) {
         std::string exist = GenID("_exist");
-        out << indent() << "var " << exist << " bool" << endl;
+        out << indent() << "var " << exist << " bool" << '\n';
 
         std::string src = GenID("_src");
         out << indent() << src << " := []";
@@ -499,19 +499,19 @@
             out << (*it)->get_int();
           }
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if " << context.tgt << " == src {" << endl;
+        out << indent() << "if " << context.tgt << " == src {" << '\n';
         indent_up();
-        out << indent() << exist << " = true" << endl;
-        out << indent() << "break" << endl;
+        out << indent() << exist << " = true" << '\n';
+        out << indent() << "break" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
-        out << indent() << "if " << exist << " == false {" << endl;
+        out << indent() << "}" << '\n';
+        out << indent() << "if " << exist << " == false {" << '\n';
       } else {
         out << indent() << "if " << context.tgt << " != ";
         if (values[0]->is_field_reference()) {
@@ -531,15 +531,15 @@
         } else {
           out << values[0]->get_int();
         }
-        out << "{" << endl;
+        out << "{" << '\n';
       }
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.in check failed\")" << endl;
+          << " not valid, rule vt.in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.not_in") {
       if (values.size() > 1) {
         std::string src = GenID("_src");
@@ -584,11 +584,11 @@
             out << (*it)->get_int();
           }
         }
-        out << "}" << endl;
+        out << "}" << '\n';
 
-        out << indent() << "for _, src := range " << src << " {" << endl;
+        out << indent() << "for _, src := range " << src << " {" << '\n';
         indent_up();
-        out << indent() << "if " << context.tgt << " == src {" << endl;
+        out << indent() << "if " << context.tgt << " == src {" << '\n';
       } else {
         out << indent() << "if " << context.tgt << " == ";
         if (values[0]->is_field_reference()) {
@@ -608,18 +608,18 @@
         } else {
           out << values[0]->get_int();
         }
-        out << "{" << endl;
+        out << "{" << '\n';
       }
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"vt.not_in\", \""
           << context.field_symbol << "\", \"" << context.field_symbol
-          << " not valid, rule vt.not_in check failed\")" << endl;
+          << " not valid, rule vt.not_in check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       if (values.size() > 1) {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     }
   }
@@ -635,7 +635,7 @@
   if (type->is_binary()) {
     target = GenID("_tgt");
     out << indent() << target << " := "
-        << "string(" << context.tgt << ")" << endl;
+        << "string(" << context.tgt << ")" << '\n';
   }
   for (auto it = context.rules.begin(); it != context.rules.end(); it++) {
     const std::vector<validation_value*>& values = (*it)->get_values();
@@ -729,14 +729,14 @@
       }
       out << ")";
     }
-    out << "{" << endl;
+    out << "{" << '\n';
     indent_up();
     out << indent()
         << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
         << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-        << " check failed\")" << endl;
+        << " check failed\")" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
 }
 
@@ -764,19 +764,19 @@
       } else {
         out << values[0]->get_int();
       }
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
           << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-          << " check failed\")" << endl;
+          << " check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.elem") {
-      out << indent() << "for i := 0; i < len(" << context.tgt << ");i++ {" << endl;
+      out << indent() << "for i := 0; i < len(" << context.tgt << ");i++ {" << '\n';
       indent_up();
       std::string src = GenID("_elem");
-      out << indent() << src << " := " << context.tgt << "[i]" << endl;
+      out << indent() << src << " := " << context.tgt << "[i]" << '\n';
       t_type* elem_type;
       if (context.type->is_list()) {
         elem_type = ((t_list*)context.type)->get_elem_type();
@@ -791,7 +791,7 @@
                             std::vector<validation_rule*>{(*it)->get_inner()}};
       generate_field_validator(out, ctx);
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
   }
 }
@@ -815,17 +815,17 @@
       } else {
         out << values[0]->get_int();
       }
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
       out << indent()
           << "return thrift.NewValidationException(thrift.VALIDATION_FAILED, \"" + key + "\", \""
           << context.field_symbol << "\", \"" << context.field_symbol << " not valid, rule " << key
-          << " check failed\")" << endl;
+          << " check failed\")" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.key") {
       std::string src = GenID("_key");
-      out << indent() << "for " << src << " := range " << context.tgt << " {" << endl;
+      out << indent() << "for " << src << " := range " << context.tgt << " {" << '\n';
       indent_up();
       generator_context ctx{context.field_symbol + ".key",
                             "",
@@ -835,10 +835,10 @@
                             std::vector<validation_rule*>{(*it)->get_inner()}};
       generate_field_validator(out, ctx);
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else if (key == "vt.value") {
       std::string src = GenID("_value");
-      out << indent() << "for _, " << src << " := range " << context.tgt << " {" << endl;
+      out << indent() << "for _, " << src << " := range " << context.tgt << " {" << '\n';
       indent_up();
       generator_context ctx{context.field_symbol + ".value",
                             "",
@@ -848,7 +848,7 @@
                             std::vector<validation_rule*>{(*it)->get_inner()}};
       generate_field_validator(out, ctx);
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
   }
 }
@@ -875,31 +875,31 @@
   }
   if (generate_valid) {
     if (last_valid_rule == nullptr) {
-      out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << endl;
+      out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << '\n';
       indent_up();
-      out << indent() << "return err" << endl;
+      out << indent() << "return err" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else {
       const std::vector<validation_value*>& values = last_valid_rule->get_values();
       if (!values[0]->get_bool()) {
-        out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << endl;
+        out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << '\n';
         indent_up();
-        out << indent() << "return err" << endl;
+        out << indent() << "return err" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       } else if (values[0]->is_field_reference()) {
         out << indent() << "if !";
         out << get_field_reference_name(values[0]->get_field_reference());
-        out << "{" << endl;
+        out << "{" << '\n';
         indent_up();
-        out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << endl;
+        out << indent() << "if err := " << context.tgt << ".Validate(); err != nil {" << '\n';
         indent_up();
-        out << indent() << "return err" << endl;
+        out << indent() << "return err" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     }
   }
diff --git a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
index da25338..b5eb603 100644
--- a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
@@ -39,8 +39,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /* forward declarations */
 string initial_caps_to_underscores(string name);
 string underscores_to_initial_caps(string name);
@@ -241,18 +239,18 @@
   f_types_impl_ << autogen_comment();
 
   /* include inclusion guard */
-  f_types_ << "#ifndef " << this->nspace_uc << program_name_uc << "_TYPES_H" << endl << "#define "
-           << this->nspace_uc << program_name_uc << "_TYPES_H" << endl << endl;
+  f_types_ << "#ifndef " << this->nspace_uc << program_name_uc << "_TYPES_H" << '\n' << "#define "
+           << this->nspace_uc << program_name_uc << "_TYPES_H" << '\n' << '\n';
 
   /* include base types */
-  f_types_ << "/* base includes */" << endl << "#include <glib-object.h>" << endl
-           << "#include <thrift/c_glib/thrift_struct.h>" << endl
-           << "#include <thrift/c_glib/protocol/thrift_protocol.h>" << endl;
+  f_types_ << "/* base includes */" << '\n' << "#include <glib-object.h>" << '\n'
+           << "#include <thrift/c_glib/thrift_struct.h>" << '\n'
+           << "#include <thrift/c_glib/protocol/thrift_protocol.h>" << '\n';
 
   /* include other thrift includes */
   const vector<t_program*>& includes = program_->get_includes();
   if (!includes.empty()) {
-    f_types_ << "/* other thrift includes */" << endl;
+    f_types_ << "/* other thrift includes */" << '\n';
 
     for (auto include : includes) {
       const std::string& include_nspace = include->get_namespace("c_glib");
@@ -260,32 +258,32 @@
         include_nspace.empty() ? "" : initial_caps_to_underscores(include_nspace) + "_";
 
       f_types_ << "#include \"" << include_nspace_prefix
-               << initial_caps_to_underscores(include->get_name()) << "_types.h\"" << endl;
+               << initial_caps_to_underscores(include->get_name()) << "_types.h\"" << '\n';
     }
-    f_types_ << endl;
+    f_types_ << '\n';
   }
 
   /* include custom headers */
   const vector<string>& c_includes = program_->get_c_includes();
-  f_types_ << "/* custom thrift includes */" << endl;
+  f_types_ << "/* custom thrift includes */" << '\n';
   for (const auto & c_include : c_includes) {
     if (c_include[0] == '<') {
-      f_types_ << "#include " << c_include << endl;
+      f_types_ << "#include " << c_include << '\n';
     } else {
-      f_types_ << "#include \"" << c_include << "\"" << endl;
+      f_types_ << "#include \"" << c_include << "\"" << '\n';
     }
   }
-  f_types_ << endl;
+  f_types_ << '\n';
 
   /* include math.h (for "INFINITY") in the implementation file, in case we
      encounter a struct with a member of type double */
-  f_types_impl_ << endl << "#include <math.h>" << endl;
+  f_types_impl_ << '\n' << "#include <math.h>" << '\n';
 
   // include the types file
-  f_types_impl_ << endl << "#include \"" << this->nspace_lc << program_name_u << "_types.h\""
-                << endl << "#include <thrift/c_glib/thrift.h>" << endl << endl;
+  f_types_impl_ << '\n' << "#include \"" << this->nspace_lc << program_name_u << "_types.h\""
+                << '\n' << "#include <thrift/c_glib/thrift.h>" << '\n' << '\n';
 
-  f_types_ << "/* begin types */" << endl << endl;
+  f_types_ << "/* begin types */" << '\n' << '\n';
 }
 
 /**
@@ -295,7 +293,7 @@
   string program_name_uc = to_upper_case(initial_caps_to_underscores(program_name_));
 
   /* end the header inclusion guard */
-  f_types_ << "#endif /* " << this->nspace_uc << program_name_uc << "_TYPES_H */" << endl;
+  f_types_ << "#endif /* " << this->nspace_uc << program_name_uc << "_TYPES_H */" << '\n';
 
   /* close output file */
   f_types_.close();
@@ -313,7 +311,7 @@
  */
 void t_c_glib_generator::generate_typedef(t_typedef* ttypedef) {
   f_types_ << indent() << "typedef " << type_name(ttypedef->get_type(), true) << " " << this->nspace
-           << ttypedef->get_symbolic() << ";" << endl << endl;
+           << ttypedef->get_symbolic() << ";" << '\n' << '\n';
 }
 
 /**
@@ -336,7 +334,7 @@
   string name = tenum->get_name();
   string name_uc = to_upper_case(initial_caps_to_underscores(name));
 
-  f_types_ << indent() << "enum _" << this->nspace << name << " {" << endl;
+  f_types_ << indent() << "enum _" << this->nspace << name << " {" << '\n';
 
   indent_up();
 
@@ -349,7 +347,7 @@
     if (first) {
       first = false;
     } else {
-      f_types_ << "," << endl;
+      f_types_ << "," << '\n';
     }
 
     f_types_ << indent() << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name();
@@ -357,19 +355,19 @@
   }
 
   indent_down();
-  f_types_ << endl << "};" << endl << "typedef enum _" << this->nspace << name << " "
-           << this->nspace << name << ";" << endl << endl;
+  f_types_ << '\n' << "};" << '\n' << "typedef enum _" << this->nspace << name << " "
+           << this->nspace << name << ";" << '\n' << '\n';
 
-  f_types_ << "/* return the name of the constant */" << endl;
-  f_types_ << "const char *" << endl;
-  f_types_ << "toString_" << name << "(int value); " << endl << endl;
+  f_types_ << "/* return the name of the constant */" << '\n';
+  f_types_ << "const char *" << '\n';
+  f_types_ << "toString_" << name << "(int value); " << '\n' << '\n';
   ;
-  f_types_impl_ << "/* return the name of the constant */" << endl;
-  f_types_impl_ << "const char *" << endl;
-  f_types_impl_ << "toString_" << name << "(int value) " << endl;
-  f_types_impl_ << "{" << endl;
-  f_types_impl_ << "  static __thread char buf[16] = {0};" << endl;
-  f_types_impl_ << "  switch(value) {" << endl;
+  f_types_impl_ << "/* return the name of the constant */" << '\n';
+  f_types_impl_ << "const char *" << '\n';
+  f_types_impl_ << "toString_" << name << "(int value) " << '\n';
+  f_types_impl_ << "{" << '\n';
+  f_types_impl_ << "  static __thread char buf[16] = {0};" << '\n';
+  f_types_impl_ << "  switch(value) {" << '\n';
   std::set<int> done;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
@@ -379,20 +377,20 @@
       f_types_impl_ << "  case " << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name()
                     << ":"
                     << "return \"" << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name()
-                    << "\";" << endl;
+                    << "\";" << '\n';
     }
   }
-  f_types_impl_ << "  default: g_snprintf(buf, 16, \"%d\", value); return buf;" << endl;
-  f_types_impl_ << "  }" << endl;
-  f_types_impl_ << "}" << endl << endl;
+  f_types_impl_ << "  default: g_snprintf(buf, 16, \"%d\", value); return buf;" << '\n';
+  f_types_impl_ << "  }" << '\n';
+  f_types_impl_ << "}" << '\n' << '\n';
 }
 
 /**
  * Generates Thrift constants in C code.
  */
 void t_c_glib_generator::generate_consts(vector<t_const*> consts) {
-  f_types_ << "/* constants */" << endl;
-  f_types_impl_ << "/* constants */" << endl;
+  f_types_ << "/* constants */" << '\n';
+  f_types_impl_ << "/* constants */" << '\n';
 
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
@@ -404,17 +402,17 @@
 
     if (is_complex_type(type)) {
       f_types_ << type_name(type) << indent() << this->nspace_lc << name_lc
-               << "_constant();" << endl;
+               << "_constant();" << '\n';
     }
 
     f_types_ << indent() << "#define " << this->nspace_uc << name_uc << " "
-             << constant_value(name_lc, type, value) << endl;
+             << constant_value(name_lc, type, value) << '\n';
 
     generate_const_initializer(name_lc, type, value, true);
   }
 
-  f_types_ << endl;
-  f_types_impl_ << endl;
+  f_types_ << '\n';
+  f_types_impl_ << '\n';
 }
 
 /**
@@ -439,7 +437,7 @@
  * // ... additional GObject boilerplate ...
  */
 void t_c_glib_generator::generate_struct(t_struct* tstruct) {
-  f_types_ << "/* struct " << tstruct->get_name() << " */" << endl;
+  f_types_ << "/* struct " << tstruct->get_name() << " */" << '\n';
   generate_object(tstruct);
 }
 
@@ -463,21 +461,21 @@
   f_header_ << autogen_comment();
 
   // add an inclusion guard
-  f_header_ << "#ifndef " << svcname_uc << "_H" << endl << "#define " << svcname_uc << "_H" << endl
-            << endl;
+  f_header_ << "#ifndef " << svcname_uc << "_H" << '\n' << "#define " << svcname_uc << "_H" << '\n'
+            << '\n';
 
   // add standard includes
-  f_header_ << "#include <thrift/c_glib/processor/thrift_dispatch_processor.h>" << endl << endl;
-  f_header_ << "#include \"" << this->nspace_lc << program_name_lc << "_types.h\"" << endl;
+  f_header_ << "#include <thrift/c_glib/processor/thrift_dispatch_processor.h>" << '\n' << '\n';
+  f_header_ << "#include \"" << this->nspace_lc << program_name_lc << "_types.h\"" << '\n';
 
   // if we are inheriting from another service, include its header
   t_service* extends_service = tservice->get_extends();
   if (extends_service != nullptr) {
     f_header_ << "#include \"" << this->nspace_lc
               << to_lower_case(initial_caps_to_underscores(extends_service->get_name())) << ".h\""
-              << endl;
+              << '\n';
   }
-  f_header_ << endl;
+  f_header_ << '\n';
 
   // create the service implementation
   string f_service_name = get_out_dir() + filename + ".c";
@@ -487,9 +485,9 @@
   f_service_ << autogen_comment();
 
   // include the headers
-  f_service_ << "#include <string.h>" << endl << "#include <thrift/c_glib/thrift.h>" << endl
-             << "#include <thrift/c_glib/thrift_application_exception.h>" << endl << "#include \""
-             << filename << ".h\"" << endl << endl;
+  f_service_ << "#include <string.h>" << '\n' << "#include <thrift/c_glib/thrift.h>" << '\n'
+             << "#include <thrift/c_glib/thrift_application_exception.h>" << '\n' << "#include \""
+             << filename << ".h\"" << '\n' << '\n';
 
   // generate the service-helper classes
   generate_service_helpers(tservice);
@@ -501,7 +499,7 @@
   generate_service_server(tservice);
 
   // end the header inclusion guard
-  f_header_ << "#endif /* " << svcname_uc << "_H */" << endl;
+  f_header_ << "#endif /* " << svcname_uc << "_H */" << '\n';
 
   // close the files
   f_service_.close();
@@ -519,27 +517,27 @@
 
   generate_object(tstruct);
 
-  f_types_ << "/* exception */" << endl
-           << "typedef enum" << endl
-           << "{" << endl;
+  f_types_ << "/* exception */" << '\n'
+           << "typedef enum" << '\n'
+           << "{" << '\n';
   indent_up();
-  f_types_ << indent() << this->nspace_uc << name_uc << "_ERROR_CODE" << endl;
+  f_types_ << indent() << this->nspace_uc << name_uc << "_ERROR_CODE" << '\n';
   indent_down();
-  f_types_ << "} " << this->nspace << name << "Error;" << endl
-           << endl
+  f_types_ << "} " << this->nspace << name << "Error;" << '\n'
+           << '\n'
            << "GQuark " << this->nspace_lc << name_lc
-           << "_error_quark (void);" << endl
+           << "_error_quark (void);" << '\n'
            << "#define " << this->nspace_uc << name_uc << "_ERROR ("
-           << this->nspace_lc << name_lc << "_error_quark())" << endl
-           << endl
-           << endl;
+           << this->nspace_lc << name_lc << "_error_quark())" << '\n'
+           << '\n'
+           << '\n';
 
-  f_types_impl_ << "/* define the GError domain for exceptions */" << endl << "#define "
+  f_types_impl_ << "/* define the GError domain for exceptions */" << '\n' << "#define "
                 << this->nspace_uc << name_uc << "_ERROR_DOMAIN \"" << this->nspace_lc << name_lc
-                << "_error_quark\"" << endl << "GQuark" << endl << this->nspace_lc << name_lc
-                << "_error_quark (void)" << endl << "{" << endl
+                << "_error_quark\"" << '\n' << "GQuark" << '\n' << this->nspace_lc << name_lc
+                << "_error_quark (void)" << '\n' << "{" << '\n'
                 << "  return g_quark_from_static_string (" << this->nspace_uc << name_uc
-                << "_ERROR_DOMAIN);" << endl << "}" << endl << endl;
+                << "_ERROR_DOMAIN);" << '\n' << "}" << '\n' << '\n';
 }
 
 /********************
@@ -983,12 +981,12 @@
   ostringstream render;
   if (is_numeric(etype)) {
     render << "    " << type_name(etype) << " *" << fname << " = "
-           << "g_new (" << base_type_name(etype) << ", 1);" << endl
+           << "g_new (" << base_type_name(etype) << ", 1);" << '\n'
            << "    *" << fname << " = " << constant_value(fname, (t_type*)etype, value) << ";"
-           << endl;
+           << '\n';
   } else {
     render << "    " << type_name(etype) << " " << fname << " = "
-           << constant_value(fname, (t_type*)etype, value) << ";" << endl;
+           << constant_value(fname, (t_type*)etype, value) << ";" << '\n';
   }
   return render.str();
 }
@@ -1037,22 +1035,22 @@
       initializers << "    constant->" << v_iter->first->get_string() << " = "
                    << constant_value(name + "_constant_" + field_name,
                                      field_type,
-                                     v_iter->second) << ";" << endl
+                                     v_iter->second) << ";" << '\n'
                    << "    constant->__isset_" << v_iter->first->get_string()
-                   << " = TRUE;" << endl;
+                   << " = TRUE;" << '\n';
     }
 
     // implement the initializer
     f_types_impl_ << maybe_static << this->nspace << type->get_name() << " *"
-                  << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
+                  << '\n'
+                  << this->nspace_lc << name_lc << "_constant (void)" << '\n';
     scope_up(f_types_impl_);
     f_types_impl_ << indent() << "static " << this->nspace << type->get_name()
-                  << " *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
+                  << " *constant = NULL;" << '\n'
+                  << indent() << "if (constant == NULL)" << '\n';
     scope_up(f_types_impl_);
     f_types_impl_ << indent() << "constant = g_object_new (" << this->nspace_uc
-                  << "TYPE_" << type_uc << ", NULL);" << endl
+                  << "TYPE_" << type_uc << ", NULL);" << '\n'
                   << initializers.str();
     scope_down(f_types_impl_);
 
@@ -1074,9 +1072,9 @@
       field_name = tmp(field_name);
     }
 
-    f_types_impl_ << indent() << "return constant;" << endl;
+    f_types_impl_ << indent() << "return constant;" << '\n';
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   } else if (type->is_list()) {
     string list_type = "GPtrArray *";
     string free_func
@@ -1125,33 +1123,33 @@
       if (list_variable) {
         initializers << "    " << type_name(etype) << " " << fname << " = "
                      << constant_value(fname, (t_type*)etype, (*v_iter)) << ";"
-                     << endl;
+                     << '\n';
         appenders << "    " << list_appender << "(constant, " << fname << ");"
-                  << endl;
+                  << '\n';
       } else {
         appenders << "    " << list_appender << "(constant, "
                   << constant_value(fname, (t_type*)etype, (*v_iter)) << ");"
-                  << endl;
+                  << '\n';
       }
     }
 
-    f_types_impl_ << maybe_static << list_type << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
+    f_types_impl_ << maybe_static << list_type << '\n'
+                  << this->nspace_lc << name_lc << "_constant (void)" << '\n';
     scope_up(f_types_impl_);
     f_types_impl_ << indent() << "static " << list_type << " constant = NULL;"
-                  << endl
-                  << indent() << "if (constant == NULL)" << endl;
+                  << '\n'
+                  << indent() << "if (constant == NULL)" << '\n';
     scope_up(f_types_impl_);
     if (!initializers.str().empty()) {
       f_types_impl_ << initializers.str()
-                    << endl;
+                    << '\n';
     }
-    f_types_impl_ << indent() << "constant = " << list_initializer << endl
+    f_types_impl_ << indent() << "constant = " << list_initializer << '\n'
                   << appenders.str();
     scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
+    f_types_impl_ << indent() << "return constant;" << '\n';
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   } else if (type->is_set()) {
     t_type* etype = ((t_set*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
@@ -1164,22 +1162,22 @@
       string ptr = is_numeric(etype) ? "*" : "";
       generate_const_initializer(fname, etype, (*v_iter));
       initializers << constant_value_with_storage(fname, (t_type*)etype, *v_iter);
-      appenders << "    g_hash_table_insert (constant, " << fname << ", 0);" << endl;
+      appenders << "    g_hash_table_insert (constant, " << fname << ", 0);" << '\n';
     }
 
-    f_types_impl_ << maybe_static << "GHashTable *" << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
+    f_types_impl_ << maybe_static << "GHashTable *" << '\n'
+                  << this->nspace_lc << name_lc << "_constant (void)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
+    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << '\n'
+                  << indent() << "if (constant == NULL)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << initializers.str() << endl
-                  << indent() << "constant = " << generate_new_hash_from_type(etype, nullptr) << endl
+    f_types_impl_ << initializers.str() << '\n'
+                  << indent() << "constant = " << generate_new_hash_from_type(etype, nullptr) << '\n'
                   << appenders.str();
     scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
+    f_types_impl_ << indent() << "return constant;" << '\n';
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
@@ -1197,22 +1195,22 @@
 
       initializers << constant_value_with_storage(kname, (t_type*)ktype, v_iter->first);
       initializers << constant_value_with_storage(vname, (t_type*)vtype, v_iter->second);
-      appenders << "    g_hash_table_insert (constant, " << kname << ", " << vname << ");" << endl;
+      appenders << "    g_hash_table_insert (constant, " << kname << ", " << vname << ");" << '\n';
     }
 
-    f_types_impl_ << maybe_static << "GHashTable *" << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
+    f_types_impl_ << maybe_static << "GHashTable *" << '\n'
+                  << this->nspace_lc << name_lc << "_constant (void)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
+    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << '\n'
+                  << indent() << "if (constant == NULL)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << initializers.str() << endl
-                  << indent() << "constant = " << generate_new_hash_from_type(ktype, vtype) << endl
+    f_types_impl_ << initializers.str() << '\n'
+                  << indent() << "constant = " << generate_new_hash_from_type(ktype, vtype) << '\n'
                   << appenders.str();
     scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
+    f_types_impl_ << indent() << "return constant;" << '\n';
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   }
 }
 
@@ -1303,13 +1301,13 @@
   string base_service_name_uc = to_upper_case(base_service_name_lc);
 
   // Generate the client interface dummy object in the header.
-  f_header_ << "/* " << service_name_ << " service interface */" << endl << "typedef struct _"
+  f_header_ << "/* " << service_name_ << " service interface */" << '\n' << "typedef struct _"
             << this->nspace << service_name_ << "If " << this->nspace << service_name_ << "If; "
-            << " /* dummy object */" << endl << endl;
+            << " /* dummy object */" << '\n' << '\n';
 
   // Generate the client interface object in the header.
-  f_header_ << "struct _" << this->nspace << service_name_ << "IfInterface" << endl << "{" << endl
-            << "  GTypeInterface parent;" << endl << endl;
+  f_header_ << "struct _" << this->nspace << service_name_ << "IfInterface" << '\n' << "{" << '\n'
+            << "  GTypeInterface parent;" << '\n' << '\n';
 
   /* write out the functions for this interface */
   indent_up();
@@ -1330,26 +1328,26 @@
                     + (has_args ? "" : (", " + argument_list(arglist)))
                     + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError **error)";
 
-    indent(f_header_) << "gboolean (*" << funname << ") " << params << ";" << endl;
+    indent(f_header_) << "gboolean (*" << funname << ") " << params << ";" << '\n';
   }
   indent_down();
 
-  f_header_ << "};" << endl << "typedef struct _" << this->nspace << service_name_ << "IfInterface "
-            << this->nspace << service_name_ << "IfInterface;" << endl << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << this->nspace << service_name_ << "IfInterface "
+            << this->nspace << service_name_ << "IfInterface;" << '\n' << '\n';
 
   // generate all the interface boilerplate
-  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_if_get_type (void);" << endl
+  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_if_get_type (void);" << '\n'
             << "#define " << this->nspace_uc << "TYPE_" << service_name_uc << "_IF "
-            << "(" << this->nspace_lc << service_name_lc << "_if_get_type())" << endl << "#define "
+            << "(" << this->nspace_lc << service_name_lc << "_if_get_type())" << '\n' << "#define "
             << this->nspace_uc << service_name_uc << "_IF(obj) "
             << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_IF, " << this->nspace << service_name_ << "If))" << endl
+            << service_name_uc << "_IF, " << this->nspace << service_name_ << "If))" << '\n'
             << "#define " << this->nspace_uc << "IS_" << service_name_uc << "_IF(obj) "
             << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_IF))" << endl << "#define " << this->nspace_uc
+            << service_name_uc << "_IF))" << '\n' << "#define " << this->nspace_uc
             << service_name_uc << "_IF_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), "
             << this->nspace_uc << "TYPE_" << service_name_uc << "_IF, " << this->nspace
-            << service_name_ << "IfInterface))" << endl << endl;
+            << service_name_ << "IfInterface))" << '\n' << '\n';
 
   // write out all the interface function prototypes
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1368,50 +1366,50 @@
                     + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError **error)";
 
     f_header_ << "gboolean " << this->nspace_lc << service_name_lc << "_if_" << funname << " "
-              << params << ";" << endl;
+              << params << ";" << '\n';
   }
-  f_header_ << endl;
+  f_header_ << '\n';
 
   // Generate the client object instance definition in the header.
-  f_header_ << "/* " << service_name_ << " service client */" << endl << "struct _" << this->nspace
-            << service_name_ << "Client" << endl << "{" << endl << "  " << parent_class_name
-            << " parent;" << endl;
+  f_header_ << "/* " << service_name_ << " service client */" << '\n' << "struct _" << this->nspace
+            << service_name_ << "Client" << '\n' << "{" << '\n' << "  " << parent_class_name
+            << " parent;" << '\n';
   if (!extends_service) {
     // Define "input_protocol" and "output_protocol" properties only
     // for base services; child service-client classes will inherit
     // these
-    f_header_ << endl << "  ThriftProtocol *input_protocol;" << endl
-              << "  ThriftProtocol *output_protocol;" << endl;
+    f_header_ << '\n' << "  ThriftProtocol *input_protocol;" << '\n'
+              << "  ThriftProtocol *output_protocol;" << '\n';
   }
-  f_header_ << "};" << endl << "typedef struct _" << this->nspace << service_name_ << "Client "
-            << this->nspace << service_name_ << "Client;" << endl << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << this->nspace << service_name_ << "Client "
+            << this->nspace << service_name_ << "Client;" << '\n' << '\n';
 
   // Generate the class definition in the header.
-  f_header_ << "struct _" << this->nspace << service_name_ << "ClientClass" << endl << "{" << endl
-            << "  " << parent_class_name << "Class parent;" << endl << "};" << endl
+  f_header_ << "struct _" << this->nspace << service_name_ << "ClientClass" << '\n' << "{" << '\n'
+            << "  " << parent_class_name << "Class parent;" << '\n' << "};" << '\n'
             << "typedef struct _" << this->nspace << service_name_ << "ClientClass " << this->nspace
-            << service_name_ << "ClientClass;" << endl << endl;
+            << service_name_ << "ClientClass;" << '\n' << '\n';
 
   // Create all the GObject boilerplate
-  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_client_get_type (void);" << endl
+  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_client_get_type (void);" << '\n'
             << "#define " << this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT "
-            << "(" << this->nspace_lc << service_name_lc << "_client_get_type())" << endl
+            << "(" << this->nspace_lc << service_name_lc << "_client_get_type())" << '\n'
             << "#define " << this->nspace_uc << service_name_uc << "_CLIENT(obj) "
             << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_CLIENT, " << this->nspace << service_name_ << "Client))" << endl
+            << service_name_uc << "_CLIENT, " << this->nspace << service_name_ << "Client))" << '\n'
             << "#define " << this->nspace_uc << service_name_uc << "_CLIENT_CLASS(c) "
             << "(G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_CLIENT, " << this->nspace << service_name_ << "ClientClass))" << endl << "#define "
+            << "_CLIENT, " << this->nspace << service_name_ << "ClientClass))" << '\n' << "#define "
             << this->nspace_uc << service_name_uc << "_IS_CLIENT(obj) "
             << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_CLIENT))" << endl << "#define " << this->nspace_uc
+            << service_name_uc << "_CLIENT))" << '\n' << "#define " << this->nspace_uc
             << service_name_uc << "_IS_CLIENT_CLASS(c) "
             << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_CLIENT))" << endl << "#define " << this->nspace_uc << service_name_uc
+            << "_CLIENT))" << '\n' << "#define " << this->nspace_uc << service_name_uc
             << "_CLIENT_GET_CLASS(obj) "
             << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
             << service_name_uc << "_CLIENT, " << this->nspace << service_name_ << "ClientClass))"
-            << endl << endl;
+            << '\n' << '\n';
 
   /* write out the function prototypes */
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1422,12 +1420,12 @@
                                 service_name_lc + string("_client_") + funname,
                                 (*f_iter)->get_arglist(),
                                 (*f_iter)->get_xceptions());
-    indent(f_header_) << function_signature(&service_function) << ";" << endl;
+    indent(f_header_) << function_signature(&service_function) << ";" << '\n';
 
     t_function send_function(g_type_void,
                              service_name_lc + string("_client_send_") + funname,
                              (*f_iter)->get_arglist());
-    indent(f_header_) << function_signature(&send_function) << ";" << endl;
+    indent(f_header_) << function_signature(&send_function) << ";" << '\n';
 
     // implement recv if not a oneway service
     if (!(*f_iter)->is_oneway()) {
@@ -1436,19 +1434,19 @@
                                service_name_lc + string("_client_recv_") + funname,
                                &noargs,
                                (*f_iter)->get_xceptions());
-      indent(f_header_) << function_signature(&recv_function) << ";" << endl;
+      indent(f_header_) << function_signature(&recv_function) << ";" << '\n';
     }
   }
 
   /* write out the get/set function prototypes */
   f_header_ << "void " + service_name_lc + "_client_set_property (GObject *object, guint "
                                            "property_id, const GValue *value, GParamSpec *pspec);"
-            << endl;
+            << '\n';
   f_header_ << "void " + service_name_lc + "_client_get_property (GObject *object, guint "
                                            "property_id, GValue *value, GParamSpec *pspec);"
-            << endl;
+            << '\n';
 
-  f_header_ << endl;
+  f_header_ << '\n';
   // end of header code
 
   // Generate interface method implementations
@@ -1483,76 +1481,76 @@
       params_without_type += ", ";
     }
 
-    f_service_ << "gboolean" << endl << this->nspace_lc << service_name_lc << "_if_" << funname
-               << " " << params << endl << "{" << endl << "  return " << this->nspace_uc
+    f_service_ << "gboolean" << '\n' << this->nspace_lc << service_name_lc << "_if_" << funname
+               << " " << params << '\n' << "{" << '\n' << "  return " << this->nspace_uc
                << service_name_uc << "_IF_GET_INTERFACE (iface)->" << funname << " ("
-               << params_without_type << "error);" << endl << "}" << endl << endl;
+               << params_without_type << "error);" << '\n' << "}" << '\n' << '\n';
   }
 
   // Generate interface boilerplate
-  f_service_ << "GType" << endl << this->nspace_lc << service_name_lc << "_if_get_type (void)"
-             << endl << "{" << endl << "  static GType type = 0;" << endl << "  if (type == 0)"
-             << endl << "  {" << endl << "    static const GTypeInfo type_info =" << endl << "    {"
-             << endl << "      sizeof (" << this->nspace << service_name_ << "IfInterface)," << endl
-             << "      NULL,  /* base_init */" << endl << "      NULL,  /* base_finalize */" << endl
-             << "      NULL,  /* class_init */" << endl << "      NULL,  /* class_finalize */"
-             << endl << "      NULL,  /* class_data */" << endl
-             << "      0,     /* instance_size */" << endl << "      0,     /* n_preallocs */"
-             << endl << "      NULL,  /* instance_init */" << endl
-             << "      NULL   /* value_table */" << endl << "    };" << endl
-             << "    type = g_type_register_static (G_TYPE_INTERFACE," << endl
+  f_service_ << "GType" << '\n' << this->nspace_lc << service_name_lc << "_if_get_type (void)"
+             << '\n' << "{" << '\n' << "  static GType type = 0;" << '\n' << "  if (type == 0)"
+             << '\n' << "  {" << '\n' << "    static const GTypeInfo type_info =" << '\n' << "    {"
+             << '\n' << "      sizeof (" << this->nspace << service_name_ << "IfInterface)," << '\n'
+             << "      NULL,  /* base_init */" << '\n' << "      NULL,  /* base_finalize */" << '\n'
+             << "      NULL,  /* class_init */" << '\n' << "      NULL,  /* class_finalize */"
+             << '\n' << "      NULL,  /* class_data */" << '\n'
+             << "      0,     /* instance_size */" << '\n' << "      0,     /* n_preallocs */"
+             << '\n' << "      NULL,  /* instance_init */" << '\n'
+             << "      NULL   /* value_table */" << '\n' << "    };" << '\n'
+             << "    type = g_type_register_static (G_TYPE_INTERFACE," << '\n'
              << "                                   \"" << this->nspace << service_name_ << "If\","
-             << endl << "                                   &type_info, 0);" << endl << "  }"
-             << endl << "  return type;" << endl << "}" << endl << endl;
+             << '\n' << "                                   &type_info, 0);" << '\n' << "  }"
+             << '\n' << "  return type;" << '\n' << "}" << '\n' << '\n';
 
   // Generate client boilerplate
-  f_service_ << "static void " << endl << this->nspace_lc << service_name_lc
+  f_service_ << "static void " << '\n' << this->nspace_lc << service_name_lc
              << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface);"
-             << endl << endl << "G_DEFINE_TYPE_WITH_CODE (" << this->nspace << service_name_
-             << "Client, " << this->nspace_lc << service_name_lc << "_client," << endl
-             << "                         " << parent_type_name << ", " << endl
+             << '\n' << '\n' << "G_DEFINE_TYPE_WITH_CODE (" << this->nspace << service_name_
+             << "Client, " << this->nspace_lc << service_name_lc << "_client," << '\n'
+             << "                         " << parent_type_name << ", " << '\n'
              << "                         G_IMPLEMENT_INTERFACE (" << this->nspace_uc << "TYPE_"
-             << service_name_uc << "_IF," << endl
+             << service_name_uc << "_IF," << '\n'
              << "                                                " << this->nspace_lc
-             << service_name_lc << "_if_interface_init))" << endl << endl;
+             << service_name_lc << "_if_interface_init))" << '\n' << '\n';
 
   // Generate property-related code only for base services---child
   // service-client classes have only properties inherited from their
   // parent class
   if (!extends_service) {
     // Generate client properties
-    f_service_ << "enum _" << this->nspace << service_name_ << "ClientProperties" << endl << "{"
-               << endl << "  PROP_0," << endl << "  PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_INPUT_PROTOCOL," << endl << "  PROP_" << this->nspace_uc
-               << service_name_uc << "_CLIENT_OUTPUT_PROTOCOL" << endl << "};" << endl << endl;
+    f_service_ << "enum _" << this->nspace << service_name_ << "ClientProperties" << '\n' << "{"
+               << '\n' << "  PROP_0," << '\n' << "  PROP_" << this->nspace_uc << service_name_uc
+               << "_CLIENT_INPUT_PROTOCOL," << '\n' << "  PROP_" << this->nspace_uc
+               << service_name_uc << "_CLIENT_OUTPUT_PROTOCOL" << '\n' << "};" << '\n' << '\n';
 
     // generate property setter
-    f_service_ << "void" << endl << this->nspace_lc << service_name_lc << "_client_set_property ("
+    f_service_ << "void" << '\n' << this->nspace_lc << service_name_lc << "_client_set_property ("
                << "GObject *object, guint property_id, const GValue *value, "
-               << "GParamSpec *pspec)" << endl << "{" << endl << "  " << this->nspace
+               << "GParamSpec *pspec)" << '\n' << "{" << '\n' << "  " << this->nspace
                << service_name_ << "Client *client = " << this->nspace_uc << service_name_uc
-               << "_CLIENT (object);" << endl << endl << "  THRIFT_UNUSED_VAR (pspec);" << endl
-               << endl << "  switch (property_id)" << endl << "  {" << endl << "    case PROP_"
-               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << endl
-               << "      client->input_protocol = g_value_get_object (value);" << endl
-               << "      break;" << endl << "    case PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL:" << endl
-               << "      client->output_protocol = g_value_get_object (value);" << endl
-               << "      break;" << endl << "  }" << endl << "}" << endl << endl;
+               << "_CLIENT (object);" << '\n' << '\n' << "  THRIFT_UNUSED_VAR (pspec);" << '\n'
+               << '\n' << "  switch (property_id)" << '\n' << "  {" << '\n' << "    case PROP_"
+               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << '\n'
+               << "      client->input_protocol = g_value_get_object (value);" << '\n'
+               << "      break;" << '\n' << "    case PROP_" << this->nspace_uc << service_name_uc
+               << "_CLIENT_OUTPUT_PROTOCOL:" << '\n'
+               << "      client->output_protocol = g_value_get_object (value);" << '\n'
+               << "      break;" << '\n' << "  }" << '\n' << "}" << '\n' << '\n';
 
     // generate property getter
-    f_service_ << "void" << endl << this->nspace_lc << service_name_lc << "_client_get_property ("
+    f_service_ << "void" << '\n' << this->nspace_lc << service_name_lc << "_client_get_property ("
                << "GObject *object, guint property_id, GValue *value, "
-               << "GParamSpec *pspec)" << endl << "{" << endl << "  " << this->nspace
+               << "GParamSpec *pspec)" << '\n' << "{" << '\n' << "  " << this->nspace
                << service_name_ << "Client *client = " << this->nspace_uc << service_name_uc
-               << "_CLIENT (object);" << endl << endl << "  THRIFT_UNUSED_VAR (pspec);" << endl
-               << endl << "  switch (property_id)" << endl << "  {" << endl << "    case PROP_"
-               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << endl
-               << "      g_value_set_object (value, client->input_protocol);" << endl
-               << "      break;" << endl << "    case PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL:" << endl
-               << "      g_value_set_object (value, client->output_protocol);" << endl
-               << "      break;" << endl << "  }" << endl << "}" << endl << endl;
+               << "_CLIENT (object);" << '\n' << '\n' << "  THRIFT_UNUSED_VAR (pspec);" << '\n'
+               << '\n' << "  switch (property_id)" << '\n' << "  {" << '\n' << "    case PROP_"
+               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << '\n'
+               << "      g_value_set_object (value, client->input_protocol);" << '\n'
+               << "      break;" << '\n' << "    case PROP_" << this->nspace_uc << service_name_uc
+               << "_CLIENT_OUTPUT_PROTOCOL:" << '\n'
+               << "      g_value_set_object (value, client->output_protocol);" << '\n'
+               << "      break;" << '\n' << "  }" << '\n' << "}" << '\n' << '\n';
   }
 
   // Generate client method implementations
@@ -1569,31 +1567,31 @@
                              (*f_iter)->get_arglist());
 
     // Open the send function
-    indent(f_service_) << function_signature(&send_function) << endl;
+    indent(f_service_) << function_signature(&send_function) << '\n';
     scope_up(f_service_);
 
     string reqType = (*f_iter)->is_oneway() ? "T_ONEWAY" : "T_CALL";
 
     // Serialize the request
-    f_service_ << indent() << "gint32 cseqid = 0;" << endl << indent()
+    f_service_ << indent() << "gint32 cseqid = 0;" << '\n' << indent()
                << "ThriftProtocol * protocol = " << this->nspace_uc << base_service_name_uc
-               << "_CLIENT (iface)->output_protocol;" << endl << endl << indent()
+               << "_CLIENT (iface)->output_protocol;" << '\n' << '\n' << indent()
                << "if (thrift_protocol_write_message_begin (protocol, \"" << name << "\", "
-               << reqType << ", cseqid, error) < 0)" << endl << indent() << "  return FALSE;"
-               << endl << endl;
+               << reqType << ", cseqid, error) < 0)" << '\n' << indent() << "  return FALSE;"
+               << '\n' << '\n';
 
     generate_struct_writer(f_service_, arg_struct, "", "", false);
 
-    f_service_ << indent() << "if (thrift_protocol_write_message_end (protocol, error) < 0)" << endl
-               << indent() << "  return FALSE;" << endl << indent()
-               << "if (!thrift_transport_flush (protocol->transport, error))" << endl << indent()
-               << "  return FALSE;" << endl << indent()
-               << "if (!thrift_transport_write_end (protocol->transport, error))" << endl
-               << indent() << "  return FALSE;" << endl << endl << indent() << "return TRUE;"
-               << endl;
+    f_service_ << indent() << "if (thrift_protocol_write_message_end (protocol, error) < 0)" << '\n'
+               << indent() << "  return FALSE;" << '\n' << indent()
+               << "if (!thrift_transport_flush (protocol->transport, error))" << '\n' << indent()
+               << "  return FALSE;" << '\n' << indent()
+               << "if (!thrift_transport_write_end (protocol->transport, error))" << '\n'
+               << indent() << "  return FALSE;" << '\n' << '\n' << indent() << "return TRUE;"
+               << '\n';
 
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     // Generate recv function only if not an async function
     if (!(*f_iter)->is_oneway()) {
@@ -1603,78 +1601,78 @@
                                &noargs,
                                (*f_iter)->get_xceptions());
       // Open function
-      indent(f_service_) << function_signature(&recv_function) << endl;
+      indent(f_service_) << function_signature(&recv_function) << '\n';
       scope_up(f_service_);
 
-      f_service_ << indent() << "gint32 rseqid;" << endl
-                 << indent() << "gchar * fname = NULL;" << endl
-                 << indent() << "ThriftMessageType mtype;" << endl
+      f_service_ << indent() << "gint32 rseqid;" << '\n'
+                 << indent() << "gchar * fname = NULL;" << '\n'
+                 << indent() << "ThriftMessageType mtype;" << '\n'
                  << indent() << "ThriftProtocol * protocol = "
                  << this->nspace_uc << base_service_name_uc
-                 << "_CLIENT (iface)->input_protocol;" << endl
-                 << indent() << "ThriftApplicationException *xception;" << endl
-                 << endl
+                 << "_CLIENT (iface)->input_protocol;" << '\n'
+                 << indent() << "ThriftApplicationException *xception;" << '\n'
+                 << '\n'
                  << indent() << "if (thrift_protocol_read_message_begin "
-                    "(protocol, &fname, &mtype, &rseqid, error) < 0) {" << endl;
+                    "(protocol, &fname, &mtype, &rseqid, error) < 0) {" << '\n';
       indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "return FALSE;" << endl;
+      f_service_ << indent() << "if (fname) g_free (fname);" << '\n'
+                 << indent() << "return FALSE;" << '\n';
       indent_down();
-      f_service_ << indent() << "}" << endl
-                 << endl
-                 << indent() << "if (mtype == T_EXCEPTION) {" << endl;
+      f_service_ << indent() << "}" << '\n'
+                 << '\n'
+                 << indent() << "if (mtype == T_EXCEPTION) {" << '\n';
       indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
+      f_service_ << indent() << "if (fname) g_free (fname);" << '\n'
                  << indent() << "xception = g_object_new "
-                    "(THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);" << endl
+                    "(THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);" << '\n'
                  << indent() << "thrift_struct_read (THRIFT_STRUCT (xception), "
-                    "protocol, NULL);" << endl
+                    "protocol, NULL);" << '\n'
                  << indent() << "thrift_protocol_read_message_end "
-                    "(protocol, NULL);" << endl
+                    "(protocol, NULL);" << '\n'
                  << indent() << "thrift_transport_read_end "
-                    "(protocol->transport, NULL);" << endl
+                    "(protocol->transport, NULL);" << '\n'
                  << indent() << "g_set_error (error, "
                     "THRIFT_APPLICATION_EXCEPTION_ERROR,xception->type, "
-                    "\"application error: %s\", xception->message);" << endl
-                 << indent() << "g_object_unref (xception);" << endl
-                 << indent() << "return FALSE;" << endl;
+                    "\"application error: %s\", xception->message);" << '\n'
+                 << indent() << "g_object_unref (xception);" << '\n'
+                 << indent() << "return FALSE;" << '\n';
       indent_down();
-      f_service_ << indent() << "} else if (mtype != T_REPLY) {" << endl;
+      f_service_ << indent() << "} else if (mtype != T_REPLY) {" << '\n';
       indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
+      f_service_ << indent() << "if (fname) g_free (fname);" << '\n'
                  << indent() << "thrift_protocol_skip (protocol, T_STRUCT, "
-                    "NULL);" << endl
+                    "NULL);" << '\n'
                  << indent() << "thrift_protocol_read_message_end (protocol, "
-                    "NULL);" << endl
+                    "NULL);" << '\n'
                  << indent() << "thrift_transport_read_end ("
-                    "protocol->transport, NULL);" << endl
+                    "protocol->transport, NULL);" << '\n'
                  << indent() << "g_set_error (error, "
                     "THRIFT_APPLICATION_EXCEPTION_ERROR, "
                     "THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE, "
                     "\"invalid message type %d, expected T_REPLY\", mtype);"
-                 << endl
-                 << indent() << "return FALSE;" << endl;
+                 << '\n'
+                 << indent() << "return FALSE;" << '\n';
       indent_down();
       f_service_ << indent() << "} else if (strncmp (fname, \"" << name
-                 << "\", " << name.length() << ") != 0) {" << endl;
+                 << "\", " << name.length() << ") != 0) {" << '\n';
       indent_up();
       f_service_ << indent() << "thrift_protocol_skip (protocol, T_STRUCT, "
-                    "NULL);" << endl
+                    "NULL);" << '\n'
                  << indent() << "thrift_protocol_read_message_end (protocol,"
-                    "error);" << endl
+                    "error);" << '\n'
                  << indent() << "thrift_transport_read_end ("
-                    "protocol->transport, error);" << endl
+                    "protocol->transport, error);" << '\n'
                  << indent() << "g_set_error (error, "
                     "THRIFT_APPLICATION_EXCEPTION_ERROR, "
                     "THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME, "
                     "\"wrong method name %s, expected " << name
-                    << "\", fname);" << endl
-                 << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "return FALSE;" << endl;
+                    << "\", fname);" << '\n'
+                 << indent() << "if (fname) g_free (fname);" << '\n'
+                 << indent() << "return FALSE;" << '\n';
       indent_down();
-      f_service_ << indent() << "}" << endl
-                 << indent() << "if (fname) g_free (fname);" << endl
-                 << endl;
+      f_service_ << indent() << "}" << '\n'
+                 << indent() << "if (fname) g_free (fname);" << '\n'
+                 << '\n';
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
@@ -1699,25 +1697,25 @@
       }
 
       f_service_ << indent() << "if (thrift_protocol_read_message_end (protocol, error) < 0)"
-                 << endl << indent() << "  return FALSE;" << endl << endl << indent()
-                 << "if (!thrift_transport_read_end (protocol->transport, error))" << endl
-                 << indent() << "  return FALSE;" << endl << endl;
+                 << '\n' << indent() << "  return FALSE;" << '\n' << '\n' << indent()
+                 << "if (!thrift_transport_read_end (protocol->transport, error))" << '\n'
+                 << indent() << "  return FALSE;" << '\n' << '\n';
 
       // copy over any throw exceptions and return failure
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); x_iter++) {
-        f_service_ << indent() << "if (*" << (*x_iter)->get_name() << " != NULL)" << endl
-                   << indent() << "{" << endl << indent() << "    g_set_error (error, "
+        f_service_ << indent() << "if (*" << (*x_iter)->get_name() << " != NULL)" << '\n'
+                   << indent() << "{" << '\n' << indent() << "    g_set_error (error, "
                    << this->nspace_uc
                    << to_upper_case(initial_caps_to_underscores((*x_iter)->get_type()->get_name()))
                    << "_ERROR, " << this->nspace_uc
                    << to_upper_case(initial_caps_to_underscores((*x_iter)->get_type()->get_name()))
-                   << "_ERROR_CODE, \"" << (*x_iter)->get_type()->get_name() << "\");" << endl
-                   << indent() << "    return FALSE;" << endl << indent() << "}" << endl;
+                   << "_ERROR_CODE, \"" << (*x_iter)->get_type()->get_name() << "\");" << '\n'
+                   << indent() << "    return FALSE;" << '\n' << indent() << "}" << '\n';
       }
       // Close function
-      indent(f_service_) << "return TRUE;" << endl;
+      indent(f_service_) << "return TRUE;" << '\n';
       scope_down(f_service_);
-      f_service_ << endl;
+      f_service_ << '\n';
     }
 
     // Open function
@@ -1725,7 +1723,7 @@
                                 service_name_lc + string("_client_") + funname,
                                 (*f_iter)->get_arglist(),
                                 (*f_iter)->get_xceptions());
-    indent(f_service_) << function_signature(&service_function) << endl;
+    indent(f_service_) << function_signature(&service_function) << '\n';
     scope_up(f_service_);
 
     // wrap each function
@@ -1738,7 +1736,7 @@
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << ", " << (*fld_iter)->get_name();
     }
-    f_service_ << ", error))" << endl << indent() << "  return FALSE;" << endl;
+    f_service_ << ", error))" << '\n' << indent() << "  return FALSE;" << '\n';
 
     // if not oneway, implement recv
     if (!(*f_iter)->is_oneway()) {
@@ -1752,20 +1750,20 @@
       }
 
       f_service_ << indent() << "if (!" << this->nspace_lc << service_name_lc << "_client_recv_"
-                 << funname << " (iface, " << ret << "error))" << endl << indent()
-                 << "  return FALSE;" << endl;
+                 << funname << " (iface, " << ret << "error))" << '\n' << indent()
+                 << "  return FALSE;" << '\n';
     }
 
     // return TRUE which means all functions were called OK
-    indent(f_service_) << "return TRUE;" << endl;
+    indent(f_service_) << "return TRUE;" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   // create the interface initializer
-  f_service_ << "static void" << endl
+  f_service_ << "static void" << '\n'
              << this->nspace_lc << service_name_lc << "_if_interface_init ("
-             << this->nspace << service_name_ << "IfInterface *iface)" << endl;
+             << this->nspace << service_name_ << "IfInterface *iface)" << '\n';
   scope_up(f_service_);
   if (functions.size() > 0) {
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1773,62 +1771,62 @@
       string funname = initial_caps_to_underscores((*f_iter)->get_name());
 
       f_service_ << indent() << "iface->" << funname << " = " << this->nspace_lc
-                 << service_name_lc << "_client_" << funname << ";" << endl;
+                 << service_name_lc << "_client_" << funname << ";" << '\n';
     }
   }
   else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (iface);" << endl;
+    f_service_ << indent() << "THRIFT_UNUSED_VAR (iface);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // create the client instance initializer
-  f_service_ << "static void" << endl
+  f_service_ << "static void" << '\n'
              << this->nspace_lc << service_name_lc << "_client_init ("
-             << this->nspace << service_name_ << "Client *client)" << endl;
+             << this->nspace << service_name_ << "Client *client)" << '\n';
   scope_up(f_service_);
   if (!extends_service) {
-    f_service_ << indent() << "client->input_protocol = NULL;" << endl
-               << indent() << "client->output_protocol = NULL;" << endl;
+    f_service_ << indent() << "client->input_protocol = NULL;" << '\n'
+               << indent() << "client->output_protocol = NULL;" << '\n';
   }
   else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (client);" << endl;
+    f_service_ << indent() << "THRIFT_UNUSED_VAR (client);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // create the client class initializer
-  f_service_ << "static void" << endl << this->nspace_lc << service_name_lc
+  f_service_ << "static void" << '\n' << this->nspace_lc << service_name_lc
              << "_client_class_init (" << this->nspace << service_name_ << "ClientClass *cls)"
-             << endl << "{" << endl;
+             << '\n' << "{" << '\n';
   if (!extends_service) {
-    f_service_ << "  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << endl
-               << "  GParamSpec *param_spec;" << endl << endl
+    f_service_ << "  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << '\n'
+               << "  GParamSpec *param_spec;" << '\n' << '\n'
                << "  gobject_class->set_property = " << this->nspace_lc << service_name_lc
-               << "_client_set_property;" << endl
+               << "_client_set_property;" << '\n'
                << "  gobject_class->get_property = " << this->nspace_lc << service_name_lc
-               << "_client_get_property;" << endl << endl
-               << "  param_spec = g_param_spec_object (\"input_protocol\"," << endl
-               << "                                    \"input protocol (construct)\"," << endl
-               << "                                    \"Set the client input protocol\"," << endl
-               << "                                    THRIFT_TYPE_PROTOCOL," << endl
-               << "                                    G_PARAM_READWRITE);" << endl
-               << "  g_object_class_install_property (gobject_class," << endl
+               << "_client_get_property;" << '\n' << '\n'
+               << "  param_spec = g_param_spec_object (\"input_protocol\"," << '\n'
+               << "                                    \"input protocol (construct)\"," << '\n'
+               << "                                    \"Set the client input protocol\"," << '\n'
+               << "                                    THRIFT_TYPE_PROTOCOL," << '\n'
+               << "                                    G_PARAM_READWRITE);" << '\n'
+               << "  g_object_class_install_property (gobject_class," << '\n'
                << "                                   PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_INPUT_PROTOCOL, param_spec);" << endl << endl
-               << "  param_spec = g_param_spec_object (\"output_protocol\"," << endl
-               << "                                    \"output protocol (construct)\"," << endl
-               << "                                    \"Set the client output protocol\"," << endl
-               << "                                    THRIFT_TYPE_PROTOCOL," << endl
-               << "                                    G_PARAM_READWRITE);" << endl
-               << "  g_object_class_install_property (gobject_class," << endl
+               << "_CLIENT_INPUT_PROTOCOL, param_spec);" << '\n' << '\n'
+               << "  param_spec = g_param_spec_object (\"output_protocol\"," << '\n'
+               << "                                    \"output protocol (construct)\"," << '\n'
+               << "                                    \"Set the client output protocol\"," << '\n'
+               << "                                    THRIFT_TYPE_PROTOCOL," << '\n'
+               << "                                    G_PARAM_READWRITE);" << '\n'
+               << "  g_object_class_install_property (gobject_class," << '\n'
                << "                                   PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL, param_spec);" << endl;
+               << "_CLIENT_OUTPUT_PROTOCOL, param_spec);" << '\n';
   }
   else {
-    f_service_ << "  THRIFT_UNUSED_VAR (cls);" << endl;
+    f_service_ << "  THRIFT_UNUSED_VAR (cls);" << '\n';
   }
-  f_service_ << "}" << endl << endl;
+  f_service_ << "}" << '\n' << '\n';
 }
 
 /**
@@ -1874,19 +1872,19 @@
   // Generate the handler class' definition in the header file
 
   // Generate the handler instance definition
-  f_header_ << "/* " << service_name_ << " handler (abstract base class) */" << endl << "struct _"
-            << class_name << endl << "{" << endl;
+  f_header_ << "/* " << service_name_ << " handler (abstract base class) */" << '\n' << "struct _"
+            << class_name << '\n' << "{" << '\n';
   indent_up();
-  f_header_ << indent() << parent_class_name << " parent;" << endl;
+  f_header_ << indent() << parent_class_name << " parent;" << '\n';
   indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << " " << class_name << ";" << endl
-            << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << class_name << " " << class_name << ";" << '\n'
+            << '\n';
 
   // Generate the handler class definition, including its class members
   // (methods)
-  f_header_ << "struct _" << class_name << "Class" << endl << "{" << endl;
+  f_header_ << "struct _" << class_name << "Class" << '\n' << "{" << '\n';
   indent_up();
-  f_header_ << indent() << parent_class_name << "Class parent;" << endl << endl;
+  f_header_ << indent() << parent_class_name << "Class parent;" << '\n' << '\n';
 
   for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
     string method_name = initial_caps_to_underscores((*function_iter)->get_name());
@@ -1902,31 +1900,31 @@
                     + (has_args ? "" : (", " + argument_list(arg_list)))
                     + (has_xceptions ? "" : (", " + xception_list(x_list))) + ", GError **error)";
 
-    indent(f_header_) << "gboolean (*" << method_name << ") " << params << ";" << endl;
+    indent(f_header_) << "gboolean (*" << method_name << ") " << params << ";" << '\n';
   }
   indent_down();
 
-  f_header_ << "};" << endl << "typedef struct _" << class_name << "Class " << class_name
-            << "Class;" << endl << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << class_name << "Class " << class_name
+            << "Class;" << '\n' << '\n';
 
   // Generate the remaining header boilerplate
-  f_header_ << "GType " << class_name_lc << "_get_type (void);" << endl << "#define "
+  f_header_ << "GType " << class_name_lc << "_get_type (void);" << '\n' << "#define "
             << this->nspace_uc << "TYPE_" << service_name_uc << "_HANDLER "
-            << "(" << class_name_lc << "_get_type())" << endl << "#define " << class_name_uc
+            << "(" << class_name_lc << "_get_type())" << '\n' << "#define " << class_name_uc
             << "(obj) "
             << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "))" << endl << "#define "
+            << service_name_uc << "_HANDLER, " << class_name << "))" << '\n' << "#define "
             << this->nspace_uc << "IS_" << service_name_uc << "_HANDLER(obj) "
             << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER))" << endl << "#define " << class_name_uc
+            << service_name_uc << "_HANDLER))" << '\n' << "#define " << class_name_uc
             << "_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "Class))" << endl << "#define "
+            << service_name_uc << "_HANDLER, " << class_name << "Class))" << '\n' << "#define "
             << this->nspace_uc << "IS_" << service_name_uc << "_HANDLER_CLASS(c) "
             << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_HANDLER))" << endl << "#define " << this->nspace_uc << service_name_uc
+            << "_HANDLER))" << '\n' << "#define " << this->nspace_uc << service_name_uc
             << "_HANDLER_GET_CLASS(obj) "
             << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "Class))" << endl << endl;
+            << service_name_uc << "_HANDLER, " << class_name << "Class))" << '\n' << '\n';
 
   // Generate the handler class' method definitions
   for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
@@ -1943,25 +1941,25 @@
                     + (has_args ? "" : (", " + argument_list(arg_list)))
                     + (has_xceptions ? "" : (", " + xception_list(x_list))) + ", GError **error)";
 
-    f_header_ << "gboolean " << class_name_lc << "_" << method_name << " " << params << ";" << endl;
+    f_header_ << "gboolean " << class_name_lc << "_" << method_name << " " << params << ";" << '\n';
   }
-  f_header_ << endl;
+  f_header_ << '\n';
 
   // Generate the handler's implementation in the implementation file
 
   // Generate the implementation boilerplate
-  f_service_ << "static void" << endl << class_name_lc << "_" << service_name_lc
+  f_service_ << "static void" << '\n' << class_name_lc << "_" << service_name_lc
              << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface);"
-             << endl << endl;
+             << '\n' << '\n';
 
   args_indent = string(25, ' ');
-  f_service_ << "G_DEFINE_TYPE_WITH_CODE (" << class_name << ", " << endl << args_indent
-             << class_name_lc << "," << endl << args_indent << parent_type_name << "," << endl
+  f_service_ << "G_DEFINE_TYPE_WITH_CODE (" << class_name << ", " << '\n' << args_indent
+             << class_name_lc << "," << '\n' << args_indent << parent_type_name << "," << '\n'
              << args_indent << "G_IMPLEMENT_INTERFACE (" << this->nspace_uc << "TYPE_"
-             << service_name_uc << "_IF," << endl;
+             << service_name_uc << "_IF," << '\n';
   args_indent += string(23, ' ');
   f_service_ << args_indent << class_name_lc << "_" << service_name_lc << "_if_interface_init))"
-             << endl << endl;
+             << '\n' << '\n';
 
   // Generate the handler method implementations
   for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
@@ -1982,10 +1980,10 @@
                                      x_list,
                                      (*function_iter)->is_oneway());
 
-    indent(f_service_) << function_signature(&implementing_function) << endl;
+    indent(f_service_) << function_signature(&implementing_function) << '\n';
     scope_up(f_service_);
     f_service_ << indent() << "g_return_val_if_fail (" << this->nspace_uc << "IS_"
-               << service_name_uc << "_HANDLER (iface), FALSE);" << endl << endl << indent()
+               << service_name_uc << "_HANDLER (iface), FALSE);" << '\n' << '\n' << indent()
                << "return " << class_name_uc << "_GET_CLASS (iface)"
                << "->" << method_name << " (iface, ";
 
@@ -1998,42 +1996,42 @@
     for (field_iter = xceptions.begin(); field_iter != xceptions.end(); ++field_iter) {
       f_service_ << (*field_iter)->get_name() << ", ";
     }
-    f_service_ << "error);" << endl;
+    f_service_ << "error);" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   // Generate the handler interface initializer
-  f_service_ << "static void" << endl << class_name_lc << "_" << service_name_lc
+  f_service_ << "static void" << '\n' << class_name_lc << "_" << service_name_lc
              << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface)"
-             << endl;
+             << '\n';
   scope_up(f_service_);
   if (functions.size() > 0) {
     for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
       string method_name = initial_caps_to_underscores((*function_iter)->get_name());
 
       f_service_ << indent() << "iface->" << method_name << " = " << class_name_lc << "_"
-                 << method_name << ";" << endl;
+                 << method_name << ";" << '\n';
     }
   }
   else {
-    f_service_ << "THRIFT_UNUSED_VAR (iface);" << endl;
+    f_service_ << "THRIFT_UNUSED_VAR (iface);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the handler instance initializer
-  f_service_ << "static void" << endl << class_name_lc << "_init (" << class_name << " *self)"
-             << endl;
+  f_service_ << "static void" << '\n' << class_name_lc << "_init (" << class_name << " *self)"
+             << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << "THRIFT_UNUSED_VAR (self);" << endl;
+  f_service_ << indent() << "THRIFT_UNUSED_VAR (self);" << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the handler class initializer
-  f_service_ << "static void" << endl
+  f_service_ << "static void" << '\n'
              << class_name_lc << "_class_init (" << class_name << "Class *cls)"
-             << endl;
+             << '\n';
   scope_up(f_service_);
   if (functions.size() > 0) {
     for (function_iter = functions.begin();
@@ -2043,14 +2041,14 @@
       string method_name = initial_caps_to_underscores(function_name);
 
       // All methods are pure virtual and must be implemented by subclasses
-      f_service_ << indent() << "cls->" << method_name << " = NULL;" << endl;
+      f_service_ << indent() << "cls->" << method_name << " = NULL;" << '\n';
     }
   }
   else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (cls);" << endl;
+    f_service_ << indent() << "THRIFT_UNUSED_VAR (cls);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 }
 
 /**
@@ -2104,84 +2102,84 @@
   // Generate the processor class' definition in the header file
 
   // Generate the processor instance definition
-  f_header_ << "/* " << service_name_ << " processor */" << endl << "struct _" << class_name << endl
-            << "{" << endl;
+  f_header_ << "/* " << service_name_ << " processor */" << '\n' << "struct _" << class_name << '\n'
+            << "{" << '\n';
   indent_up();
-  f_header_ << indent() << parent_class_name << " parent;" << endl << endl << indent()
-            << "/* protected */" << endl << indent()
-            << this->nspace + service_name_ + "Handler *handler;" << endl << indent()
-            << "GHashTable *process_map;" << endl;
+  f_header_ << indent() << parent_class_name << " parent;" << '\n' << '\n' << indent()
+            << "/* protected */" << '\n' << indent()
+            << this->nspace + service_name_ + "Handler *handler;" << '\n' << indent()
+            << "GHashTable *process_map;" << '\n';
   indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << " " << class_name << ";" << endl
-            << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << class_name << " " << class_name << ";" << '\n'
+            << '\n';
 
   // Generate the processor class definition
-  f_header_ << "struct _" << class_name << "Class" << endl << "{" << endl;
+  f_header_ << "struct _" << class_name << "Class" << '\n' << "{" << '\n';
   indent_up();
-  f_header_ << indent() << parent_class_name << "Class parent;" << endl << endl << indent()
-            << "/* protected */" << endl << indent()
-            << "gboolean (*dispatch_call) (ThriftDispatchProcessor *processor," << endl;
+  f_header_ << indent() << parent_class_name << "Class parent;" << '\n' << '\n' << indent()
+            << "/* protected */" << '\n' << indent()
+            << "gboolean (*dispatch_call) (ThriftDispatchProcessor *processor," << '\n';
   args_indent = indent() + string(27, ' ');
-  f_header_ << args_indent << "ThriftProtocol *in," << endl << args_indent << "ThriftProtocol *out,"
-            << endl << args_indent << "gchar *fname," << endl << args_indent << "gint32 seqid,"
-            << endl << args_indent << "GError **error);" << endl;
+  f_header_ << args_indent << "ThriftProtocol *in," << '\n' << args_indent << "ThriftProtocol *out,"
+            << '\n' << args_indent << "gchar *fname," << '\n' << args_indent << "gint32 seqid,"
+            << '\n' << args_indent << "GError **error);" << '\n';
   indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << "Class " << class_name
-            << "Class;" << endl << endl;
+  f_header_ << "};" << '\n' << "typedef struct _" << class_name << "Class " << class_name
+            << "Class;" << '\n' << '\n';
 
   // Generate the remaining header boilerplate
-  f_header_ << "GType " << class_name_lc << "_get_type (void);" << endl << "#define "
+  f_header_ << "GType " << class_name_lc << "_get_type (void);" << '\n' << "#define "
             << this->nspace_uc << "TYPE_" << service_name_uc << "_PROCESSOR "
-            << "(" << class_name_lc << "_get_type())" << endl << "#define " << class_name_uc
+            << "(" << class_name_lc << "_get_type())" << '\n' << "#define " << class_name_uc
             << "(obj) "
             << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR, " << class_name << "))" << endl << "#define "
+            << service_name_uc << "_PROCESSOR, " << class_name << "))" << '\n' << "#define "
             << this->nspace_uc << "IS_" << service_name_uc << "_PROCESSOR(obj) "
             << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR))" << endl << "#define " << class_name_uc
+            << service_name_uc << "_PROCESSOR))" << '\n' << "#define " << class_name_uc
             << "_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR, " << class_name << "Class))" << endl << "#define "
+            << service_name_uc << "_PROCESSOR, " << class_name << "Class))" << '\n' << "#define "
             << this->nspace_uc << "IS_" << service_name_uc << "_PROCESSOR_CLASS(c) "
             << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_PROCESSOR))" << endl << "#define " << this->nspace_uc << service_name_uc
+            << "_PROCESSOR))" << '\n' << "#define " << this->nspace_uc << service_name_uc
             << "_PROCESSOR_GET_CLASS(obj) "
             << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR, " << class_name << "Class))" << endl << endl;
+            << service_name_uc << "_PROCESSOR, " << class_name << "Class))" << '\n' << '\n';
 
   // Generate the processor's implementation in the implementation file
 
   // Generate the processor's properties enum
-  f_service_ << "enum _" << class_name << "Properties" << endl << "{" << endl;
+  f_service_ << "enum _" << class_name << "Properties" << '\n' << "{" << '\n';
   indent_up();
-  f_service_ << indent() << "PROP_" << class_name_uc << "_0," << endl << indent() << "PROP_"
-             << class_name_uc << "_HANDLER" << endl;
+  f_service_ << indent() << "PROP_" << class_name_uc << "_0," << '\n' << indent() << "PROP_"
+             << class_name_uc << "_HANDLER" << '\n';
   indent_down();
-  f_service_ << "};" << endl << endl;
+  f_service_ << "};" << '\n' << '\n';
 
   // Generate the implementation boilerplate
   args_indent = string(15, ' ');
-  f_service_ << "G_DEFINE_TYPE (" << class_name << "," << endl << args_indent << class_name_lc
-             << "," << endl << args_indent << parent_type_name << ")" << endl << endl;
+  f_service_ << "G_DEFINE_TYPE (" << class_name << "," << '\n' << args_indent << class_name_lc
+             << "," << '\n' << args_indent << parent_type_name << ")" << '\n' << '\n';
 
   // Generate the processor's processing-function type
   args_indent = string(process_function_type_name.length() + 23, ' ');
   f_service_ << "typedef gboolean (* " << process_function_type_name << ") ("
-             << class_name << " *, " << endl
-             << args_indent << "gint32," << endl
-             << args_indent << "ThriftProtocol *," << endl
-             << args_indent << "ThriftProtocol *," << endl
-             << args_indent << "GError **);" << endl
-             << endl;
+             << class_name << " *, " << '\n'
+             << args_indent << "gint32," << '\n'
+             << args_indent << "ThriftProtocol *," << '\n'
+             << args_indent << "ThriftProtocol *," << '\n'
+             << args_indent << "GError **);" << '\n'
+             << '\n';
 
   // Generate the processor's processing-function-definition type
-  f_service_ << "typedef struct" << endl
-             << "{" << endl;
+  f_service_ << "typedef struct" << '\n'
+             << "{" << '\n';
   indent_up();
-  f_service_ << indent() << "gchar *name;" << endl
-             << indent() << process_function_type_name << " function;" << endl;
+  f_service_ << indent() << "gchar *name;" << '\n'
+             << indent() << process_function_type_name << " function;" << '\n';
   indent_down();
-  f_service_ << "} " << process_function_def_type_name << ";" << endl
-             << endl;
+  f_service_ << "} " << process_function_def_type_name << ";" << '\n'
+             << '\n';
 
   // Generate forward declarations of the processor's processing functions so we
   // can refer to them in the processing-function-definition struct below and
@@ -2193,23 +2191,23 @@
       + initial_caps_to_underscores((*function_iter)->get_name());
 
     args_indent = string(function_name.length() + 2, ' ');
-    f_service_ << "static gboolean" << endl
+    f_service_ << "static gboolean" << '\n'
                << function_name << " ("
-               << class_name << " *," << endl
-               << args_indent << "gint32," << endl
-               << args_indent << "ThriftProtocol *," << endl
-               << args_indent << "ThriftProtocol *," << endl
-               << args_indent << "GError **);" << endl;
+               << class_name << " *," << '\n'
+               << args_indent << "gint32," << '\n'
+               << args_indent << "ThriftProtocol *," << '\n'
+               << args_indent << "ThriftProtocol *," << '\n'
+               << args_indent << "GError **);" << '\n';
   }
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the processor's processing-function definitions, if the service
   // defines any methods
   if (functions.size() > 0) {
     f_service_ << indent() << "static " << process_function_def_type_name
-               << endl
+               << '\n'
                << indent() << class_name_lc << "_process_function_defs["
-               << functions.size() << "] = {" << endl;
+               << functions.size() << "] = {" << '\n';
     indent_up();
     for (function_iter = functions.begin();
          function_iter != functions.end();
@@ -2218,17 +2216,17 @@
       string process_function_name = class_name_lc + "_process_"
         + initial_caps_to_underscores(service_function_name);
 
-      f_service_ << indent() << "{" << endl;
+      f_service_ << indent() << "{" << '\n';
       indent_up();
-      f_service_ << indent() << "\"" << service_function_name << "\"," << endl
-                 << indent() << process_function_name << endl;
+      f_service_ << indent() << "\"" << service_function_name << "\"," << '\n'
+                 << indent() << process_function_name << '\n';
       indent_down();
       f_service_ << indent() << "}"
-                 << (function_iter == --functions.end() ? "" : ",") << endl;
+                 << (function_iter == --functions.end() ? "" : ",") << '\n';
     }
     indent_down();
-    f_service_ << indent() << "};" << endl
-               << endl;
+    f_service_ << indent() << "};" << '\n'
+               << '\n';
   }
 
   // Generate the processor's processing functions
@@ -2262,76 +2260,76 @@
                     + initial_caps_to_underscores(service_function_name);
 
     args_indent = string(function_name.length() + 2, ' ');
-    f_service_ << "static gboolean" << endl << function_name << " (" << class_name << " *self,"
-               << endl << args_indent << "gint32 sequence_id," << endl << args_indent
-               << "ThriftProtocol *input_protocol," << endl << args_indent
-               << "ThriftProtocol *output_protocol," << endl << args_indent << "GError **error)"
-               << endl;
+    f_service_ << "static gboolean" << '\n' << function_name << " (" << class_name << " *self,"
+               << '\n' << args_indent << "gint32 sequence_id," << '\n' << args_indent
+               << "ThriftProtocol *input_protocol," << '\n' << args_indent
+               << "ThriftProtocol *output_protocol," << '\n' << args_indent << "GError **error)"
+               << '\n';
     scope_up(f_service_);
-    f_service_ << indent() << "gboolean result = TRUE;" << endl
-               << indent() << "ThriftTransport * transport;" << endl
-               << indent() << "ThriftApplicationException *xception;" << endl
-               << indent() << args_class_name + " * args =" << endl;
+    f_service_ << indent() << "gboolean result = TRUE;" << '\n'
+               << indent() << "ThriftTransport * transport;" << '\n'
+               << indent() << "ThriftApplicationException *xception;" << '\n'
+               << indent() << args_class_name + " * args =" << '\n';
     indent_up();
-    f_service_ << indent() << "g_object_new (" << args_class_type << ", NULL);" << endl << endl;
+    f_service_ << indent() << "g_object_new (" << args_class_type << ", NULL);" << '\n' << '\n';
     indent_down();
     if ((*function_iter)->is_oneway()) {
-      f_service_ << indent() << "THRIFT_UNUSED_VAR (sequence_id);" << endl << indent()
-                 << "THRIFT_UNUSED_VAR (output_protocol);" << endl << endl;
+      f_service_ << indent() << "THRIFT_UNUSED_VAR (sequence_id);" << '\n' << indent()
+                 << "THRIFT_UNUSED_VAR (output_protocol);" << '\n' << '\n';
     }
     f_service_ << indent() << "g_object_get (input_protocol, \"transport\", "
-               << "&transport, NULL);" << endl << endl;
+               << "&transport, NULL);" << '\n' << '\n';
 
     // Read the method's arguments from the caller
     f_service_ << indent() << "if ((thrift_struct_read (THRIFT_STRUCT (args), "
-               << "input_protocol, error) != -1) &&" << endl << indent()
+               << "input_protocol, error) != -1) &&" << '\n' << indent()
                << "    (thrift_protocol_read_message_end (input_protocol, "
-               << "error) != -1) &&" << endl << indent()
-               << "    (thrift_transport_read_end (transport, error) != FALSE))" << endl;
+               << "error) != -1) &&" << '\n' << indent()
+               << "    (thrift_transport_read_end (transport, error) != FALSE))" << '\n';
     scope_up(f_service_);
 
     for (arg_iter = args.begin(); arg_iter != args.end(); ++arg_iter) {
       f_service_ << indent() << property_type_name((*arg_iter)->get_type()) << " "
-                 << (*arg_iter)->get_name() << ";" << endl;
+                 << (*arg_iter)->get_name() << ";" << '\n';
     }
     for (xception_iter = xceptions.begin(); xception_iter != xceptions.end(); ++xception_iter) {
       f_service_ << indent() << type_name((*xception_iter)->get_type()) << " "
-                 << initial_caps_to_underscores((*xception_iter)->get_name()) << " = NULL;" << endl;
+                 << initial_caps_to_underscores((*xception_iter)->get_name()) << " = NULL;" << '\n';
     }
     if (has_return_value) {
-      f_service_ << indent() << property_type_name(return_type) << " return_value;" << endl;
+      f_service_ << indent() << property_type_name(return_type) << " return_value;" << '\n';
     }
     if (!(*function_iter)->is_oneway()) {
-      f_service_ << indent() << result_class_name << " * result_struct;" << endl;
+      f_service_ << indent() << result_class_name << " * result_struct;" << '\n';
     }
-    f_service_ << endl;
+    f_service_ << '\n';
 
     if (args.size() > 0) {
-      f_service_ << indent() << "g_object_get (args," << endl;
+      f_service_ << indent() << "g_object_get (args," << '\n';
       args_indent = indent() + string(14, ' ');
       for (arg_iter = args.begin(); arg_iter != args.end(); ++arg_iter) {
         string arg_name = (*arg_iter)->get_name();
 
-        f_service_ << args_indent << "\"" << arg_name << "\", &" << arg_name << "," << endl;
+        f_service_ << args_indent << "\"" << arg_name << "\", &" << arg_name << "," << '\n';
       }
-      f_service_ << args_indent << "NULL);" << endl << endl;
+      f_service_ << args_indent << "NULL);" << '\n' << '\n';
     }
 
     if (!(*function_iter)->is_oneway()) {
-      f_service_ << indent() << "g_object_unref (transport);" << endl << indent()
+      f_service_ << indent() << "g_object_unref (transport);" << '\n' << indent()
                  << "g_object_get (output_protocol, \"transport\", "
-                 << "&transport, NULL);" << endl << endl << indent()
-                 << "result_struct = g_object_new (" << result_class_type << ", NULL);" << endl;
+                 << "&transport, NULL);" << '\n' << '\n' << indent()
+                 << "result_struct = g_object_new (" << result_class_type << ", NULL);" << '\n';
       if (has_return_value) {
         f_service_ << indent() << "g_object_get (result_struct, "
-                                  "\"success\", &return_value, NULL);" << endl;
+                                  "\"success\", &return_value, NULL);" << '\n';
       }
-      f_service_ << endl;
+      f_service_ << '\n';
     }
 
     // Pass the arguments to the corresponding method in the handler
     f_service_ << indent() << "if (" << handler_function_name << " (" << this->nspace_uc
-               << service_name_uc << "_IF (self->handler)," << endl;
+               << service_name_uc << "_IF (self->handler)," << '\n';
     args_indent = indent() + string(handler_function_name.length() + 6, ' ');
     if (has_return_value) {
       string return_type_name = type_name(return_type);
@@ -2351,16 +2349,16 @@
         f_service_ << "(" << return_type_name << ")";
       }
 
-      f_service_ << "&return_value," << endl;
+      f_service_ << "&return_value," << '\n';
     }
     for (arg_iter = args.begin(); arg_iter != args.end(); ++arg_iter) {
-      f_service_ << args_indent << (*arg_iter)->get_name() << "," << endl;
+      f_service_ << args_indent << (*arg_iter)->get_name() << "," << '\n';
     }
     for (xception_iter = xceptions.begin(); xception_iter != xceptions.end(); ++xception_iter) {
       f_service_ << args_indent << "&" << initial_caps_to_underscores((*xception_iter)->get_name())
-                 << "," << endl;
+                 << "," << '\n';
     }
-    f_service_ << args_indent << "error) == TRUE)" << endl;
+    f_service_ << args_indent << "error) == TRUE)" << '\n';
     scope_up(f_service_);
 
     // The handler reported success; return the result, if any, to the caller
@@ -2373,24 +2371,24 @@
                      << "(" << type_name(return_type) << ")";
         }
         f_service_ << "return_value, "
-                   << "NULL);" << endl;
-        f_service_ << endl;
+                   << "NULL);" << '\n';
+        f_service_ << '\n';
       }
-      f_service_ << indent() << "result =" << endl;
+      f_service_ << indent() << "result =" << '\n';
       indent_up();
-      f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << endl;
+      f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << '\n';
       args_indent = indent() + string(39, ' ');
-      f_service_ << args_indent << "\"" << service_function_name << "\"," << endl << args_indent
-                 << "T_REPLY," << endl << args_indent << "sequence_id," << endl << args_indent
-                 << "error) != -1) &&" << endl << indent()
-                 << " (thrift_struct_write (THRIFT_STRUCT (result_struct)," << endl;
+      f_service_ << args_indent << "\"" << service_function_name << "\"," << '\n' << args_indent
+                 << "T_REPLY," << '\n' << args_indent << "sequence_id," << '\n' << args_indent
+                 << "error) != -1) &&" << '\n' << indent()
+                 << " (thrift_struct_write (THRIFT_STRUCT (result_struct)," << '\n';
       args_indent = indent() + string(23, ' ');
-      f_service_ << args_indent << "output_protocol," << endl << args_indent << "error) != -1));"
-                 << endl;
+      f_service_ << args_indent << "output_protocol," << '\n' << args_indent << "error) != -1));"
+                 << '\n';
       indent_down();
     }
     scope_down(f_service_);
-    f_service_ << indent() << "else" << endl;
+    f_service_ << indent() << "else" << '\n';
     scope_up(f_service_);
 
     // The handler reported failure; check to see if an application-defined
@@ -2399,28 +2397,28 @@
     if (xceptions.size() > 0) {
       for (xception_iter = xceptions.begin(); xception_iter != xceptions.end(); ++xception_iter) {
         f_service_ << "if (" << initial_caps_to_underscores((*xception_iter)->get_name())
-                   << " != NULL)" << endl;
+                   << " != NULL)" << '\n';
         scope_up(f_service_);
-        f_service_ << indent() << "g_object_set (result_struct," << endl;
+        f_service_ << indent() << "g_object_set (result_struct," << '\n';
         args_indent = indent() + string(14, ' ');
         f_service_ << args_indent << "\"" << (*xception_iter)->get_name() << "\", "
-                   << (*xception_iter)->get_name() << "," << endl << args_indent << "NULL);" << endl
-                   << endl;
-        f_service_ << indent() << "g_object_unref ("<< (*xception_iter)->get_name() <<");"<< endl;
-        f_service_ << indent() << "result =" << endl;
+                   << (*xception_iter)->get_name() << "," << '\n' << args_indent << "NULL);" << '\n'
+                   << '\n';
+        f_service_ << indent() << "g_object_unref ("<< (*xception_iter)->get_name() <<");"<< '\n';
+        f_service_ << indent() << "result =" << '\n';
         indent_up();
-        f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << endl;
+        f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << '\n';
         args_indent = indent() + string(39, ' ');
-        f_service_ << args_indent << "\"" << service_function_name << "\"," << endl << args_indent
-                   << "T_REPLY," << endl << args_indent << "sequence_id," << endl << args_indent
-                   << "error) != -1) &&" << endl << indent()
-                   << " (thrift_struct_write (THRIFT_STRUCT (result_struct)," << endl;
+        f_service_ << args_indent << "\"" << service_function_name << "\"," << '\n' << args_indent
+                   << "T_REPLY," << '\n' << args_indent << "sequence_id," << '\n' << args_indent
+                   << "error) != -1) &&" << '\n' << indent()
+                   << " (thrift_struct_write (THRIFT_STRUCT (result_struct)," << '\n';
         args_indent = indent() + string(23, ' ');
-        f_service_ << args_indent << "output_protocol," << endl << args_indent << "error) != -1));"
-                   << endl;
+        f_service_ << args_indent << "output_protocol," << '\n' << args_indent << "error) != -1));"
+                   << '\n';
         indent_down();
         scope_down(f_service_);
-        f_service_ << indent() << "else" << endl;
+        f_service_ << indent() << "else" << '\n';
       }
 
       scope_up(f_service_);
@@ -2430,41 +2428,41 @@
     // If the handler reported failure but raised no application-defined
     // exception, return a Thrift application exception with the information
     // returned via GLib's own error-reporting mechanism
-    f_service_ << "if (*error == NULL)" << endl;
+    f_service_ << "if (*error == NULL)" << '\n';
     indent_up();
     f_service_ << indent() << "g_warning (\"" << service_name_ << "."
-               << (*function_iter)->get_name() << " implementation returned FALSE \"" << endl
-               << indent() << string(11, ' ') << "\"but did not set an error\");" << endl << endl;
+               << (*function_iter)->get_name() << " implementation returned FALSE \"" << '\n'
+               << indent() << string(11, ' ') << "\"but did not set an error\");" << '\n' << '\n';
     indent_down();
-    f_service_ << indent() << "xception =" << endl;
+    f_service_ << indent() << "xception =" << '\n';
     indent_up();
-    f_service_ << indent() << "g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION," << endl;
+    f_service_ << indent() << "g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION," << '\n';
     args_indent = indent() + string(14, ' ');
-    f_service_ << args_indent << "\"type\",    *error != NULL ? (*error)->code :" << endl
+    f_service_ << args_indent << "\"type\",    *error != NULL ? (*error)->code :" << '\n'
                << args_indent << string(11, ' ') << "THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN,"
-               << endl << args_indent << "\"message\", *error != NULL ? (*error)->message : NULL,"
-               << endl << args_indent << "NULL);" << endl;
+               << '\n' << args_indent << "\"message\", *error != NULL ? (*error)->message : NULL,"
+               << '\n' << args_indent << "NULL);" << '\n';
     indent_down();
-    f_service_ << indent() << "g_clear_error (error);" << endl << endl << indent()
-               << "result =" << endl;
+    f_service_ << indent() << "g_clear_error (error);" << '\n' << '\n' << indent()
+               << "result =" << '\n';
     indent_up();
-    f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << endl;
+    f_service_ << indent() << "((thrift_protocol_write_message_begin (output_protocol," << '\n';
     args_indent = indent() + string(39, ' ');
-    f_service_ << args_indent << "\"" << service_function_name << "\"," << endl << args_indent
-               << "T_EXCEPTION," << endl << args_indent << "sequence_id," << endl << args_indent
-               << "error) != -1) &&" << endl << indent()
-               << " (thrift_struct_write (THRIFT_STRUCT (xception)," << endl;
+    f_service_ << args_indent << "\"" << service_function_name << "\"," << '\n' << args_indent
+               << "T_EXCEPTION," << '\n' << args_indent << "sequence_id," << '\n' << args_indent
+               << "error) != -1) &&" << '\n' << indent()
+               << " (thrift_struct_write (THRIFT_STRUCT (xception)," << '\n';
     args_indent = indent() + string(23, ' ');
-    f_service_ << args_indent << "output_protocol," << endl << args_indent << "error) != -1));"
-               << endl;
+    f_service_ << args_indent << "output_protocol," << '\n' << args_indent << "error) != -1));"
+               << '\n';
     indent_down();
-    f_service_ << endl << indent() << "g_object_unref (xception);" << endl;
+    f_service_ << '\n' << indent() << "g_object_unref (xception);" << '\n';
 
     if (xceptions.size() > 0) {
       scope_down(f_service_);
     }
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     // Dellocate or unref retrieved argument values as necessary
     for (arg_iter = args.begin(); arg_iter != args.end(); ++arg_iter) {
@@ -2475,17 +2473,17 @@
         t_base_type* base_type = ((t_base_type*)arg_type);
 
         if (base_type->get_base() == t_base_type::TYPE_STRING) {
-          f_service_ << indent() << "if (" << arg_name << " != NULL)" << endl;
+          f_service_ << indent() << "if (" << arg_name << " != NULL)" << '\n';
           indent_up();
           if (base_type->is_binary()) {
-            f_service_ << indent() << "g_byte_array_unref (" << arg_name << ");" << endl;
+            f_service_ << indent() << "g_byte_array_unref (" << arg_name << ");" << '\n';
           } else {
-            f_service_ << indent() << "g_free (" << arg_name << ");" << endl;
+            f_service_ << indent() << "g_free (" << arg_name << ");" << '\n';
           }
           indent_down();
         }
       } else if (arg_type->is_container()) {
-        f_service_ << indent() << "if (" << arg_name << " != NULL)" << endl;
+        f_service_ << indent() << "if (" << arg_name << " != NULL)" << '\n';
         indent_up();
 
         if (arg_type->is_list()) {
@@ -2497,16 +2495,16 @@
           } else {
             f_service_ << "g_ptr_array_unref";
           }
-          f_service_ << " (" << arg_name << ");" << endl;
+          f_service_ << " (" << arg_name << ");" << '\n';
         } else if (arg_type->is_map() || arg_type->is_set()) {
-          f_service_ << indent() << "g_hash_table_unref (" << arg_name << ");" << endl;
+          f_service_ << indent() << "g_hash_table_unref (" << arg_name << ");" << '\n';
         }
 
         indent_down();
       } else if (arg_type->is_struct()) {
-        f_service_ << indent() << "if (" << arg_name << " != NULL)" << endl;
+        f_service_ << indent() << "if (" << arg_name << " != NULL)" << '\n';
         indent_up();
-        f_service_ << indent() << "g_object_unref (" << arg_name << ");" << endl;
+        f_service_ << indent() << "g_object_unref (" << arg_name << ");" << '\n';
         indent_down();
       }
     }
@@ -2518,17 +2516,17 @@
         if (return_type->is_base_type()) {
           t_base_type* base_type = ((t_base_type*)return_type);
             if (base_type->get_base() == t_base_type::TYPE_STRING) {
-            f_service_ << indent() << "if (return_value != NULL)" << endl;
+            f_service_ << indent() << "if (return_value != NULL)" << '\n';
             indent_up();
             if (base_type->is_binary()) {
-              f_service_ << indent() << "g_byte_array_unref (return_value);" << endl;
+              f_service_ << indent() << "g_byte_array_unref (return_value);" << '\n';
             } else {
-              f_service_ << indent() << "g_free (return_value);" << endl;
+              f_service_ << indent() << "g_free (return_value);" << '\n';
             }
             indent_down();
           }
         } else if (return_type->is_container()) {
-          f_service_ << indent() << "if (return_value != NULL)" << endl;
+          f_service_ << indent() << "if (return_value != NULL)" << '\n';
           indent_up();
 
           if (return_type->is_list()) {
@@ -2540,81 +2538,81 @@
             } else {
               f_service_ << "g_ptr_array_unref";
             }
-            f_service_ << " (return_value);" << endl;
+            f_service_ << " (return_value);" << '\n';
           } else if (return_type->is_map() || return_type->is_set()) {
-            f_service_ << indent() << "g_hash_table_unref (return_value);" << endl;
+            f_service_ << indent() << "g_hash_table_unref (return_value);" << '\n';
           }
 
           indent_down();
         } else if (return_type->is_struct()) {
-          f_service_ << indent() << "if (return_value != NULL)" << endl;
+          f_service_ << indent() << "if (return_value != NULL)" << '\n';
           indent_up();
-          f_service_ << indent() << "g_object_unref (return_value);" << endl;
+          f_service_ << indent() << "g_object_unref (return_value);" << '\n';
           indent_down();
         }
       }
-      f_service_ << indent() << "g_object_unref (result_struct);" << endl << endl << indent()
-                 << "if (result == TRUE)" << endl;
+      f_service_ << indent() << "g_object_unref (result_struct);" << '\n' << '\n' << indent()
+                 << "if (result == TRUE)" << '\n';
       indent_up();
-      f_service_ << indent() << "result =" << endl;
+      f_service_ << indent() << "result =" << '\n';
       indent_up();
       f_service_ << indent() << "((thrift_protocol_write_message_end "
-                 << "(output_protocol, error) != -1) &&" << endl << indent()
+                 << "(output_protocol, error) != -1) &&" << '\n' << indent()
                  << " (thrift_transport_write_end (transport, error) "
-                 << "!= FALSE) &&" << endl << indent()
+                 << "!= FALSE) &&" << '\n' << indent()
                  << " (thrift_transport_flush (transport, error) "
-                 << "!= FALSE));" << endl;
+                 << "!= FALSE));" << '\n';
       indent_down();
       indent_down();
     }
     scope_down(f_service_);
-    f_service_ << indent() << "else" << endl;
+    f_service_ << indent() << "else" << '\n';
     indent_up();
-    f_service_ << indent() << "result = FALSE;" << endl;
+    f_service_ << indent() << "result = FALSE;" << '\n';
     indent_down();
 
-    f_service_ << endl << indent() << "g_object_unref (transport);" << endl << indent()
-               << "g_object_unref (args);" << endl << endl << indent() << "return result;" << endl;
+    f_service_ << '\n' << indent() << "g_object_unref (transport);" << '\n' << indent()
+               << "g_object_unref (args);" << '\n' << '\n' << indent() << "return result;" << '\n';
     scope_down(f_service_);
 
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   // Generate the processor's dispatch_call implementation
   function_name = class_name_lc + "_dispatch_call";
   args_indent = indent() + string(function_name.length() + 2, ' ');
-  f_service_ << "static gboolean" << endl << function_name
-             << " (ThriftDispatchProcessor *dispatch_processor," << endl << args_indent
-             << "ThriftProtocol *input_protocol," << endl << args_indent
-             << "ThriftProtocol *output_protocol," << endl << args_indent << "gchar *method_name,"
-             << endl << args_indent << "gint32 sequence_id," << endl << args_indent
-             << "GError **error)" << endl;
+  f_service_ << "static gboolean" << '\n' << function_name
+             << " (ThriftDispatchProcessor *dispatch_processor," << '\n' << args_indent
+             << "ThriftProtocol *input_protocol," << '\n' << args_indent
+             << "ThriftProtocol *output_protocol," << '\n' << args_indent << "gchar *method_name,"
+             << '\n' << args_indent << "gint32 sequence_id," << '\n' << args_indent
+             << "GError **error)" << '\n';
   scope_up(f_service_);
   f_service_ << indent() << class_name_lc << "_process_function_def *"
-             << "process_function_def;" << endl;
-  f_service_ << indent() << "gboolean dispatch_result = FALSE;" << endl << endl << indent()
-             << class_name << " *self = " << class_name_uc << " (dispatch_processor);" << endl;
+             << "process_function_def;" << '\n';
+  f_service_ << indent() << "gboolean dispatch_result = FALSE;" << '\n' << '\n' << indent()
+             << class_name << " *self = " << class_name_uc << " (dispatch_processor);" << '\n';
   f_service_ << indent() << parent_class_name << "Class "
-                                                 "*parent_class =" << endl;
+                                                 "*parent_class =" << '\n';
   indent_up();
   f_service_ << indent() << "g_type_class_peek_parent (" << class_name_uc << "_GET_CLASS (self));"
-             << endl;
+             << '\n';
   indent_down();
-  f_service_ << endl
+  f_service_ << '\n'
              << indent() << "process_function_def = "
-             << "g_hash_table_lookup (self->process_map, method_name);" << endl
-             << indent() << "if (process_function_def != NULL)" << endl;
+             << "g_hash_table_lookup (self->process_map, method_name);" << '\n'
+             << indent() << "if (process_function_def != NULL)" << '\n';
   scope_up(f_service_);
   args_indent = indent() + string(53, ' ');
-  f_service_ << indent() << "g_free (method_name);" << endl
+  f_service_ << indent() << "g_free (method_name);" << '\n'
              << indent() << "dispatch_result = "
-             << "(*process_function_def->function) (self," << endl
-             << args_indent << "sequence_id," << endl
-             << args_indent << "input_protocol," << endl
-             << args_indent << "output_protocol," << endl
-             << args_indent << "error);" << endl;
+             << "(*process_function_def->function) (self," << '\n'
+             << args_indent << "sequence_id," << '\n'
+             << args_indent << "input_protocol," << '\n'
+             << args_indent << "output_protocol," << '\n'
+             << args_indent << "error);" << '\n';
   scope_down(f_service_);
-  f_service_ << indent() << "else" << endl;
+  f_service_ << indent() << "else" << '\n';
   scope_up(f_service_);
 
   // Method name not recognized; chain up to our parent processor---note the
@@ -2622,160 +2620,160 @@
   // will return an application exception to the caller if no class in the
   // hierarchy recognizes the method name
   f_service_ << indent() << "dispatch_result = parent_class->dispatch_call "
-                            "(dispatch_processor," << endl;
+                            "(dispatch_processor," << '\n';
   args_indent = indent() + string(47, ' ');
-  f_service_ << args_indent << "input_protocol," << endl << args_indent << "output_protocol,"
-             << endl << args_indent << "method_name," << endl << args_indent << "sequence_id,"
-             << endl << args_indent << "error);" << endl;
+  f_service_ << args_indent << "input_protocol," << '\n' << args_indent << "output_protocol,"
+             << '\n' << args_indent << "method_name," << '\n' << args_indent << "sequence_id,"
+             << '\n' << args_indent << "error);" << '\n';
   scope_down(f_service_);
-  f_service_ << endl << indent() << "return dispatch_result;" << endl;
+  f_service_ << '\n' << indent() << "return dispatch_result;" << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the processor's property setter
   function_name = class_name_lc + "_set_property";
   args_indent = string(function_name.length() + 2, ' ');
-  f_service_ << "static void" << endl << function_name << " (GObject *object," << endl
-             << args_indent << "guint property_id," << endl << args_indent << "const GValue *value,"
-             << endl << args_indent << "GParamSpec *pspec)" << endl;
+  f_service_ << "static void" << '\n' << function_name << " (GObject *object," << '\n'
+             << args_indent << "guint property_id," << '\n' << args_indent << "const GValue *value,"
+             << '\n' << args_indent << "GParamSpec *pspec)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << endl
-             << endl << indent() << "switch (property_id)" << endl;
+  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << '\n'
+             << '\n' << indent() << "switch (property_id)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << "case PROP_" << class_name_uc << "_HANDLER:" << endl;
+  f_service_ << indent() << "case PROP_" << class_name_uc << "_HANDLER:" << '\n';
   indent_up();
-  f_service_ << indent() << "if (self->handler != NULL)" << endl;
+  f_service_ << indent() << "if (self->handler != NULL)" << '\n';
   indent_up();
-  f_service_ << indent() << "g_object_unref (self->handler);" << endl;
+  f_service_ << indent() << "g_object_unref (self->handler);" << '\n';
   indent_down();
-  f_service_ << indent() << "self->handler = g_value_get_object (value);" << endl << indent()
-             << "g_object_ref (self->handler);" << endl;
+  f_service_ << indent() << "self->handler = g_value_get_object (value);" << '\n' << indent()
+             << "g_object_ref (self->handler);" << '\n';
   if (extends_service) {
     // Chain up to set the handler in every superclass as well
-    f_service_ << endl << indent() << "G_OBJECT_CLASS (" << class_name_lc << "_parent_class)->"
-               << endl;
+    f_service_ << '\n' << indent() << "G_OBJECT_CLASS (" << class_name_lc << "_parent_class)->"
+               << '\n';
     indent_up();
-    f_service_ << indent() << "set_property (object, property_id, value, pspec);" << endl;
+    f_service_ << indent() << "set_property (object, property_id, value, pspec);" << '\n';
     indent_down();
   }
-  f_service_ << indent() << "break;" << endl;
+  f_service_ << indent() << "break;" << '\n';
   indent_down();
-  f_service_ << indent() << "default:" << endl;
+  f_service_ << indent() << "default:" << '\n';
   indent_up();
   f_service_ << indent() << "G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);"
-             << endl << indent() << "break;" << endl;
+             << '\n' << indent() << "break;" << '\n';
   indent_down();
   scope_down(f_service_);
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate processor's property getter
   function_name = class_name_lc + "_get_property";
   args_indent = string(function_name.length() + 2, ' ');
-  f_service_ << "static void" << endl << function_name << " (GObject *object," << endl
-             << args_indent << "guint property_id," << endl << args_indent << "GValue *value,"
-             << endl << args_indent << "GParamSpec *pspec)" << endl;
+  f_service_ << "static void" << '\n' << function_name << " (GObject *object," << '\n'
+             << args_indent << "guint property_id," << '\n' << args_indent << "GValue *value,"
+             << '\n' << args_indent << "GParamSpec *pspec)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << endl
-             << endl << indent() << "switch (property_id)" << endl;
+  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << '\n'
+             << '\n' << indent() << "switch (property_id)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << "case PROP_" << class_name_uc << "_HANDLER:" << endl;
+  f_service_ << indent() << "case PROP_" << class_name_uc << "_HANDLER:" << '\n';
   indent_up();
-  f_service_ << indent() << "g_value_set_object (value, self->handler);" << endl << indent()
-             << "break;" << endl;
+  f_service_ << indent() << "g_value_set_object (value, self->handler);" << '\n' << indent()
+             << "break;" << '\n';
   indent_down();
-  f_service_ << indent() << "default:" << endl;
+  f_service_ << indent() << "default:" << '\n';
   indent_up();
   f_service_ << indent() << "G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);"
-             << endl << indent() << "break;" << endl;
+             << '\n' << indent() << "break;" << '\n';
   indent_down();
   scope_down(f_service_);
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generator the processor's dispose function
-  f_service_ << "static void" << endl << class_name_lc << "_dispose (GObject *gobject)" << endl;
+  f_service_ << "static void" << '\n' << class_name_lc << "_dispose (GObject *gobject)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (gobject);" << endl
-             << endl << indent() << "if (self->handler != NULL)" << endl;
+  f_service_ << indent() << class_name << " *self = " << class_name_uc << " (gobject);" << '\n'
+             << '\n' << indent() << "if (self->handler != NULL)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << "g_object_unref (self->handler);" << endl << indent()
-             << "self->handler = NULL;" << endl;
+  f_service_ << indent() << "g_object_unref (self->handler);" << '\n' << indent()
+             << "self->handler = NULL;" << '\n';
   scope_down(f_service_);
-  f_service_ << endl << indent() << "G_OBJECT_CLASS (" << class_name_lc << "_parent_class)"
+  f_service_ << '\n' << indent() << "G_OBJECT_CLASS (" << class_name_lc << "_parent_class)"
                                                                            "->dispose (gobject);"
-             << endl;
+             << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate processor finalize function
-  f_service_ << "static void" << endl << class_name_lc << "_finalize (GObject *gobject)" << endl;
+  f_service_ << "static void" << '\n' << class_name_lc << "_finalize (GObject *gobject)" << '\n';
   scope_up(f_service_);
   f_service_ << indent() << this->nspace << service_name_ << "Processor *self = " << this->nspace_uc
-             << service_name_uc << "_PROCESSOR (gobject);" << endl << endl << indent()
-             << "thrift_safe_hash_table_destroy (self->process_map);" << endl << endl << indent()
+             << service_name_uc << "_PROCESSOR (gobject);" << '\n' << '\n' << indent()
+             << "thrift_safe_hash_table_destroy (self->process_map);" << '\n' << '\n' << indent()
              << "G_OBJECT_CLASS (" << class_name_lc << "_parent_class)"
-                                                       "->finalize (gobject);" << endl;
+                                                       "->finalize (gobject);" << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate processor instance initializer
-  f_service_ << "static void" << endl << class_name_lc << "_init (" << class_name << " *self)"
-             << endl;
+  f_service_ << "static void" << '\n' << class_name_lc << "_init (" << class_name << " *self)"
+             << '\n';
   scope_up(f_service_);
   if (functions.size() > 0) {
-    f_service_ << indent() << "guint index;" << endl
-               << endl;
+    f_service_ << indent() << "guint index;" << '\n'
+               << '\n';
   }
-  f_service_ << indent() << "self->handler = NULL;" << endl << indent()
+  f_service_ << indent() << "self->handler = NULL;" << '\n' << indent()
              << "self->process_map = "
-                "g_hash_table_new (g_str_hash, g_str_equal);" << endl;
+                "g_hash_table_new (g_str_hash, g_str_equal);" << '\n';
   if (functions.size() > 0) {
     args_indent = string(21, ' ');
-    f_service_ << endl
+    f_service_ << '\n'
                << indent() << "for (index = 0; index < "
-               << functions.size() << "; index += 1)" << endl;
+               << functions.size() << "; index += 1)" << '\n';
     indent_up();
-    f_service_ << indent() << "g_hash_table_insert (self->process_map," << endl
+    f_service_ << indent() << "g_hash_table_insert (self->process_map," << '\n'
                << indent() << args_indent
-               << class_name_lc << "_process_function_defs[index].name," << endl
+               << class_name_lc << "_process_function_defs[index].name," << '\n'
                << indent() << args_indent
                << "&" << class_name_lc << "_process_function_defs[index]" << ");"
-               << endl;
+               << '\n';
     indent_down();
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate processor class initializer
-  f_service_ << "static void" << endl << class_name_lc << "_class_init (" << class_name
-             << "Class *cls)" << endl;
+  f_service_ << "static void" << '\n' << class_name_lc << "_class_init (" << class_name
+             << "Class *cls)" << '\n';
   scope_up(f_service_);
-  f_service_ << indent() << "GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << endl
-             << indent() << "ThriftDispatchProcessorClass *dispatch_processor_class =" << endl;
+  f_service_ << indent() << "GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << '\n'
+             << indent() << "ThriftDispatchProcessorClass *dispatch_processor_class =" << '\n';
   indent_up();
-  f_service_ << indent() << "THRIFT_DISPATCH_PROCESSOR_CLASS (cls);" << endl;
+  f_service_ << indent() << "THRIFT_DISPATCH_PROCESSOR_CLASS (cls);" << '\n';
   indent_down();
-  f_service_ << indent() << "GParamSpec *param_spec;" << endl << endl << indent()
-             << "gobject_class->dispose = " << class_name_lc << "_dispose;" << endl << indent()
-             << "gobject_class->finalize = " << class_name_lc << "_finalize;" << endl << indent()
-             << "gobject_class->set_property = " << class_name_lc << "_set_property;" << endl
+  f_service_ << indent() << "GParamSpec *param_spec;" << '\n' << '\n' << indent()
+             << "gobject_class->dispose = " << class_name_lc << "_dispose;" << '\n' << indent()
+             << "gobject_class->finalize = " << class_name_lc << "_finalize;" << '\n' << indent()
+             << "gobject_class->set_property = " << class_name_lc << "_set_property;" << '\n'
              << indent() << "gobject_class->get_property = " << class_name_lc << "_get_property;"
-             << endl << endl << indent()
+             << '\n' << '\n' << indent()
              << "dispatch_processor_class->dispatch_call = " << class_name_lc << "_dispatch_call;"
-             << endl << indent() << "cls->dispatch_call = " << class_name_lc << "_dispatch_call;"
-             << endl << endl << indent() << "param_spec = g_param_spec_object (\"handler\","
-             << endl;
+             << '\n' << indent() << "cls->dispatch_call = " << class_name_lc << "_dispatch_call;"
+             << '\n' << '\n' << indent() << "param_spec = g_param_spec_object (\"handler\","
+             << '\n';
   args_indent = indent() + string(34, ' ');
-  f_service_ << args_indent << "\"Service handler implementation\"," << endl << args_indent
-             << "\"The service handler implementation \"" << endl << args_indent
-             << "\"to which method calls are dispatched.\"," << endl << args_indent
-             << this->nspace_uc + "TYPE_" + service_name_uc + "_HANDLER," << endl << args_indent
-             << "G_PARAM_READWRITE);" << endl;
-  f_service_ << indent() << "g_object_class_install_property (gobject_class," << endl;
+  f_service_ << args_indent << "\"Service handler implementation\"," << '\n' << args_indent
+             << "\"The service handler implementation \"" << '\n' << args_indent
+             << "\"to which method calls are dispatched.\"," << '\n' << args_indent
+             << this->nspace_uc + "TYPE_" + service_name_uc + "_HANDLER," << '\n' << args_indent
+             << "G_PARAM_READWRITE);" << '\n';
+  f_service_ << indent() << "g_object_class_install_property (gobject_class," << '\n';
   args_indent = indent() + string(33, ' ');
-  f_service_ << args_indent << "PROP_" << class_name_uc << "_HANDLER," << endl << args_indent
-             << "param_spec);" << endl;
+  f_service_ << args_indent << "PROP_" << class_name_uc << "_HANDLER," << '\n' << args_indent
+             << "param_spec);" << '\n';
   scope_down(f_service_);
 }
 
@@ -2807,60 +2805,60 @@
   string args_indent;
 
   // write the instance definition
-  f_types_ << "struct _" << this->nspace << name << endl << "{ " << endl
-           << "  ThriftStruct parent; " << endl << endl << "  /* public */" << endl;
+  f_types_ << "struct _" << this->nspace << name << '\n' << "{ " << '\n'
+           << "  ThriftStruct parent; " << '\n' << '\n' << "  /* public */" << '\n';
 
   // for each field, add a member variable
   vector<t_field*>::const_iterator m_iter;
   const vector<t_field*>& members = tstruct->get_members();
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
-    f_types_ << "  " << type_name(t) << " " << (*m_iter)->get_name() << ";" << endl;
+    f_types_ << "  " << type_name(t) << " " << (*m_iter)->get_name() << ";" << '\n';
     if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-      f_types_ << "  gboolean __isset_" << (*m_iter)->get_name() << ";" << endl;
+      f_types_ << "  gboolean __isset_" << (*m_iter)->get_name() << ";" << '\n';
     }
   }
 
   // close the structure definition and create a typedef
-  f_types_ << "};" << endl << "typedef struct _" << this->nspace << name << " " << this->nspace
-           << name << ";" << endl << endl;
+  f_types_ << "};" << '\n' << "typedef struct _" << this->nspace << name << " " << this->nspace
+           << name << ";" << '\n' << '\n';
 
   // write the class definition
-  f_types_ << "struct _" << this->nspace << name << "Class" << endl << "{" << endl
-           << "  ThriftStructClass parent;" << endl << "};" << endl << "typedef struct _"
-           << this->nspace << name << "Class " << this->nspace << name << "Class;" << endl << endl;
+  f_types_ << "struct _" << this->nspace << name << "Class" << '\n' << "{" << '\n'
+           << "  ThriftStructClass parent;" << '\n' << "};" << '\n' << "typedef struct _"
+           << this->nspace << name << "Class " << this->nspace << name << "Class;" << '\n' << '\n';
 
   // write the standard GObject boilerplate
-  f_types_ << "GType " << this->nspace_lc << name_u << "_get_type (void);" << endl << "#define "
+  f_types_ << "GType " << this->nspace_lc << name_u << "_get_type (void);" << '\n' << "#define "
            << this->nspace_uc << "TYPE_" << name_uc << " (" << this->nspace_lc << name_u
-           << "_get_type())" << endl << "#define " << this->nspace_uc << name_uc
+           << "_get_type())" << '\n' << "#define " << this->nspace_uc << name_uc
            << "(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_" << name_uc
-           << ", " << this->nspace << name << "))" << endl << "#define " << this->nspace_uc
+           << ", " << this->nspace << name << "))" << '\n' << "#define " << this->nspace_uc
            << name_uc << "_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "_TYPE_"
-           << name_uc << ", " << this->nspace << name << "Class))" << endl << "#define "
+           << name_uc << ", " << this->nspace << name << "Class))" << '\n' << "#define "
            << this->nspace_uc << "IS_" << name_uc << "(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), "
-           << this->nspace_uc << "TYPE_" << name_uc << "))" << endl << "#define " << this->nspace_uc
+           << this->nspace_uc << "TYPE_" << name_uc << "))" << '\n' << "#define " << this->nspace_uc
            << "IS_" << name_uc << "_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc
-           << "TYPE_" << name_uc << "))" << endl << "#define " << this->nspace_uc << name_uc
+           << "TYPE_" << name_uc << "))" << '\n' << "#define " << this->nspace_uc << name_uc
            << "_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
-           << name_uc << ", " << this->nspace << name << "Class))" << endl << endl;
+           << name_uc << ", " << this->nspace << name << "Class))" << '\n' << '\n';
 
   // start writing the object implementation .c file
 
   // generate properties enum
   if (members.size() > 0) {
-    f_types_impl_ << "enum _" << class_name << "Properties" << endl << "{" << endl;
+    f_types_impl_ << "enum _" << class_name << "Properties" << '\n' << "{" << '\n';
     indent_up();
     f_types_impl_ << indent() << "PROP_" << class_name_uc << "_0";
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       string member_name_uc
           = to_upper_case(to_lower_case(initial_caps_to_underscores((*m_iter)->get_name())));
 
-      f_types_impl_ << "," << endl << indent() << "PROP_" << class_name_uc << "_" << member_name_uc;
+      f_types_impl_ << "," << '\n' << indent() << "PROP_" << class_name_uc << "_" << member_name_uc;
     }
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
     indent_down();
-    f_types_impl_ << "};" << endl << endl;
+    f_types_impl_ << "};" << '\n' << '\n';
   }
 
   // generate struct I/O methods
@@ -2874,12 +2872,12 @@
     // generate property setter
     function_name = class_name_lc + "_set_property";
     args_indent = string(function_name.length() + 2, ' ');
-    f_types_impl_ << "static void" << endl << function_name << " (GObject *object," << endl
-                  << args_indent << "guint property_id," << endl << args_indent
-                  << "const GValue *value," << endl << args_indent << "GParamSpec *pspec)" << endl;
+    f_types_impl_ << "static void" << '\n' << function_name << " (GObject *object," << '\n'
+                  << args_indent << "guint property_id," << '\n' << args_indent
+                  << "const GValue *value," << '\n' << args_indent << "GParamSpec *pspec)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << endl
-                  << endl << indent() << "switch (property_id)" << endl;
+    f_types_impl_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << '\n'
+                  << '\n' << indent() << "switch (property_id)" << '\n';
     scope_up(f_types_impl_);
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       t_field* member = (*m_iter);
@@ -2890,7 +2888,7 @@
 
       string property_identifier = "PROP_" + class_name_uc + "_" + member_name_uc;
 
-      f_types_impl_ << indent() << "case " << property_identifier + ":" << endl;
+      f_types_impl_ << indent() << "case " << property_identifier + ":" << '\n';
       indent_up();
 
       if (member_type->is_base_type()) {
@@ -2900,7 +2898,7 @@
         if (base_type->get_base() == t_base_type::TYPE_STRING) {
           string release_function_name;
 
-          f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << endl;
+          f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << '\n';
           indent_up();
 
           if (base_type->is_binary()) {
@@ -2912,7 +2910,7 @@
           }
 
           f_types_impl_ << indent() << release_function_name << " (self->" << member_name << ");"
-                        << endl;
+                        << '\n';
           indent_down();
         } else {
           switch (base_type->get_base()) {
@@ -2944,10 +2942,10 @@
         }
 
         f_types_impl_ << indent() << "self->" << member_name << " = " << assign_function_name
-                      << " (value);" << endl;
+                      << " (value);" << '\n';
       } else if (member_type->is_enum()) {
         f_types_impl_ << indent() << "self->" << member_name << " = g_value_get_int (value);"
-                      << endl;
+                      << '\n';
       } else if (member_type->is_container()) {
         string release_function_name;
         string assign_function_name;
@@ -2969,47 +2967,47 @@
           assign_function_name = "g_value_dup_boxed";
         }
 
-        f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << endl;
+        f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << '\n';
         indent_up();
         f_types_impl_ << indent() << release_function_name << " (self->" << member_name << ");"
-                      << endl;
+                      << '\n';
         indent_down();
         f_types_impl_ << indent() << "self->" << member_name << " = " << assign_function_name
-                      << " (value);" << endl;
+                      << " (value);" << '\n';
       } else if (member_type->is_struct() || member_type->is_xception()) {
-        f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << endl;
+        f_types_impl_ << indent() << "if (self->" << member_name << " != NULL)" << '\n';
         indent_up();
-        f_types_impl_ << indent() << "g_object_unref (self->" << member_name << ");" << endl;
+        f_types_impl_ << indent() << "g_object_unref (self->" << member_name << ");" << '\n';
         indent_down();
         f_types_impl_ << indent() << "self->" << member_name << " = g_value_dup_object (value);"
-                      << endl;
+                      << '\n';
       }
 
       if (member->get_req() != t_field::T_REQUIRED) {
-        f_types_impl_ << indent() << "self->__isset_" << member_name << " = TRUE;" << endl;
+        f_types_impl_ << indent() << "self->__isset_" << member_name << " = TRUE;" << '\n';
       }
 
-      f_types_impl_ << indent() << "break;" << endl << endl;
+      f_types_impl_ << indent() << "break;" << '\n' << '\n';
       indent_down();
     }
-    f_types_impl_ << indent() << "default:" << endl;
+    f_types_impl_ << indent() << "default:" << '\n';
     indent_up();
     f_types_impl_ << indent() << "G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);"
-                  << endl << indent() << "break;" << endl;
+                  << '\n' << indent() << "break;" << '\n';
     indent_down();
     scope_down(f_types_impl_);
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
 
     // generate property getter
     function_name = class_name_lc + "_get_property";
     args_indent = string(function_name.length() + 2, ' ');
-    f_types_impl_ << "static void" << endl << function_name << " (GObject *object," << endl
-                  << args_indent << "guint property_id," << endl << args_indent << "GValue *value,"
-                  << endl << args_indent << "GParamSpec *pspec)" << endl;
+    f_types_impl_ << "static void" << '\n' << function_name << " (GObject *object," << '\n'
+                  << args_indent << "guint property_id," << '\n' << args_indent << "GValue *value,"
+                  << '\n' << args_indent << "GParamSpec *pspec)" << '\n';
     scope_up(f_types_impl_);
-    f_types_impl_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << endl
-                  << endl << indent() << "switch (property_id)" << endl;
+    f_types_impl_ << indent() << class_name << " *self = " << class_name_uc << " (object);" << '\n'
+                  << '\n' << indent() << "switch (property_id)" << '\n';
     scope_up(f_types_impl_);
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       t_field* member = (*m_iter);
@@ -3070,26 +3068,26 @@
               "unrecognized type for struct member \"" + member_name + "\"";
       }
 
-      f_types_impl_ << indent() << "case " << property_identifier + ":" << endl;
+      f_types_impl_ << indent() << "case " << property_identifier + ":" << '\n';
       indent_up();
       f_types_impl_ << indent() << setter_function_name << " (value, self->" << member_name << ");"
-                    << endl << indent() << "break;" << endl << endl;
+                    << '\n' << indent() << "break;" << '\n' << '\n';
       indent_down();
     }
-    f_types_impl_ << indent() << "default:" << endl;
+    f_types_impl_ << indent() << "default:" << '\n';
     indent_up();
     f_types_impl_ << indent() << "G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);"
-                  << endl << indent() << "break;" << endl;
+                  << '\n' << indent() << "break;" << '\n';
     indent_down();
     scope_down(f_types_impl_);
     scope_down(f_types_impl_);
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   }
 
   // generate the instance init function
 
-  f_types_impl_ << "static void " << endl << this->nspace_lc << name_u << "_instance_init ("
-                << this->nspace << name << " * object)" << endl << "{" << endl;
+  f_types_impl_ << "static void " << '\n' << this->nspace_lc << name_u << "_instance_init ("
+                << this->nspace << name << " * object)" << '\n' << "{" << '\n';
   indent_up();
 
   // generate default-value structures for container-type members
@@ -3109,9 +3107,9 @@
 
         // Generate an array with the list literal
         indent(f_types_impl_) << "static " << type_name(elem_type, false, true) << " __default_"
-                              << member_name << "[" << list.size() << "] = " << endl;
+                              << member_name << "[" << list.size() << "] = " << '\n';
         indent_up();
-        f_types_impl_ << indent() << constant_literal(member_type, member_value) << ";" << endl;
+        f_types_impl_ << indent() << constant_literal(member_type, member_value) << ";" << '\n';
         indent_down();
 
         constant_declaration_output = true;
@@ -3129,15 +3127,15 @@
   }
   if (constant_declaration_output) {
     if (string_list_constant_output) {
-      indent(f_types_impl_) << "unsigned int list_index;" << endl;
+      indent(f_types_impl_) << "unsigned int list_index;" << '\n';
     }
 
-    f_types_impl_ << endl;
+    f_types_impl_ << '\n';
   }
 
   // satisfy compilers with -Wall turned on
-  indent(f_types_impl_) << "/* satisfy -Wall */" << endl << indent()
-                        << "THRIFT_UNUSED_VAR (object);" << endl;
+  indent(f_types_impl_) << "/* satisfy -Wall */" << '\n' << indent()
+                        << "THRIFT_UNUSED_VAR (object);" << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* member_type = (*m_iter)->get_type();
@@ -3153,7 +3151,7 @@
       } else {
         dval += t->is_string() ? "NULL" : "0";
       }
-      indent(f_types_impl_) << "object->" << (*m_iter)->get_name() << dval << ";" << endl;
+      indent(f_types_impl_) << "object->" << (*m_iter)->get_name() << dval << ";" << '\n';
     } else if (t->is_struct()) {
       string name = (*m_iter)->get_name();
       t_program* type_program = member_type->get_program();
@@ -3163,10 +3161,10 @@
       string type_name_uc = to_upper_case(initial_caps_to_underscores(member_type->get_name()));
       indent(f_types_impl_) << "object->" << name << " = g_object_new ("
                             << to_upper_case(type_nspace_prefix) << "TYPE_" << type_name_uc
-                            << ", NULL);" << endl;
+                            << ", NULL);" << '\n';
     } else if (t->is_xception()) {
       string name = (*m_iter)->get_name();
-      indent(f_types_impl_) << "object->" << name << " = NULL;" << endl;
+      indent(f_types_impl_) << "object->" << name << " = NULL;" << '\n';
     } else if (t->is_container()) {
       string name = (*m_iter)->get_name();
       string init_function;
@@ -3184,7 +3182,7 @@
         init_function = generate_new_array_from_type(etype);
       }
 
-      indent(f_types_impl_) << "object->" << name << " = " << init_function << endl;
+      indent(f_types_impl_) << "object->" << name << " = " << init_function << '\n';
 
       // Pre-populate the container with the specified default values, if any
       if ((*m_iter)->get_value()) {
@@ -3196,17 +3194,17 @@
           if (is_numeric(etype)) {
             indent(f_types_impl_) <<
               "g_array_append_vals (object->" << name << ", &__default_" <<
-              name << ", " << list.size() << ");" << endl;
+              name << ", " << list.size() << ");" << '\n';
           }
           else {
             indent(f_types_impl_) <<
               "for (list_index = 0; list_index < " << list.size() << "; " <<
-              "list_index += 1)" << endl;
+              "list_index += 1)" << '\n';
             indent_up();
             indent(f_types_impl_) <<
-              "g_ptr_array_add (object->" << name << "," << endl <<
+              "g_ptr_array_add (object->" << name << "," << '\n' <<
               indent() << string(17, ' ') << "g_strdup (__default_" <<
-              name << "[list_index]));" << endl;
+              name << "[list_index]));" << '\n';
             indent_down();
           }
         }
@@ -3217,36 +3215,36 @@
 
     /* if not required, initialize the __isset variable */
     if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-      indent(f_types_impl_) << "object->__isset_" << (*m_iter)->get_name() << " = FALSE;" << endl;
+      indent(f_types_impl_) << "object->__isset_" << (*m_iter)->get_name() << " = FALSE;" << '\n';
     }
   }
 
   indent_down();
-  f_types_impl_ << "}" << endl << endl;
+  f_types_impl_ << "}" << '\n' << '\n';
 
   /* create the destructor */
-  f_types_impl_ << "static void " << endl << this->nspace_lc << name_u
-                << "_finalize (GObject *object)" << endl << "{" << endl;
+  f_types_impl_ << "static void " << '\n' << this->nspace_lc << name_u
+                << "_finalize (GObject *object)" << '\n' << "{" << '\n';
   indent_up();
 
   f_types_impl_ << indent() << this->nspace << name << " *tobject = " << this->nspace_uc << name_uc
-                << " (object);" << endl << endl;
+                << " (object);" << '\n' << '\n';
 
-  f_types_impl_ << indent() << "/* satisfy -Wall in case we don't use tobject */" << endl
-                << indent() << "THRIFT_UNUSED_VAR (tobject);" << endl;
+  f_types_impl_ << indent() << "/* satisfy -Wall in case we don't use tobject */" << '\n'
+                << indent() << "THRIFT_UNUSED_VAR (tobject);" << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
     if (t->is_container()) {
       string name = (*m_iter)->get_name();
       if (t->is_map() || t->is_set()) {
-        f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << endl;
-        f_types_impl_ << indent() << "{" << endl;
+        f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << '\n';
+        f_types_impl_ << indent() << "{" << '\n';
         indent_up();
-        f_types_impl_ << indent() << "g_hash_table_destroy (tobject->" << name << ");" << endl;
-        f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << endl;
+        f_types_impl_ << indent() << "g_hash_table_destroy (tobject->" << name << ");" << '\n';
+        f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << '\n';
         indent_down();
-        f_types_impl_ << indent() << "}" << endl;
+        f_types_impl_ << indent() << "}" << '\n';
       } else if (t->is_list()) {
         t_type* etype = ((t_list*)t)->get_elem_type();
         string destructor_function = "g_ptr_array_unref";
@@ -3273,59 +3271,59 @@
           destructor_function = "g_array_unref";
         }
 
-        f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << endl;
-        f_types_impl_ << indent() << "{" << endl;
+        f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << '\n';
+        f_types_impl_ << indent() << "{" << '\n';
         indent_up();
-        f_types_impl_ << indent() << destructor_function << " (tobject->" << name << ");" << endl;
-        f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << endl;
+        f_types_impl_ << indent() << destructor_function << " (tobject->" << name << ");" << '\n';
+        f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << '\n';
         indent_down();
-        f_types_impl_ << indent() << "}" << endl;
+        f_types_impl_ << indent() << "}" << '\n';
       }
     } else if (t->is_struct() || t->is_xception()) {
       string name = (*m_iter)->get_name();
       // TODO: g_clear_object needs glib >= 2.28
-      // f_types_impl_ << indent() << "g_clear_object (&(tobject->" << name << "));" << endl;
+      // f_types_impl_ << indent() << "g_clear_object (&(tobject->" << name << "));" << '\n';
       // does g_object_unref the trick?
-      f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << endl;
-      f_types_impl_ << indent() << "{" << endl;
+      f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << '\n';
+      f_types_impl_ << indent() << "{" << '\n';
       indent_up();
-      f_types_impl_ << indent() << "g_object_unref(tobject->" << name << ");" << endl;
-      f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << endl;
+      f_types_impl_ << indent() << "g_object_unref(tobject->" << name << ");" << '\n';
+      f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << '\n';
       indent_down();
-      f_types_impl_ << indent() << "}" << endl;
+      f_types_impl_ << indent() << "}" << '\n';
     } else if (t->is_string()) {
       string name = (*m_iter)->get_name();
-      f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << endl;
-      f_types_impl_ << indent() << "{" << endl;
+      f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << '\n';
+      f_types_impl_ << indent() << "{" << '\n';
       indent_up();
       f_types_impl_ << indent() << generate_free_func_from_type(t) << "(tobject->" << name << ");"
-                    << endl;
-      f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << endl;
+                    << '\n';
+      f_types_impl_ << indent() << "tobject->" << name << " = NULL;" << '\n';
       indent_down();
-      f_types_impl_ << indent() << "}" << endl;
+      f_types_impl_ << indent() << "}" << '\n';
     }
   }
 
   indent_down();
-  f_types_impl_ << "}" << endl << endl;
+  f_types_impl_ << "}" << '\n' << '\n';
 
   // generate the class init function
 
-  f_types_impl_ << "static void" << endl << class_name_lc << "_class_init (" << class_name
-                << "Class * cls)" << endl;
+  f_types_impl_ << "static void" << '\n' << class_name_lc << "_class_init (" << class_name
+                << "Class * cls)" << '\n';
   scope_up(f_types_impl_);
 
-  f_types_impl_ << indent() << "GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << endl
+  f_types_impl_ << indent() << "GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << '\n'
                 << indent() << "ThriftStructClass *struct_class = "
-                << "THRIFT_STRUCT_CLASS (cls);" << endl << endl << indent()
-                << "struct_class->read = " << class_name_lc << "_read;" << endl << indent()
-                << "struct_class->write = " << class_name_lc << "_write;" << endl << endl
+                << "THRIFT_STRUCT_CLASS (cls);" << '\n' << '\n' << indent()
+                << "struct_class->read = " << class_name_lc << "_read;" << '\n' << indent()
+                << "struct_class->write = " << class_name_lc << "_write;" << '\n' << '\n'
                 << indent() << "gobject_class->finalize = " << class_name_lc << "_finalize;"
-                << endl;
+                << '\n';
   if (members.size() > 0) {
     f_types_impl_ << indent() << "gobject_class->get_property = " << class_name_lc
-                  << "_get_property;" << endl << indent()
-                  << "gobject_class->set_property = " << class_name_lc << "_set_property;" << endl;
+                  << "_get_property;" << '\n' << indent()
+                  << "gobject_class->set_property = " << class_name_lc << "_set_property;" << '\n';
 
     // install a property for each member
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -3338,11 +3336,11 @@
 
       string property_identifier = "PROP_" + class_name_uc + "_" + member_name_uc;
 
-      f_types_impl_ << endl << indent() << "g_object_class_install_property" << endl;
+      f_types_impl_ << '\n' << indent() << "g_object_class_install_property" << '\n';
       indent_up();
       args_indent = indent() + ' ';
-      f_types_impl_ << indent() << "(gobject_class," << endl << args_indent << property_identifier
-                    << "," << endl << args_indent;
+      f_types_impl_ << indent() << "(gobject_class," << '\n' << args_indent << property_identifier
+                    << "," << '\n' << args_indent;
 
       if (member_type->is_base_type()) {
         t_base_type::t_base base_type = ((t_base_type*)member_type)->get_base();
@@ -3350,27 +3348,27 @@
         if (base_type == t_base_type::TYPE_STRING) {
           if (((t_base_type*)member_type)->is_binary()) {
             args_indent += string(20, ' ');
-            f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << endl << args_indent
-                          << "NULL," << endl << args_indent << "NULL," << endl << args_indent
-                          << "G_TYPE_BYTE_ARRAY," << endl << args_indent << "G_PARAM_READWRITE));"
-                          << endl;
+            f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << '\n' << args_indent
+                          << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
+                          << "G_TYPE_BYTE_ARRAY," << '\n' << args_indent << "G_PARAM_READWRITE));"
+                          << '\n';
           } else {
             args_indent += string(21, ' ');
-            f_types_impl_ << "g_param_spec_string (\"" << member_name << "\"," << endl
-                          << args_indent << "NULL," << endl << args_indent << "NULL," << endl
+            f_types_impl_ << "g_param_spec_string (\"" << member_name << "\"," << '\n'
+                          << args_indent << "NULL," << '\n' << args_indent << "NULL," << '\n'
                           << args_indent
                           << ((member_value != NULL) ? "\"" + member_value->get_string() + "\""
-                                                     : "NULL") << "," << endl << args_indent
-                          << "G_PARAM_READWRITE));" << endl;
+                                                     : "NULL") << "," << '\n' << args_indent
+                          << "G_PARAM_READWRITE));" << '\n';
           }
         } else if (base_type == t_base_type::TYPE_BOOL) {
           args_indent += string(22, ' ');
-          f_types_impl_ << "g_param_spec_boolean (\"" << member_name << "\"," << endl << args_indent
-                        << "NULL," << endl << args_indent << "NULL," << endl << args_indent
+          f_types_impl_ << "g_param_spec_boolean (\"" << member_name << "\"," << '\n' << args_indent
+                        << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
                         << (((member_value != NULL) && (member_value->get_integer() != 0))
                                 ? "TRUE"
-                                : "FALSE") << "," << endl << args_indent << "G_PARAM_READWRITE));"
-                        << endl;
+                                : "FALSE") << "," << '\n' << args_indent << "G_PARAM_READWRITE));"
+                        << '\n';
         } else if ((base_type == t_base_type::TYPE_I8) || (base_type == t_base_type::TYPE_I16)
                    || (base_type == t_base_type::TYPE_I32) || (base_type == t_base_type::TYPE_I64)
                    || (base_type == t_base_type::TYPE_DOUBLE)) {
@@ -3423,11 +3421,11 @@
           }
 
           args_indent += string(param_spec_function_name.length() + 2, ' ');
-          f_types_impl_ << param_spec_function_name << " (\"" << member_name << "\"," << endl
-                        << args_indent << "NULL," << endl << args_indent << "NULL," << endl
-                        << args_indent << min_value << "," << endl << args_indent << max_value
-                        << "," << endl << args_indent << default_value.str() << "," << endl
-                        << args_indent << "G_PARAM_READWRITE));" << endl;
+          f_types_impl_ << param_spec_function_name << " (\"" << member_name << "\"," << '\n'
+                        << args_indent << "NULL," << '\n' << args_indent << "NULL," << '\n'
+                        << args_indent << min_value << "," << '\n' << args_indent << max_value
+                        << "," << '\n' << args_indent << default_value.str() << "," << '\n'
+                        << args_indent << "G_PARAM_READWRITE));" << '\n';
         }
 
         indent_down();
@@ -3438,11 +3436,11 @@
         int max_value = (enum_max_value != nullptr) ? enum_max_value->get_value() : 0;
 
         args_indent += string(18, ' ');
-        f_types_impl_ << "g_param_spec_int (\"" << member_name << "\"," << endl << args_indent
-                      << "NULL," << endl << args_indent << "NULL," << endl << args_indent
-                      << min_value << "," << endl << args_indent << max_value << "," << endl
-                      << args_indent << min_value << "," << endl << args_indent
-                      << "G_PARAM_READWRITE));" << endl;
+        f_types_impl_ << "g_param_spec_int (\"" << member_name << "\"," << '\n' << args_indent
+                      << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
+                      << min_value << "," << '\n' << args_indent << max_value << "," << '\n'
+                      << args_indent << min_value << "," << '\n' << args_indent
+                      << "G_PARAM_READWRITE));" << '\n';
         indent_down();
       } else if (member_type->is_struct() || member_type->is_xception()) {
         t_program* type_program = member_type->get_program();
@@ -3454,9 +3452,9 @@
                             + to_upper_case(initial_caps_to_underscores(member_type->get_name()));
 
         args_indent += string(20, ' ');
-        f_types_impl_ << "g_param_spec_object (\"" << member_name << "\"," << endl << args_indent
-                      << "NULL," << endl << args_indent << "NULL," << endl << args_indent
-                      << param_type << "," << endl << args_indent << "G_PARAM_READWRITE));" << endl;
+        f_types_impl_ << "g_param_spec_object (\"" << member_name << "\"," << '\n' << args_indent
+                      << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
+                      << param_type << "," << '\n' << args_indent << "G_PARAM_READWRITE));" << '\n';
         indent_down();
       } else if (member_type->is_list()) {
         t_type* elem_type = ((t_list*)member_type)->get_elem_type();
@@ -3469,38 +3467,38 @@
         }
 
         args_indent += string(20, ' ');
-        f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << endl << args_indent
-                      << "NULL," << endl << args_indent << "NULL," << endl << args_indent
-                      << param_type << "," << endl << args_indent << "G_PARAM_READWRITE));" << endl;
+        f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << '\n' << args_indent
+                      << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
+                      << param_type << "," << '\n' << args_indent << "G_PARAM_READWRITE));" << '\n';
         indent_down();
       } else if (member_type->is_set() || member_type->is_map()) {
         args_indent += string(20, ' ');
-        f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << endl << args_indent
-                      << "NULL," << endl << args_indent << "NULL," << endl << args_indent
-                      << "G_TYPE_HASH_TABLE," << endl << args_indent << "G_PARAM_READWRITE));"
-                      << endl;
+        f_types_impl_ << "g_param_spec_boxed (\"" << member_name << "\"," << '\n' << args_indent
+                      << "NULL," << '\n' << args_indent << "NULL," << '\n' << args_indent
+                      << "G_TYPE_HASH_TABLE," << '\n' << args_indent << "G_PARAM_READWRITE));"
+                      << '\n';
         indent_down();
       }
     }
   }
   scope_down(f_types_impl_);
-  f_types_impl_ << endl;
+  f_types_impl_ << '\n';
 
-  f_types_impl_ << "GType" << endl << this->nspace_lc << name_u << "_get_type (void)" << endl << "{"
-                << endl << "  static GType type = 0;" << endl << endl << "  if (type == 0) " << endl
-                << "  {" << endl << "    static const GTypeInfo type_info = " << endl << "    {"
-                << endl << "      sizeof (" << this->nspace << name << "Class)," << endl
-                << "      NULL, /* base_init */" << endl << "      NULL, /* base_finalize */"
-                << endl << "      (GClassInitFunc) " << this->nspace_lc << name_u << "_class_init,"
-                << endl << "      NULL, /* class_finalize */" << endl
-                << "      NULL, /* class_data */" << endl << "      sizeof (" << this->nspace
-                << name << ")," << endl << "      0, /* n_preallocs */" << endl
+  f_types_impl_ << "GType" << '\n' << this->nspace_lc << name_u << "_get_type (void)" << '\n' << "{"
+                << '\n' << "  static GType type = 0;" << '\n' << '\n' << "  if (type == 0) " << '\n'
+                << "  {" << '\n' << "    static const GTypeInfo type_info = " << '\n' << "    {"
+                << '\n' << "      sizeof (" << this->nspace << name << "Class)," << '\n'
+                << "      NULL, /* base_init */" << '\n' << "      NULL, /* base_finalize */"
+                << '\n' << "      (GClassInitFunc) " << this->nspace_lc << name_u << "_class_init,"
+                << '\n' << "      NULL, /* class_finalize */" << '\n'
+                << "      NULL, /* class_data */" << '\n' << "      sizeof (" << this->nspace
+                << name << ")," << '\n' << "      0, /* n_preallocs */" << '\n'
                 << "      (GInstanceInitFunc) " << this->nspace_lc << name_u << "_instance_init,"
-                << endl << "      NULL, /* value_table */" << endl << "    };" << endl << endl
-                << "    type = g_type_register_static (THRIFT_TYPE_STRUCT, " << endl
+                << '\n' << "      NULL, /* value_table */" << '\n' << "    };" << '\n' << '\n'
+                << "    type = g_type_register_static (THRIFT_TYPE_STRUCT, " << '\n'
                 << "                                   \"" << this->nspace << name << "Type\","
-                << endl << "                                   &type_info, 0);" << endl << "  }"
-                << endl << endl << "  return type;" << endl << "}" << endl << endl;
+                << '\n' << "                                   &type_info, 0);" << '\n' << "  }"
+                << '\n' << '\n' << "  return type;" << '\n' << "}" << '\n' << '\n';
 }
 
 /**
@@ -3521,59 +3519,59 @@
 
   if (is_function) {
     error_ret = -1;
-    indent(out) << "static gint32" << endl << this->nspace_lc << name_u
+    indent(out) << "static gint32" << '\n' << this->nspace_lc << name_u
                 << "_write (ThriftStruct *object, ThriftProtocol *protocol, GError **error)"
-                << endl;
+                << '\n';
   }
-  indent(out) << "{" << endl;
+  indent(out) << "{" << '\n';
   indent_up();
 
-  out << indent() << "gint32 ret;" << endl << indent() << "gint32 xfer = 0;" << endl << endl;
+  out << indent() << "gint32 ret;" << '\n' << indent() << "gint32 xfer = 0;" << '\n' << '\n';
 
-  indent(out) << this_get << endl;
+  indent(out) << this_get << '\n';
   // satisfy -Wall in the case of an empty struct
   if (!this_get.empty()) {
-    indent(out) << "THRIFT_UNUSED_VAR (this_object);" << endl;
+    indent(out) << "THRIFT_UNUSED_VAR (this_object);" << '\n';
   }
 
   out << indent() << "if ((ret = thrift_protocol_write_struct_begin (protocol, \"" << name
-      << "\", error)) < 0)" << endl << indent() << "  return " << error_ret << ";" << endl
-      << indent() << "xfer += ret;" << endl;
+      << "\", error)) < 0)" << '\n' << indent() << "  return " << error_ret << ";" << '\n'
+      << indent() << "xfer += ret;" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_OPTIONAL) {
-      indent(out) << "if (this_object->__isset_" << (*f_iter)->get_name() << " == TRUE) {" << endl;
+      indent(out) << "if (this_object->__isset_" << (*f_iter)->get_name() << " == TRUE) {" << '\n';
       indent_up();
     }
 
     out << indent() << "if ((ret = thrift_protocol_write_field_begin (protocol, "
         << "\"" << (*f_iter)->get_name() << "\", " << type_to_enum((*f_iter)->get_type()) << ", "
-        << (*f_iter)->get_key() << ", error)) < 0)" << endl << indent() << "  return " << error_ret
-        << ";" << endl << indent() << "xfer += ret;" << endl;
+        << (*f_iter)->get_key() << ", error)) < 0)" << '\n' << indent() << "  return " << error_ret
+        << ";" << '\n' << indent() << "xfer += ret;" << '\n';
     generate_serialize_field(out, *f_iter, this_name, "", error_ret);
-    out << indent() << "if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)" << endl
-        << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;"
-        << endl;
+    out << indent() << "if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)" << '\n'
+        << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;"
+        << '\n';
 
     if ((*f_iter)->get_req() == t_field::T_OPTIONAL) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
   // write the struct map
-  out << indent() << "if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)" << endl
-      << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;" << endl
-      << indent() << "if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)" << endl
-      << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;" << endl
-      << endl;
+  out << indent() << "if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)" << '\n'
+      << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;" << '\n'
+      << indent() << "if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)" << '\n'
+      << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;" << '\n'
+      << '\n';
 
   if (is_function) {
-    indent(out) << "return xfer;" << endl;
+    indent(out) << "return xfer;" << '\n';
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -3593,127 +3591,127 @@
 
   if (is_function) {
     error_ret = -1;
-    indent(out) << "/* reads a " << name_u << " object */" << endl << "static gint32" << endl
+    indent(out) << "/* reads a " << name_u << " object */" << '\n' << "static gint32" << '\n'
                 << this->nspace_lc << name_u
-                << "_read (ThriftStruct *object, ThriftProtocol *protocol, GError **error)" << endl;
+                << "_read (ThriftStruct *object, ThriftProtocol *protocol, GError **error)" << '\n';
   }
 
-  indent(out) << "{" << endl;
+  indent(out) << "{" << '\n';
   indent_up();
 
   // declare stack temp variables
-  out << indent() << "gint32 ret;" << endl << indent() << "gint32 xfer = 0;" << endl << indent()
-      << "gchar *name = NULL;" << endl << indent() << "ThriftType ftype;" << endl << indent()
-      << "gint16 fid;" << endl << indent() << "guint32 len = 0;" << endl << indent()
-      << "gpointer data = NULL;" << endl << indent() << this_get << endl;
+  out << indent() << "gint32 ret;" << '\n' << indent() << "gint32 xfer = 0;" << '\n' << indent()
+      << "gchar *name = NULL;" << '\n' << indent() << "ThriftType ftype;" << '\n' << indent()
+      << "gint16 fid;" << '\n' << indent() << "guint32 len = 0;" << '\n' << indent()
+      << "gpointer data = NULL;" << '\n' << indent() << this_get << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      indent(out) << "gboolean isset_" << (*f_iter)->get_name() << " = FALSE;" << endl;
+      indent(out) << "gboolean isset_" << (*f_iter)->get_name() << " = FALSE;" << '\n';
     }
   }
 
-  out << endl;
+  out << '\n';
 
   // satisfy -Wall in case we don't use some variables
-  out << indent() << "/* satisfy -Wall in case these aren't used */" << endl << indent()
-      << "THRIFT_UNUSED_VAR (len);" << endl << indent() << "THRIFT_UNUSED_VAR (data);" << endl;
+  out << indent() << "/* satisfy -Wall in case these aren't used */" << '\n' << indent()
+      << "THRIFT_UNUSED_VAR (len);" << '\n' << indent() << "THRIFT_UNUSED_VAR (data);" << '\n';
 
   if (!this_get.empty()) {
-    out << indent() << "THRIFT_UNUSED_VAR (this_object);" << endl;
+    out << indent() << "THRIFT_UNUSED_VAR (this_object);" << '\n';
   }
-  out << endl;
+  out << '\n';
 
   // read the beginning of the structure marker
-  out << indent() << "/* read the struct begin marker */" << endl << indent()
-      << "if ((ret = thrift_protocol_read_struct_begin (protocol, &name, error)) < 0)" << endl
-      << indent() << "{" << endl << indent() << "  if (name) g_free (name);" << endl << indent()
-      << "  return " << error_ret << ";" << endl << indent() << "}" << endl << indent()
-      << "xfer += ret;" << endl << indent() << "if (name) g_free (name);" << endl << indent()
-      << "name = NULL;" << endl << endl;
+  out << indent() << "/* read the struct begin marker */" << '\n' << indent()
+      << "if ((ret = thrift_protocol_read_struct_begin (protocol, &name, error)) < 0)" << '\n'
+      << indent() << "{" << '\n' << indent() << "  if (name) g_free (name);" << '\n' << indent()
+      << "  return " << error_ret << ";" << '\n' << indent() << "}" << '\n' << indent()
+      << "xfer += ret;" << '\n' << indent() << "if (name) g_free (name);" << '\n' << indent()
+      << "name = NULL;" << '\n' << '\n';
 
   // read the struct fields
-  out << indent() << "/* read the struct fields */" << endl << indent() << "while (1)" << endl;
+  out << indent() << "/* read the struct fields */" << '\n' << indent() << "while (1)" << '\n';
   scope_up(out);
 
   // read beginning field marker
-  out << indent() << "/* read the beginning of a field */" << endl << indent()
+  out << indent() << "/* read the beginning of a field */" << '\n' << indent()
       << "if ((ret = thrift_protocol_read_field_begin (protocol, &name, &ftype, &fid, error)) < 0)"
-      << endl << indent() << "{" << endl << indent() << "  if (name) g_free (name);" << endl
-      << indent() << "  return " << error_ret << ";" << endl << indent() << "}" << endl << indent()
-      << "xfer += ret;" << endl << indent() << "if (name) g_free (name);" << endl << indent()
-      << "name = NULL;" << endl << endl;
+      << '\n' << indent() << "{" << '\n' << indent() << "  if (name) g_free (name);" << '\n'
+      << indent() << "  return " << error_ret << ";" << '\n' << indent() << "}" << '\n' << indent()
+      << "xfer += ret;" << '\n' << indent() << "if (name) g_free (name);" << '\n' << indent()
+      << "name = NULL;" << '\n' << '\n';
 
   // check for field STOP marker
-  out << indent() << "/* break if we get a STOP field */" << endl << indent()
-      << "if (ftype == T_STOP)" << endl << indent() << "{" << endl << indent() << "  break;" << endl
-      << indent() << "}" << endl << endl;
+  out << indent() << "/* break if we get a STOP field */" << '\n' << indent()
+      << "if (ftype == T_STOP)" << '\n' << indent() << "{" << '\n' << indent() << "  break;" << '\n'
+      << indent() << "}" << '\n' << '\n';
 
   // switch depending on the field type
-  indent(out) << "switch (fid)" << endl;
+  indent(out) << "switch (fid)" << '\n';
 
   // start switch
   scope_up(out);
 
   // generate deserialization code for known types
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
+    indent(out) << "case " << (*f_iter)->get_key() << ":" << '\n';
     indent_up();
-    indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ")" << endl;
-    indent(out) << "{" << endl;
+    indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ")" << '\n';
+    indent(out) << "{" << '\n';
 
     indent_up();
     // generate deserialize field
     generate_deserialize_field(out, *f_iter, this_name, "", error_ret, false);
     indent_down();
 
-    out << indent() << "} else {" << endl << indent()
-        << "  if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)" << endl << indent()
-        << "    return " << error_ret << ";" << endl << indent() << "  xfer += ret;" << endl
-        << indent() << "}" << endl << indent() << "break;" << endl;
+    out << indent() << "} else {" << '\n' << indent()
+        << "  if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)" << '\n' << indent()
+        << "    return " << error_ret << ";" << '\n' << indent() << "  xfer += ret;" << '\n'
+        << indent() << "}" << '\n' << indent() << "break;" << '\n';
     indent_down();
   }
 
   // create the default case
-  out << indent() << "default:" << endl << indent()
-      << "  if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)" << endl << indent()
-      << "    return " << error_ret << ";" << endl << indent() << "  xfer += ret;" << endl
-      << indent() << "  break;" << endl;
+  out << indent() << "default:" << '\n' << indent()
+      << "  if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)" << '\n' << indent()
+      << "    return " << error_ret << ";" << '\n' << indent() << "  xfer += ret;" << '\n'
+      << indent() << "  break;" << '\n';
 
   // end switch
   scope_down(out);
 
   // read field end marker
-  out << indent() << "if ((ret = thrift_protocol_read_field_end (protocol, error)) < 0)" << endl
-      << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;" << endl;
+  out << indent() << "if ((ret = thrift_protocol_read_field_end (protocol, error)) < 0)" << '\n'
+      << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;" << '\n';
 
   // end while loop
   scope_down(out);
-  out << endl;
+  out << '\n';
 
   // read the end of the structure
-  out << indent() << "if ((ret = thrift_protocol_read_struct_end (protocol, error)) < 0)" << endl
-      << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;" << endl
-      << endl;
+  out << indent() << "if ((ret = thrift_protocol_read_struct_end (protocol, error)) < 0)" << '\n'
+      << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;" << '\n'
+      << '\n';
 
   // if a required field is missing, throw an error
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      out << indent() << "if (!isset_" << (*f_iter)->get_name() << ")" << endl << indent() << "{"
-          << endl << indent() << "  g_set_error (error, THRIFT_PROTOCOL_ERROR," << endl << indent()
-          << "               THRIFT_PROTOCOL_ERROR_INVALID_DATA," << endl << indent()
-          << "               \"missing field\");" << endl << indent() << "  return -1;" << endl
-          << indent() << "}" << endl << endl;
+      out << indent() << "if (!isset_" << (*f_iter)->get_name() << ")" << '\n' << indent() << "{"
+          << '\n' << indent() << "  g_set_error (error, THRIFT_PROTOCOL_ERROR," << '\n' << indent()
+          << "               THRIFT_PROTOCOL_ERROR_INVALID_DATA," << '\n' << indent()
+          << "               \"missing field\");" << '\n' << indent() << "  return -1;" << '\n'
+          << indent() << "}" << '\n' << '\n';
     }
   }
 
   if (is_function) {
-    indent(out) << "return xfer;" << endl;
+    indent(out) << "return xfer;" << '\n';
   }
 
   // end the function/structure
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 void t_c_glib_generator::generate_serialize_field(ostream& out,
@@ -3773,9 +3771,9 @@
     } else {
       out << "i32 (protocol, (gint32) " << name;
     }
-    out << ", error)) < 0)" << endl
-        << indent() << "  return " << error_ret << ";" << endl
-        << indent() << "xfer += ret;" << endl << endl;
+    out << ", error)) < 0)" << '\n'
+        << indent() << "  return " << error_ret << ";" << '\n'
+        << indent() << "xfer += ret;" << '\n' << '\n';
   } else {
     throw std::logic_error("DO NOT KNOW HOW TO SERIALIZE FIELD '" + name + "' TYPE '"
                            + type_name(type));
@@ -3788,8 +3786,8 @@
                                                    int error_ret) {
   (void)tstruct;
   out << indent() << "if ((ret = thrift_struct_write (THRIFT_STRUCT (" << prefix
-      << "), protocol, error)) < 0)" << endl << indent() << "  return " << error_ret << ";" << endl
-      << indent() << "xfer += ret;" << endl << endl;
+      << "), protocol, error)) < 0)" << '\n' << indent() << "  return " << error_ret << ";" << '\n'
+      << indent() << "xfer += ret;" << '\n' << '\n';
 }
 
 void t_c_glib_generator::generate_serialize_container(ostream& out,
@@ -3826,39 +3824,39 @@
      * This is because we may exit early before we get a chance to free the
      * GList.
      */
-    out << indent() << "GList *key_list = NULL, *iter = NULL;" << endl
-        << indent() << tkey_name << tkey_ptr << "* keys;" << endl
-        << indent() << "int i = 0, key_count;" << endl
-        << endl
+    out << indent() << "GList *key_list = NULL, *iter = NULL;" << '\n'
+        << indent() << tkey_name << tkey_ptr << "* keys;" << '\n'
+        << indent() << "int i = 0, key_count;" << '\n'
+        << '\n'
         << indent() << "if ((ret = thrift_protocol_write_map_begin (protocol, "
         << type_to_enum(tkey) << ", " << type_to_enum(tval) << ", " << prefix << " ? "
         << "(gint32) g_hash_table_size ((GHashTable *) " << prefix << ") : 0"
-        << ", error)) < 0)" << endl;
+        << ", error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << indent() << "if (" << prefix << ")" << endl
+    out << indent() << "xfer += ret;" << '\n'
+        << indent() << "if (" << prefix << ")" << '\n'
         << indent() << "  g_hash_table_foreach ((GHashTable *) " << prefix
-        << ", thrift_hash_table_get_keys, &key_list);" << endl
-        << indent() << "key_count = g_list_length (key_list);" << endl
+        << ", thrift_hash_table_get_keys, &key_list);" << '\n'
+        << indent() << "key_count = g_list_length (key_list);" << '\n'
         << indent() << "keys = g_newa (" << tkey_name << tkey_ptr
-        << ", key_count);" << endl
+        << ", key_count);" << '\n'
         << indent() << "for (iter = g_list_first (key_list); iter; "
-           "iter = iter->next)" << endl;
+           "iter = iter->next)" << '\n';
     indent_up();
     out << indent() << "keys[i++] = (" << tkey_name << tkey_ptr
-        << ") iter->data;" << endl;
+        << ") iter->data;" << '\n';
     indent_down();
-    out << indent() << "g_list_free (key_list);" << endl
-        << endl
-        << indent() << "for (i = 0; i < key_count; ++i)" << endl;
+    out << indent() << "g_list_free (key_list);" << '\n'
+        << '\n'
+        << indent() << "for (i = 0; i < key_count; ++i)" << '\n';
     scope_up(out);
-    out << indent() << keyname << " = keys[i];" << endl
+    out << indent() << keyname << " = keys[i];" << '\n'
         << indent() << valname << " = (" << tval_name << tval_ptr
         << ") g_hash_table_lookup (((GHashTable *) " << prefix
-        << "), (gpointer) " << keyname << ");" << endl
-        << endl;
+        << "), (gpointer) " << keyname << ");" << '\n'
+        << '\n';
     generate_serialize_map_element(out,
                                    (t_map*)ttype,
                                    tkey_ptr + " " + keyname,
@@ -3866,84 +3864,84 @@
                                    error_ret);
     scope_down(out);
     out << indent() << "if ((ret = thrift_protocol_write_map_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl;
+    out << indent() << "xfer += ret;" << '\n';
   } else if (ttype->is_set()) {
     t_type* telem = ((t_set*)ttype)->get_elem_type();
     string telem_name = type_name(telem);
     string telem_ptr = telem->is_string() || !telem->is_base_type() ? "" : "*";
-    out << indent() << "GList *key_list = NULL, *iter = NULL;" << endl
-        << indent() << telem_name << telem_ptr << "* keys;" << endl
-        << indent() << "int i = 0, key_count;" << endl
-        << indent() << telem_name << telem_ptr << " elem;" << endl
-        << indent() << "gpointer value;" << endl
-        << indent() << "THRIFT_UNUSED_VAR (value);" << endl
-        << endl
+    out << indent() << "GList *key_list = NULL, *iter = NULL;" << '\n'
+        << indent() << telem_name << telem_ptr << "* keys;" << '\n'
+        << indent() << "int i = 0, key_count;" << '\n'
+        << indent() << telem_name << telem_ptr << " elem;" << '\n'
+        << indent() << "gpointer value;" << '\n'
+        << indent() << "THRIFT_UNUSED_VAR (value);" << '\n'
+        << '\n'
         << indent() << "if ((ret = thrift_protocol_write_set_begin (protocol, "
         << type_to_enum(telem) << ", " << prefix << " ? "
         << "(gint32) g_hash_table_size ((GHashTable *) " << prefix << ") : 0"
-        << ", error)) < 0)" << endl;
+        << ", error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << indent() << "if (" << prefix << ")" << endl
+    out << indent() << "xfer += ret;" << '\n'
+        << indent() << "if (" << prefix << ")" << '\n'
         << indent() << "  g_hash_table_foreach ((GHashTable *) " << prefix
-        << ", thrift_hash_table_get_keys, &key_list);" << endl
-        << indent() << "key_count = g_list_length (key_list);" << endl
+        << ", thrift_hash_table_get_keys, &key_list);" << '\n'
+        << indent() << "key_count = g_list_length (key_list);" << '\n'
         << indent() << "keys = g_newa (" << telem_name << telem_ptr
-        << ", key_count);" << endl
+        << ", key_count);" << '\n'
         << indent() << "for (iter = g_list_first (key_list); iter; "
-           "iter = iter->next)" << endl;
+           "iter = iter->next)" << '\n';
     indent_up();
     out << indent() << "keys[i++] = (" << telem_name << telem_ptr
-        << ") iter->data;" << endl;
+        << ") iter->data;" << '\n';
     indent_down();
-    out << indent() << "g_list_free (key_list);" << endl
-        << endl
-        << indent() << "for (i = 0; i < key_count; ++i)" << endl;
+    out << indent() << "g_list_free (key_list);" << '\n'
+        << '\n'
+        << indent() << "for (i = 0; i < key_count; ++i)" << '\n';
     scope_up(out);
-    out << indent() << "elem = keys[i];" << endl
+    out << indent() << "elem = keys[i];" << '\n'
         << indent() << "value = (gpointer) g_hash_table_lookup "
-           "(((GHashTable *) " << prefix << "), (gpointer) elem);" << endl
-        << endl;
+           "(((GHashTable *) " << prefix << "), (gpointer) elem);" << '\n'
+        << '\n';
     generate_serialize_set_element(out,
                                    (t_set*)ttype,
                                    telem_ptr + "elem",
                                    error_ret);
     scope_down(out);
     out << indent() << "if ((ret = thrift_protocol_write_set_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl;
+    out << indent() << "xfer += ret;" << '\n';
   } else if (ttype->is_list()) {
     string length = "(" + prefix + " ? " + prefix + "->len : 0)";
     string i = tmp("i");
-    out << indent() << "guint " << i << ";" << endl
-        << endl
+    out << indent() << "guint " << i << ";" << '\n'
+        << '\n'
         << indent() << "if ((ret = thrift_protocol_write_list_begin (protocol, "
         << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", (gint32) "
-        << length << ", error)) < 0)" << endl;
+        << length << ", error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
+    out << indent() << "xfer += ret;" << '\n'
         << indent() << "for (" << i << " = 0; " << i << " < " << length << "; "
-        << i << "++)" << endl;
+        << i << "++)" << '\n';
     scope_up(out);
     generate_serialize_list_element(out, (t_list*)ttype, prefix, i, error_ret);
     scope_down(out);
     out << indent() << "if ((ret = thrift_protocol_write_list_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl;
+    out << indent() << "xfer += ret;" << '\n';
   }
 
   scope_down(out);
@@ -4023,11 +4021,11 @@
   } else if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     if (tbase == t_base_type::TYPE_STRING) {
-      indent(out) << "if (" << name << " != NULL)" << endl << indent() << "{" << endl;
+      indent(out) << "if (" << name << " != NULL)" << '\n' << indent() << "{" << '\n';
       indent_up();
-      indent(out) << "g_free(" << name << ");" << endl << indent() << name << " = NULL;" << endl;
+      indent(out) << "g_free(" << name << ");" << '\n' << indent() << name << " = NULL;" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
     indent(out) << "if ((ret = thrift_protocol_read_";
 
@@ -4063,22 +4061,22 @@
     default:
       throw "compiler error: no C reader for base type " + t_base_type::t_base_name(tbase) + name;
     }
-    out << ", error)) < 0)" << endl;
-    out << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;"
-        << endl;
+    out << ", error)) < 0)" << '\n';
+    out << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;"
+        << '\n';
 
     // load the byte array with the data
     if (tbase == t_base_type::TYPE_STRING && type->is_binary()) {
-      indent(out) << name << " = g_byte_array_new();" << endl;
-      indent(out) << "g_byte_array_append (" << name << ", (guint8 *) data, (guint) len);" << endl;
-      indent(out) << "g_free (data);" << endl;
+      indent(out) << name << " = g_byte_array_new();" << '\n';
+      indent(out) << "g_byte_array_append (" << name << ", (guint8 *) data, (guint) len);" << '\n';
+      indent(out) << "g_free (data);" << '\n';
     }
   } else if (type->is_enum()) {
     string t = tmp("ecast");
-    out << indent() << "gint32 " << t << ";" << endl << indent()
-        << "if ((ret = thrift_protocol_read_i32 (protocol, &" << t << ", error)) < 0)" << endl
-        << indent() << "  return " << error_ret << ";" << endl << indent() << "xfer += ret;" << endl
-        << indent() << name << " = (" << type_name(type) << ")" << t << ";" << endl;
+    out << indent() << "gint32 " << t << ";" << '\n' << indent()
+        << "if ((ret = thrift_protocol_read_i32 (protocol, &" << t << ", error)) < 0)" << '\n'
+        << indent() << "  return " << error_ret << ";" << '\n' << indent() << "xfer += ret;" << '\n'
+        << indent() << name << " = (" << type_name(type) << ")" << t << ";" << '\n';
   } else {
     throw std::logic_error("DO NOT KNOW HOW TO SERIALIZE FIELD '" + tfield->get_name() + "' TYPE '"
                            + type_name(type));
@@ -4088,9 +4086,9 @@
   // set the isset variable.  if the type is required, then set the
   // local variable indicating the value was set, so that we can do    // validation later.
   if (prefix != "" && tfield->get_req() != t_field::T_REQUIRED) {
-    indent(out) << prefix << "__isset_" << tfield->get_name() << suffix << " = TRUE;" << endl;
+    indent(out) << prefix << "__isset_" << tfield->get_name() << suffix << " = TRUE;" << '\n';
   } else if (prefix != "" && tfield->get_req() == t_field::T_REQUIRED) {
-    indent(out) << "isset_" << tfield->get_name() << " = TRUE;" << endl;
+    indent(out) << "isset_" << tfield->get_name() << " = TRUE;" << '\n';
   }
 }
 
@@ -4101,30 +4099,30 @@
                                                      bool allocate) {
   string name_uc = to_upper_case(initial_caps_to_underscores(tstruct->get_name()));
   if (tstruct->is_xception()) {
-    out << indent() << "/* This struct is an exception */" << endl;
+    out << indent() << "/* This struct is an exception */" << '\n';
     allocate = true;
   }
 
   if (allocate) {
-    out << indent() << "if ( " << prefix << " != NULL)" << endl << indent() << "{" << endl;
+    out << indent() << "if ( " << prefix << " != NULL)" << '\n' << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "g_object_unref (" << prefix << ");" << endl;
+    out << indent() << "g_object_unref (" << prefix << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl << indent() << prefix << " = g_object_new (" << this->nspace_uc
-        << "TYPE_" << name_uc << ", NULL);" << endl;
+    out << indent() << "}" << '\n' << indent() << prefix << " = g_object_new (" << this->nspace_uc
+        << "TYPE_" << name_uc << ", NULL);" << '\n';
   }
   out << indent() << "if ((ret = thrift_struct_read (THRIFT_STRUCT (" << prefix
-      << "), protocol, error)) < 0)" << endl << indent() << "{" << endl;
+      << "), protocol, error)) < 0)" << '\n' << indent() << "{" << '\n';
   indent_up();
   if (allocate) {
-    indent(out) << "g_object_unref (" << prefix << ");" << endl;
+    indent(out) << "g_object_unref (" << prefix << ");" << '\n';
     if (tstruct->is_xception()) {
-      indent(out) << prefix << " = NULL;" << endl;
+      indent(out) << prefix << " = NULL;" << '\n';
     }
   }
-  out << indent() << "return " << error_ret << ";" << endl;
+  out << indent() << "return " << error_ret << ";" << '\n';
   indent_down();
-  out << indent() << "}" << endl << indent() << "xfer += ret;" << endl;
+  out << indent() << "}" << '\n' << indent() << "xfer += ret;" << '\n';
 }
 
 void t_c_glib_generator::generate_deserialize_container(ostream& out,
@@ -4134,80 +4132,80 @@
   scope_up(out);
 
   if (ttype->is_map()) {
-    out << indent() << "guint32 size;" << endl
-        << indent() << "guint32 i;" << endl
-        << indent() << "ThriftType key_type;" << endl
-        << indent() << "ThriftType value_type;" << endl
-        << endl
-        << indent() << "/* read the map begin marker */" << endl
+    out << indent() << "guint32 size;" << '\n'
+        << indent() << "guint32 i;" << '\n'
+        << indent() << "ThriftType key_type;" << '\n'
+        << indent() << "ThriftType value_type;" << '\n'
+        << '\n'
+        << indent() << "/* read the map begin marker */" << '\n'
         << indent() << "if ((ret = thrift_protocol_read_map_begin (protocol, "
-           "&key_type, &value_type, &size, error)) < 0)" << endl;
+           "&key_type, &value_type, &size, error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << endl;
+    out << indent() << "xfer += ret;" << '\n'
+        << '\n';
 
     // iterate over map elements
-    out << indent() << "/* iterate through each of the map's fields */" << endl
-        << indent() << "for (i = 0; i < size; i++)" << endl;
+    out << indent() << "/* iterate through each of the map's fields */" << '\n'
+        << indent() << "for (i = 0; i < size; i++)" << '\n';
     scope_up(out);
     generate_deserialize_map_element(out, (t_map*)ttype, prefix, error_ret);
     scope_down(out);
-    out << endl;
+    out << '\n';
 
     // read map end
-    out << indent() << "/* read the map end marker */" << endl
+    out << indent() << "/* read the map end marker */" << '\n'
         << indent() << "if ((ret = thrift_protocol_read_map_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl;
+    out << indent() << "xfer += ret;" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << "guint32 size;" << endl
-        << indent() << "guint32 i;" << endl
-        << indent() << "ThriftType element_type;" << endl
-        << endl
+    out << indent() << "guint32 size;" << '\n'
+        << indent() << "guint32 i;" << '\n'
+        << indent() << "ThriftType element_type;" << '\n'
+        << '\n'
         << indent() << "if ((ret = thrift_protocol_read_set_begin (protocol, "
-           "&element_type, &size, error)) < 0)" << endl;
+           "&element_type, &size, error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << endl;
+    out << indent() << "xfer += ret;" << '\n'
+        << '\n';
 
     // iterate over the elements
-    out << indent() << "/* iterate through the set elements */" << endl
-        << indent() << "for (i = 0; i < size; ++i)" << endl;
+    out << indent() << "/* iterate through the set elements */" << '\n'
+        << indent() << "for (i = 0; i < size; ++i)" << '\n';
     scope_up(out);
     generate_deserialize_set_element(out, (t_set*)ttype, prefix, error_ret);
     scope_down(out);
 
     // read set end
     out << indent() << "if ((ret = thrift_protocol_read_set_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << endl;
+    out << indent() << "xfer += ret;" << '\n'
+        << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << "guint32 size;" << endl
-        << indent() << "guint32 i;" << endl
-        << indent() << "ThriftType element_type;" << endl
-        << endl
+    out << indent() << "guint32 size;" << '\n'
+        << indent() << "guint32 i;" << '\n'
+        << indent() << "ThriftType element_type;" << '\n'
+        << '\n'
         << indent() << "if ((ret = thrift_protocol_read_list_begin (protocol, "
-           "&element_type,&size, error)) < 0)" << endl;
+           "&element_type,&size, error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl
-        << endl;
+    out << indent() << "xfer += ret;" << '\n'
+        << '\n';
 
     // iterate over the elements
-    out << indent() << "/* iterate through list elements */" << endl
-        << indent() << "for (i = 0; i < size; i++)" << endl;
+    out << indent() << "/* iterate through list elements */" << '\n'
+        << indent() << "for (i = 0; i < size; i++)" << '\n';
     scope_up(out);
     generate_deserialize_list_element(out,
                                       (t_list*)ttype,
@@ -4218,11 +4216,11 @@
 
     // read list end
     out << indent() << "if ((ret = thrift_protocol_read_list_end (protocol, "
-           "error)) < 0)" << endl;
+           "error)) < 0)" << '\n';
     indent_up();
-    out << indent() << "return " << error_ret << ";" << endl;
+    out << indent() << "return " << error_ret << ";" << '\n';
     indent_down();
-    out << indent() << "xfer += ret;" << endl;
+    out << indent() << "xfer += ret;" << '\n';
   }
 
   scope_down(out);
@@ -4239,16 +4237,16 @@
   if (ttype->is_map()) {
     t_map* tmap = (t_map*)ttype;
     out << indent() << tname << ptr << " " << name << " = "
-        << generate_new_hash_from_type(tmap->get_key_type(), tmap->get_val_type()) << endl;
+        << generate_new_hash_from_type(tmap->get_key_type(), tmap->get_val_type()) << '\n';
   } else if (ttype->is_list()) {
     t_list* tlist = (t_list*)ttype;
     out << indent() << tname << ptr << " " << name << " = "
-        << generate_new_array_from_type(tlist->get_elem_type()) << endl;
+        << generate_new_array_from_type(tlist->get_elem_type()) << '\n';
   } else if (for_hash_table && ttype->is_enum()) {
-    out << indent() << tname << " " << name << ";" << endl;
+    out << indent() << tname << " " << name << ";" << '\n';
   } else {
     out << indent() << tname << ptr << " " << name
-        << (ptr != "" ? " = g_new (" + tname + ", 1)" : " = NULL") << ";" << endl;
+        << (ptr != "" ? " = g_new (" + tname + ", 1)" : " = NULL") << ";" << '\n';
   }
 }
 
@@ -4259,7 +4257,7 @@
   ttype = get_true_type(ttype);
   string ptr = ttype->is_string() || !ttype->is_base_type() ? " " : "* ";
   string init_val = ttype->is_enum() ? "" : " = NULL";
-  out << indent() << tname << ptr << name << init_val << ";" << endl;
+  out << indent() << tname << ptr << name << init_val << ";" << '\n';
 }
 
 void t_c_glib_generator::generate_deserialize_map_element(ostream& out,
@@ -4289,10 +4287,10 @@
   t_field fval(tval, tval_ptr + valname);
   generate_deserialize_field(out, &fval, "", "", error_ret);
 
-  indent(out) << "if (" << prefix << " && " << keyname << ")" << endl;
+  indent(out) << "if (" << prefix << " && " << keyname << ")" << '\n';
   indent_up();
   indent(out) << "g_hash_table_insert ((GHashTable *)" << prefix << ", (gpointer) " << keyname
-              << ", (gpointer) " << valname << ");" << endl;
+              << ", (gpointer) " << valname << ");" << '\n';
   indent_down();
 }
 
@@ -4309,10 +4307,10 @@
   t_field felem(telem, telem_ptr + elem);
   generate_deserialize_field(out, &felem, "", "", error_ret);
 
-  indent(out) << "if (" << prefix << " && " << elem << ")" << endl;
+  indent(out) << "if (" << prefix << " && " << elem << ")" << '\n';
   indent_up();
   indent(out) << "g_hash_table_insert ((GHashTable *) " << prefix << ", (gpointer) " << elem
-              << ", (gpointer) " << elem << ");" << endl;
+              << ", (gpointer) " << elem << ");" << '\n';
   indent_down();
 }
 
@@ -4334,10 +4332,10 @@
   if (ttype->is_void()) {
     throw std::runtime_error("compiler error: list element type cannot be void");
   } else if (is_numeric(ttype)) {
-    indent(out) << "g_array_append_vals (" << prefix << ", " << elem << ", 1);" << endl;
-    indent(out) << "g_free (" << elem << ");" << endl;
+    indent(out) << "g_array_append_vals (" << prefix << ", " << elem << ", 1);" << '\n';
+    indent(out) << "g_free (" << elem << ");" << '\n';
   } else {
-    indent(out) << "g_ptr_array_add (" << prefix << ", " << elem << ");" << endl;
+    indent(out) << "g_ptr_array_add (" << prefix << ", " << elem << ");" << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_cl_generator.cc b/compiler/cpp/src/thrift/generate/t_cl_generator.cc
index e0dcc46..dccecdc 100644
--- a/compiler/cpp/src/thrift/generate/t_cl_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cl_generator.cc
@@ -130,9 +130,9 @@
   string f_vars_name = program_dir + "/" + program_name_ + "-vars.lisp";
 
   f_types_.open(f_types_name);
-  f_types_ << cl_autogen_comment() << endl;
+  f_types_ << cl_autogen_comment() << '\n';
   f_vars_.open(f_vars_name);
-  f_vars_ << cl_autogen_comment() << endl;
+  f_vars_ << cl_autogen_comment() << '\n';
 
   package_def(f_types_);
   package_in(f_types_);
@@ -141,7 +141,7 @@
   if (!no_asd) {
     string f_asd_name = program_dir + "/" + system_prefix + program_name_ + ".asd";
     f_asd_.open(f_asd_name);
-    f_asd_ << cl_autogen_comment() << endl;
+    f_asd_ << cl_autogen_comment() << '\n';
     asdf_def(f_asd_);
   }
 }
@@ -197,13 +197,13 @@
 }
 
 void t_cl_generator::asdf_def(std::ostream &out) {
-  out << "(asdf:defsystem #:" << system_prefix << program_name_ << endl;
+  out << "(asdf:defsystem #:" << system_prefix << program_name_ << '\n';
   indent_up();
   out << indent() << render_includes()
-      << indent() << ":serial t" << endl
+      << indent() << ":serial t" << '\n'
       << indent() << ":components ("
       << "(:file \"" << program_name_ << "-types\") "
-      << "(:file \"" << program_name_ << "-vars\")))" << endl;
+      << "(:file \"" << program_name_ << "-vars\")))" << '\n';
   indent_down();
 }
 
@@ -221,11 +221,11 @@
     }
     out << ")";
   }
-  out << ")" << endl << endl;
+  out << ")" << '\n' << '\n';
 }
 
 void t_cl_generator::package_in(std::ostream &out) {
-  out << "(cl:in-package :" << package() << ")" << endl << endl;
+  out << "(cl:in-package :" << package() << ")" << '\n' << '\n';
 }
 
 /**
@@ -238,7 +238,7 @@
 }
 
 void t_cl_generator::generate_enum(t_enum* tenum) {
-  f_types_ << "(thrift:def-enum " << prefix(tenum->get_name()) << endl;
+  f_types_ << "(thrift:def-enum " << prefix(tenum->get_name()) << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
@@ -249,12 +249,12 @@
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     value = (*c_iter)->get_value();
 
-    if(c_iter != constants.begin()) f_types_ << endl << indent() << " ";
+    if(c_iter != constants.begin()) f_types_ << '\n' << indent() << " ";
 
     f_types_ << "(\"" << (*c_iter)->get_name() << "\" . " << value << ")";
   }
   indent_down();
-  f_types_ << "))" << endl << endl;
+  f_types_ << "))" << '\n' << '\n';
 }
 
 /**
@@ -266,7 +266,7 @@
   t_const_value* value = tconst->get_value();
 
   f_vars_ << "(thrift:def-constant " << prefix(name) << " " << render_const_value(type, value) << ")"
-          << endl << endl;
+          << '\n' << '\n';
 }
 
 /**
@@ -306,7 +306,7 @@
     indent(out) << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
     out << (type->is_struct() ? "(make-instance '" : "(make-exception '") <<
-           lowercase(type->get_name()) << " " << endl;
+           lowercase(type->get_name()) << " " << '\n';
     indent_up();
 
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
@@ -326,7 +326,7 @@
       }
 
       out << indent() << ":" << v_iter->first->get_string() << " " <<
-        render_const_value(field_type, v_iter->second) << endl;
+        render_const_value(field_type, v_iter->second) << '\n';
     }
     out << indent() << ")";
 
@@ -340,7 +340,7 @@
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << endl << indent()
+      out << '\n' << indent()
           << "(cl:cons " << render_const_value(ktype, v_iter->first) << " "
           << render_const_value(vtype, v_iter->second) << ")";
     }
@@ -354,16 +354,16 @@
       etype = ((t_set*)type)->get_elem_type();
     }
     if (type->is_set()) {
-      out << "(thrift:set" << endl;
+      out << "(thrift:set" << '\n';
     } else {
-      out << "(thrift:list" << endl;
+      out << "(thrift:list" << '\n';
     }
     indent_up();
     indent_up();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << render_const_value(etype, *v_iter) << endl;
+      out << indent() << render_const_value(etype, *v_iter) << '\n';
     }
     out << indent() << ")";
     indent_down();
@@ -394,7 +394,7 @@
     t_type* type = (*m_iter)->get_type();
 
     if (m_iter != members.begin()) {
-      out << endl << indent() << " ";
+      out << '\n' << indent() << " ";
     }
     out << "(" << prefix((*m_iter)->get_name()) << " " <<
         ( (nullptr != value) ? render_const_value(type, value) : "nil" ) <<
@@ -421,16 +421,16 @@
 void t_cl_generator::generate_cl_struct(std::ostream& out, t_struct* tstruct, bool is_exception = false) {
   std::string name = type_name(tstruct);
   out << (is_exception ? "(thrift:def-exception " : "(thrift:def-struct ") <<
-      prefix(name) << endl;
+      prefix(name) << '\n';
   indent_up();
   if ( tstruct->has_doc() ) {
     out << indent() ;
-    out << "\"" << cl_docstring(tstruct->get_doc()) << "\"" << endl;
+    out << "\"" << cl_docstring(tstruct->get_doc()) << "\"" << '\n';
   }
   out << indent() ;
   generate_cl_struct_internal(out, tstruct, is_exception);
   indent_down();
-  out << ")" << endl << endl;
+  out << ")" << '\n' << '\n';
 }
 
 void t_cl_generator::generate_exception_sig(std::ostream& out, t_function* f) {
@@ -454,7 +454,7 @@
   indent_up();
 
   if ( tservice->has_doc()) {
-      f_types_ << endl << indent()
+      f_types_ << '\n' << indent()
                << "(:documentation \"" << cl_docstring(tservice->get_doc()) << "\")";
     }
 
@@ -465,23 +465,23 @@
     t_struct* exceptions = function->get_xceptions();
     const vector<t_field*>& xmembers = exceptions->get_members();
 
-    f_types_ << endl << indent() << "(:method " << prefix(fname);
+    f_types_ << '\n' << indent() << "(:method " << prefix(fname);
     f_types_ << " (" << signature << " "  << typespec((*f_iter)->get_returntype()) << ")";
     if (xmembers.size() > 0) {
-      f_types_ << endl << indent() << " :exceptions " ;
+      f_types_ << '\n' << indent() << " :exceptions " ;
       generate_exception_sig(f_types_, function);
     }
     if ( (*f_iter)->is_oneway() ) {
-      f_types_ << endl << indent() << " :oneway t";
+      f_types_ << '\n' << indent() << " :oneway t";
     }
     if ( (*f_iter)->has_doc() ) {
-      f_types_ << endl << indent() << " :documentation \""
+      f_types_ << '\n' << indent() << " :documentation \""
                << cl_docstring((*f_iter)->get_doc()) << "\"";
   }
     f_types_ << ")";
   }
 
-  f_types_ << ")" << endl << endl;
+  f_types_ << ")" << '\n' << '\n';
 
   indent_down();
 }
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index e21252e..dc74a92 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -42,8 +42,6 @@
 using std::string;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * C++ code generator. This is legitimacy incarnate.
  *
@@ -438,69 +436,69 @@
   f_types_tcc_ << autogen_comment();
 
   // Start ifndef
-  f_types_ << "#ifndef " << program_name_ << "_TYPES_H" << endl << "#define " << program_name_
-           << "_TYPES_H" << endl << endl;
-  f_types_tcc_ << "#ifndef " << program_name_ << "_TYPES_TCC" << endl << "#define " << program_name_
-               << "_TYPES_TCC" << endl << endl;
+  f_types_ << "#ifndef " << program_name_ << "_TYPES_H" << '\n' << "#define " << program_name_
+           << "_TYPES_H" << '\n' << '\n';
+  f_types_tcc_ << "#ifndef " << program_name_ << "_TYPES_TCC" << '\n' << "#define " << program_name_
+               << "_TYPES_TCC" << '\n' << '\n';
 
   // Include base types
-  f_types_ << "#include <iosfwd>" << endl
-           << endl
-           << "#include <thrift/Thrift.h>" << endl
-           << "#include <thrift/TApplicationException.h>" << endl
-           << "#include <thrift/TBase.h>" << endl
-           << "#include <thrift/protocol/TProtocol.h>" << endl
-           << "#include <thrift/transport/TTransport.h>" << endl
-           << endl;
+  f_types_ << "#include <iosfwd>" << '\n'
+           << '\n'
+           << "#include <thrift/Thrift.h>" << '\n'
+           << "#include <thrift/TApplicationException.h>" << '\n'
+           << "#include <thrift/TBase.h>" << '\n'
+           << "#include <thrift/protocol/TProtocol.h>" << '\n'
+           << "#include <thrift/transport/TTransport.h>" << '\n'
+           << '\n';
   // Include C++xx compatibility header
-  f_types_ << "#include <functional>" << endl;
-  f_types_ << "#include <memory>" << endl;
+  f_types_ << "#include <functional>" << '\n';
+  f_types_ << "#include <memory>" << '\n';
 
   // Include other Thrift includes
   const vector<t_program*>& includes = program_->get_includes();
   for (auto include : includes) {
     f_types_ << "#include \"" << get_include_prefix(*include) << include->get_name()
-             << "_types.h\"" << endl;
+             << "_types.h\"" << '\n';
 
     // XXX(simpkins): If gen_templates_ is enabled, we currently assume all
     // included files were also generated with templates enabled.
     f_types_tcc_ << "#include \"" << get_include_prefix(*include) << include->get_name()
-                 << "_types.tcc\"" << endl;
+                 << "_types.tcc\"" << '\n';
   }
-  f_types_ << endl;
+  f_types_ << '\n';
 
   // Include custom headers
   const vector<string>& cpp_includes = program_->get_cpp_includes();
   for (const auto & cpp_include : cpp_includes) {
     if (cpp_include[0] == '<') {
-      f_types_ << "#include " << cpp_include << endl;
+      f_types_ << "#include " << cpp_include << '\n';
     } else {
-      f_types_ << "#include \"" << cpp_include << "\"" << endl;
+      f_types_ << "#include \"" << cpp_include << "\"" << '\n';
     }
   }
-  f_types_ << endl;
+  f_types_ << '\n';
 
   // Include the types file
   f_types_impl_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-                << "_types.h\"" << endl << endl;
+                << "_types.h\"" << '\n' << '\n';
   f_types_tcc_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-               << "_types.h\"" << endl << endl;
+               << "_types.h\"" << '\n' << '\n';
 
   // The swap() code needs <algorithm> for std::swap()
-  f_types_impl_ << "#include <algorithm>" << endl;
+  f_types_impl_ << "#include <algorithm>" << '\n';
   // for operator<<
-  f_types_impl_ << "#include <ostream>" << endl << endl;
-  f_types_impl_ << "#include <thrift/TToString.h>" << endl << endl;
+  f_types_impl_ << "#include <ostream>" << '\n' << '\n';
+  f_types_impl_ << "#include <thrift/TToString.h>" << '\n' << '\n';
 
   // Open namespace
   ns_open_ = namespace_open(program_->get_namespace("cpp"));
   ns_close_ = namespace_close(program_->get_namespace("cpp"));
 
-  f_types_ << ns_open_ << endl << endl;
+  f_types_ << ns_open_ << '\n' << '\n';
 
-  f_types_impl_ << ns_open_ << endl << endl;
+  f_types_impl_ << ns_open_ << '\n' << '\n';
 
-  f_types_tcc_ << ns_open_ << endl << endl;
+  f_types_tcc_ << ns_open_ << '\n' << '\n';
 }
 
 /**
@@ -508,21 +506,21 @@
  */
 void t_cpp_generator::close_generator() {
   // Close namespace
-  f_types_ << ns_close_ << endl << endl;
-  f_types_impl_ << ns_close_ << endl;
-  f_types_tcc_ << ns_close_ << endl << endl;
+  f_types_ << ns_close_ << '\n' << '\n';
+  f_types_impl_ << ns_close_ << '\n';
+  f_types_tcc_ << ns_close_ << '\n' << '\n';
 
   // Include the types.tcc file from the types header file,
   // so clients don't have to explicitly include the tcc file.
   // TODO(simpkins): Make this a separate option.
   if (gen_templates_) {
     f_types_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-             << "_types.tcc\"" << endl << endl;
+             << "_types.tcc\"" << '\n' << '\n';
   }
 
   // Close ifndef
-  f_types_ << "#endif" << endl;
-  f_types_tcc_ << "#endif" << endl;
+  f_types_ << "#endif" << '\n';
+  f_types_tcc_ << "#endif" << '\n';
 
   // Close output file
   f_types_.close();
@@ -544,7 +542,7 @@
 void t_cpp_generator::generate_typedef(t_typedef* ttypedef) {
   generate_java_doc(f_types_, ttypedef);
   f_types_ << indent() << "typedef " << type_name(ttypedef->get_type(), true) << " "
-           << ttypedef->get_symbolic() << ";" << endl << endl;
+           << ttypedef->get_symbolic() << ";" << '\n' << '\n';
 }
 
 void t_cpp_generator::generate_enum_constant_list(std::ostream& f,
@@ -552,7 +550,7 @@
                                                   const char* prefix,
                                                   const char* suffix,
                                                   bool include_values) {
-  f << " {" << endl;
+  f << " {" << '\n';
   indent_up();
 
   vector<t_enum_value*>::const_iterator c_iter;
@@ -561,7 +559,7 @@
     if (first) {
       first = false;
     } else {
-      f << "," << endl;
+      f << "," << '\n';
     }
     generate_java_doc(f, *c_iter);
     indent(f) << prefix << (*c_iter)->get_name() << suffix;
@@ -570,9 +568,9 @@
     }
   }
 
-  f << endl;
+  f << '\n';
   indent_down();
-  indent(f) << "};" << endl;
+  indent(f) << "};" << '\n';
 }
 
 /**
@@ -588,7 +586,7 @@
   if (!gen_pure_enums_) {
     enum_name = "type";
     generate_java_doc(f_types_, tenum);
-    f_types_ << indent() << "struct " << tenum->get_name() << " {" << endl;
+    f_types_ << indent() << "struct " << tenum->get_name() << " {" << '\n';
     indent_up();
   }
   f_types_ << indent() << "enum " << enum_name;
@@ -597,10 +595,10 @@
 
   if (!gen_pure_enums_) {
     indent_down();
-    f_types_ << "};" << endl;
+    f_types_ << "};" << '\n';
   }
 
-  f_types_ << endl;
+  f_types_ << '\n';
 
   /**
      Generate a character array of enum names for debugging purposes.
@@ -617,13 +615,13 @@
   generate_enum_constant_list(f_types_impl_, constants, "\"", "\"", false);
 
   f_types_ << indent() << "extern const std::map<int, const char*> _" << tenum->get_name()
-           << "_VALUES_TO_NAMES;" << endl << endl;
+           << "_VALUES_TO_NAMES;" << '\n' << '\n';
 
   f_types_impl_ << indent() << "const std::map<int, const char*> _" << tenum->get_name()
                 << "_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(" << constants.size() << ", _k"
                 << tenum->get_name() << "Values"
                 << ", _k" << tenum->get_name() << "Names), "
-                << "::apache::thrift::TEnumIterator(-1, nullptr, nullptr));" << endl << endl;
+                << "::apache::thrift::TEnumIterator(-1, nullptr, nullptr));" << '\n' << '\n';
 
   generate_enum_ostream_operator_decl(f_types_, tenum);
   generate_enum_ostream_operator(f_types_impl_, tenum);
@@ -642,8 +640,8 @@
   } else {
     out << tenum->get_name() << "::type&";
   }
-  out << " val);" << endl;
-  out << endl;
+  out << " val);" << '\n';
+  out << '\n';
 }
 
 void t_cpp_generator::generate_enum_ostream_operator(std::ostream& out, t_enum* tenum) {
@@ -662,20 +660,20 @@
     scope_up(out);
 
     out << indent() << "std::map<int, const char*>::const_iterator it = _"
-             << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << endl;
-    out << indent() << "if (it != _" << tenum->get_name() << "_VALUES_TO_NAMES.end()) {" << endl;
+             << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << '\n';
+    out << indent() << "if (it != _" << tenum->get_name() << "_VALUES_TO_NAMES.end()) {" << '\n';
     indent_up();
-    out << indent() << "out << it->second;" << endl;
+    out << indent() << "out << it->second;" << '\n';
     indent_down();
-    out << indent() << "} else {" << endl;
+    out << indent() << "} else {" << '\n';
     indent_up();
-    out << indent() << "out << static_cast<int>(val);" << endl;
+    out << indent() << "out << static_cast<int>(val);" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 
-    out << indent() << "return out;" << endl;
+    out << indent() << "return out;" << '\n';
     scope_down(out);
-    out << endl;
+    out << '\n';
   }
 }
 
@@ -686,8 +684,8 @@
   } else {
     out << tenum->get_name() << "::type&";
   }
-  out << " val);" << endl;
-  out << endl;
+  out << " val);" << '\n';
+  out << '\n';
 }
 
 void t_cpp_generator::generate_enum_to_string_helper_function(std::ostream& out, t_enum* tenum) {
@@ -702,19 +700,19 @@
     scope_up(out);
 
     out << indent() << "std::map<int, const char*>::const_iterator it = _"
-             << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << endl;
-    out << indent() << "if (it != _" << tenum->get_name() << "_VALUES_TO_NAMES.end()) {" << endl;
+             << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << '\n';
+    out << indent() << "if (it != _" << tenum->get_name() << "_VALUES_TO_NAMES.end()) {" << '\n';
     indent_up();
-    out << indent() << "return std::string(it->second);" << endl;
+    out << indent() << "return std::string(it->second);" << '\n';
     indent_down();
-    out << indent() << "} else {" << endl;
+    out << indent() << "} else {" << '\n';
     indent_up();
-    out << indent() << "return std::to_string(static_cast<int>(val));" << endl;
+    out << indent() << "return std::to_string(static_cast<int>(val));" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 
     scope_down(out);
-    out << endl;
+    out << '\n';
   }
 }
 
@@ -736,28 +734,28 @@
     f_consts_impl << autogen_comment();
 
     // Start ifndef
-    f_consts << "#ifndef " << program_name_ << "_CONSTANTS_H" << endl << "#define " << program_name_
-             << "_CONSTANTS_H" << endl << endl << "#include \"" << get_include_prefix(*get_program())
-             << program_name_ << "_types.h\"" << endl << endl << ns_open_ << endl << endl;
+    f_consts << "#ifndef " << program_name_ << "_CONSTANTS_H" << '\n' << "#define " << program_name_
+             << "_CONSTANTS_H" << '\n' << '\n' << "#include \"" << get_include_prefix(*get_program())
+             << program_name_ << "_types.h\"" << '\n' << '\n' << ns_open_ << '\n' << '\n';
 
     f_consts_impl << "#include \"" << get_include_prefix(*get_program()) << program_name_
-                  << "_constants.h\"" << endl << endl << ns_open_ << endl << endl;
+                  << "_constants.h\"" << '\n' << '\n' << ns_open_ << '\n' << '\n';
 
-    f_consts << "class " << program_name_ << "Constants {" << endl << " public:" << endl << "  "
-             << program_name_ << "Constants();" << endl << endl;
+    f_consts << "class " << program_name_ << "Constants {" << '\n' << " public:" << '\n' << "  "
+             << program_name_ << "Constants();" << '\n' << '\n';
     indent_up();
     vector<t_const*>::iterator c_iter;
     for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
       string name = (*c_iter)->get_name();
       t_type* type = (*c_iter)->get_type();
-      f_consts << indent() << type_name(type) << " " << name << ";" << endl;
+      f_consts << indent() << type_name(type) << " " << name << ";" << '\n';
     }
     indent_down();
-    f_consts << "};" << endl;
+    f_consts << "};" << '\n';
 
     f_consts_impl << "const " << program_name_ << "Constants g_" << program_name_ << "_constants;"
-                  << endl << endl << program_name_ << "Constants::" << program_name_
-                  << "Constants() {" << endl;
+                  << '\n' << '\n' << program_name_ << "Constants::" << program_name_
+                  << "Constants() {" << '\n';
     indent_up();
     for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
       print_const_value(f_consts_impl,
@@ -766,13 +764,13 @@
                         (*c_iter)->get_value());
     }
     indent_down();
-    indent(f_consts_impl) << "}" << endl;
+    indent(f_consts_impl) << "}" << '\n';
 
-    f_consts << endl << "extern const " << program_name_ << "Constants g_" << program_name_
-             << "_constants;" << endl << endl << ns_close_ << endl << endl << "#endif" << endl;
+    f_consts << '\n' << "extern const " << program_name_ << "Constants g_" << program_name_
+             << "_constants;" << '\n' << '\n' << ns_close_ << '\n' << '\n' << "#endif" << '\n';
     f_consts.close();
 
-    f_consts_impl << endl << ns_close_ << endl << endl;
+    f_consts_impl << '\n' << ns_close_ << '\n' << '\n';
     f_consts_impl.close();
   }
 }
@@ -789,11 +787,11 @@
   type = get_true_type(type);
   if (type->is_base_type()) {
     string v2 = render_const_value(out, name, type, value);
-    indent(out) << name << " = " << v2 << ";" << endl << endl;
+    indent(out) << name << " = " << v2 << ";" << '\n' << '\n';
   } else if (type->is_enum()) {
     indent(out) << name
                 << " = static_cast<" << type_name(type) << '>'
-                << '(' << value->get_integer() << ");" << endl << endl;
+                << '(' << value->get_integer() << ");" << '\n' << '\n';
   } else if (type->is_struct() || type->is_xception()) {
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -813,12 +811,12 @@
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
       string item_val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << "." << v_iter->first->get_string() << " = " << item_val << ";" << endl;
+      indent(out) << name << "." << v_iter->first->get_string() << " = " << item_val << ";" << '\n';
       if (is_nonrequired_field) {
-        indent(out) << name << ".__isset." << v_iter->first->get_string() << " = true;" << endl;
+        indent(out) << name << ".__isset." << v_iter->first->get_string() << " = true;" << '\n';
       }
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
@@ -827,27 +825,27 @@
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string key = render_const_value(out, name, ktype, v_iter->first);
       string item_val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << ".insert(std::make_pair(" << key << ", " << item_val << "));" << endl;
+      indent(out) << name << ".insert(std::make_pair(" << key << ", " << item_val << "));" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_list()) {
     t_type* etype = ((t_list*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string item_val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << ".push_back(" << item_val << ");" << endl;
+      indent(out) << name << ".push_back(" << item_val << ");" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_set()) {
     t_type* etype = ((t_set*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string item_val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << ".insert(" << item_val << ");" << endl;
+      indent(out) << name << ".insert(" << item_val << ");" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else {
     throw "INVALID TYPE IN print_const_value: " + type->get_name();
   }
@@ -895,7 +893,7 @@
            << '(' << value->get_integer() << ')';
   } else {
     string t = tmp("tmp");
-    indent(out) << type_name(type) << " " << t << ";" << endl;
+    indent(out) << type_name(type) << " " << t << ";" << '\n';
     print_const_value(out, t, type, value);
     render << t;
   }
@@ -905,7 +903,7 @@
 
 void t_cpp_generator::generate_forward_declaration(t_struct* tstruct) {
   // Forward declare struct def
-  f_types_ << indent() << "class " << tstruct->get_name() << ";" << endl << endl;
+  f_types_ << indent() << "class " << tstruct->get_name() << ";" << '\n' << '\n';
 }
 
 /**
@@ -953,25 +951,25 @@
 
   out << indent() << "bool " << tstruct->get_name()
       << "::operator==(const " << tstruct->get_name() << " & "
-      << (members.size() > 0 ? "rhs" : "/* rhs */") << ") const" << endl;
+      << (members.size() > 0 ? "rhs" : "/* rhs */") << ") const" << '\n';
   scope_up(out);
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     // Most existing Thrift code does not use isset or optional/required,
     // so we treat "default" fields as required.
     if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
       out << indent() << "if (!(" << (*m_iter)->get_name() << " == rhs."
-          << (*m_iter)->get_name() << "))" << endl << indent() << "  return false;" << endl;
+          << (*m_iter)->get_name() << "))" << '\n' << indent() << "  return false;" << '\n';
     } else {
       out << indent() << "if (__isset." << (*m_iter)->get_name() << " != rhs.__isset."
-          << (*m_iter)->get_name() << ")" << endl << indent() << "  return false;" << endl
+          << (*m_iter)->get_name() << ")" << '\n' << indent() << "  return false;" << '\n'
           << indent() << "else if (__isset." << (*m_iter)->get_name() << " && !("
-          << (*m_iter)->get_name() << " == rhs." << (*m_iter)->get_name() << "))" << endl
-          << indent() << "  return false;" << endl;
+          << (*m_iter)->get_name() << " == rhs." << (*m_iter)->get_name() << "))" << '\n'
+          << indent() << "  return false;" << '\n';
     }
   }
-  indent(out) << "return true;" << endl;
+  indent(out) << "return true;" << '\n';
   scope_down(out);
-  out << "\n";
+  out << '\n';
 }
 
 bool t_cpp_generator::has_field_with_default_value(t_struct* tstruct)
@@ -1014,7 +1012,7 @@
   // Default-initialize TException, if it is our base type
   if (is_exception)
   {
-    out << "\n";
+    out << '\n';
     indent(out) << " : ";
     out << "TException()";
     init_ctor = true;
@@ -1054,7 +1052,7 @@
   // Start generating body
   //
 
-  out << " {" << endl;
+  out << " {" << '\n';
   indent_up();
   // TODO(dreiss): When everything else in Thrift is perfect,
   // do more of these in the initializer list.
@@ -1111,14 +1109,14 @@
     out << "noexcept ";
   if (is_exception)
     out << ": TException() ";
-  out << "{" << endl;
+  out << "{" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
 
   // eliminate compiler unused warning
   if (members.empty())
-    indent(out) << "(void) " << tmp_name << ";" << endl;
+    indent(out) << "(void) " << tmp_name << ";" << '\n';
 
   vector<t_field*>::const_iterator f_iter;
   bool has_nonrequired_fields = false;
@@ -1129,15 +1127,15 @@
                 << maybeMove(
                     tmp_name + "." + (*f_iter)->get_name(),
                     is_move && is_complex_type((*f_iter)->get_type()))
-                << ";" << endl;
+                << ";" << '\n';
   }
 
   if (has_nonrequired_fields) {
-    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", false) << ";" << endl;
+    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", false) << ";" << '\n';
   }
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_cpp_generator::generate_assignment_operator(ostream& out, t_struct* tstruct) {
@@ -1161,14 +1159,14 @@
   out << tmp_name << ") ";
   if(is_move || is_struct_storage_not_throwing(tstruct))
     out << "noexcept ";
-  out << "{" << endl;
+  out << "{" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
 
   // eliminate compiler unused warning
   if (members.empty())
-    indent(out) << "(void) " << tmp_name << ";" << endl;
+    indent(out) << "(void) " << tmp_name << ";" << '\n';
 
   vector<t_field*>::const_iterator f_iter;
   bool has_nonrequired_fields = false;
@@ -1179,15 +1177,15 @@
                 << maybeMove(
                     tmp_name + "." + (*f_iter)->get_name(),
                     is_move && is_complex_type((*f_iter)->get_type()))
-                << ";" << endl;
+                << ";" << '\n';
   }
   if (has_nonrequired_fields) {
-    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", false) << ";" << endl;
+    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", false) << ";" << '\n';
   }
 
-  indent(out) << "return *this;" << endl;
+  indent(out) << "return *this;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 /**
@@ -1230,7 +1228,7 @@
 
   if (has_nonrequired_fields && (!pointers || read)) {
 
-    out << indent() << "typedef struct _" << tstruct->get_name() << "__isset {" << endl;
+    out << indent() << "typedef struct _" << tstruct->get_name() << "__isset {" << '\n';
     indent_up();
 
     indent(out) << "_" << tstruct->get_name() << "__isset() ";
@@ -1247,58 +1245,58 @@
         out << ", " << (*m_iter)->get_name() << "(" << isSet << ")";
       }
     }
-    out << " {}" << endl;
+    out << " {}" << '\n';
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        indent(out) << "bool " << (*m_iter)->get_name() << " :1;" << endl;
+        indent(out) << "bool " << (*m_iter)->get_name() << " :1;" << '\n';
       }
     }
 
     indent_down();
-    indent(out) << "} _" << tstruct->get_name() << "__isset;" << endl;
+    indent(out) << "} _" << tstruct->get_name() << "__isset;" << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   generate_java_doc(out, tstruct);
 
   // Open struct def
-  out << indent() << "class " << tstruct->get_name() << extends << " {" << endl << indent()
-      << " public:" << endl << endl;
+  out << indent() << "class " << tstruct->get_name() << extends << " {" << '\n' << indent()
+      << " public:" << '\n' << '\n';
   indent_up();
 
   if (!pointers) {
     bool ok_noexcept = is_struct_storage_not_throwing(tstruct);
     // Copy constructor
     indent(out) << tstruct->get_name() << "(const " << tstruct->get_name() << "&)"
-                << (ok_noexcept? " noexcept" : "") << ';' << endl;
+                << (ok_noexcept? " noexcept" : "") << ';' << '\n';
 
     // Move constructor
     if (gen_moveable_) {
       indent(out) << tstruct->get_name() << "(" << tstruct->get_name() << "&&) noexcept;"
-                  << endl;
+                  << '\n';
     }
 
     // Assignment Operator
     indent(out) << tstruct->get_name() << "& operator=(const " << tstruct->get_name() << "&)"
-                << (ok_noexcept? " noexcept" : "") << ';' << endl;
+                << (ok_noexcept? " noexcept" : "") << ';' << '\n';
 
     // Move assignment operator
     if (gen_moveable_) {
       indent(out) << tstruct->get_name() << "& operator=(" << tstruct->get_name() << "&&) noexcept;"
-                  << endl;
+                  << '\n';
     }
 
     bool has_default_value = has_field_with_default_value(tstruct);
 
     // Default constructor
     std::string clsname_ctor = tstruct->get_name() + "()";
-    indent(out) << clsname_ctor << (has_default_value ? "" : " noexcept") << ";" << endl;
+    indent(out) << clsname_ctor << (has_default_value ? "" : " noexcept") << ";" << '\n';
   }
 
   if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) {
-    out << endl << indent() << "virtual ~" << tstruct->get_name() << "() noexcept;" << endl;
+    out << '\n' << indent() << "virtual ~" << tstruct->get_name() << "() noexcept;" << '\n';
   }
 
   // Declare all fields
@@ -1307,12 +1305,12 @@
     indent(out) << declare_field(*m_iter,
                                  false,
                                  (pointers && !(*m_iter)->get_type()->is_xception()),
-                                 !read) << endl;
+                                 !read) << '\n';
   }
 
   // Add the __isset data member if we need it, using the definition from above
   if (has_nonrequired_fields && (!pointers || read)) {
-    out << endl << indent() << "_" << tstruct->get_name() << "__isset __isset;" << endl;
+    out << '\n' << indent() << "_" << tstruct->get_name() << "__isset __isset;" << '\n';
   }
 
   // Create a setter function for each field
@@ -1321,87 +1319,87 @@
       continue;
     }
     if (is_reference((*m_iter))) {
-      out << endl << indent() << "void __set_" << (*m_iter)->get_name() << "(::std::shared_ptr<"
+      out << '\n' << indent() << "void __set_" << (*m_iter)->get_name() << "(::std::shared_ptr<"
           << type_name((*m_iter)->get_type(), false, false) << ">";
-      out << " val);" << endl;
+      out << " val);" << '\n';
     } else {
-      out << endl << indent() << "void __set_" << (*m_iter)->get_name() << "("
+      out << '\n' << indent() << "void __set_" << (*m_iter)->get_name() << "("
           << type_name((*m_iter)->get_type(), false, true);
-      out << " val);" << endl;
+      out << " val);" << '\n';
     }
   }
-  out << endl;
+  out << '\n';
 
   if (!pointers) {
     // Should we generate default operators?
     if (!gen_no_default_operators_) {
       // Generate an equality testing operator.
       out << indent() << "bool operator == (const " << tstruct->get_name() << " & "
-          << (members.size() > 0 ? "rhs" : "/* rhs */") << ") const;" << endl;
+          << (members.size() > 0 ? "rhs" : "/* rhs */") << ") const;" << '\n';
 
       out << indent() << "bool operator != (const " << tstruct->get_name() << " &rhs) const {"
-          << endl << indent() << "  return !(*this == rhs);" << endl << indent() << "}" << endl
-          << endl;
+          << '\n' << indent() << "  return !(*this == rhs);" << '\n' << indent() << "}" << '\n'
+          << '\n';
 
       // Generate the declaration of a less-than operator.  This must be
       // implemented by the application developer if they wish to use it.  (They
       // will get a link error if they try to use it without an implementation.)
-      out << indent() << "bool operator < (const " << tstruct->get_name() << " & ) const;" << endl
-          << endl;
+      out << indent() << "bool operator < (const " << tstruct->get_name() << " & ) const;" << '\n'
+          << '\n';
     }
   }
 
   if (read) {
     if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl << indent()
-          << "uint32_t read(Protocol_* iprot);" << endl;
+      out << indent() << "template <class Protocol_>" << '\n' << indent()
+          << "uint32_t read(Protocol_* iprot);" << '\n';
     } else {
       out << indent() << "uint32_t read("
           << "::apache::thrift::protocol::TProtocol* iprot)";
       if(!is_exception && !extends.empty())
         out << " override";
-      out << ';' << endl;
+      out << ';' << '\n';
     }
   }
   if (write) {
     if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl << indent()
-          << "uint32_t write(Protocol_* oprot) const;" << endl;
+      out << indent() << "template <class Protocol_>" << '\n' << indent()
+          << "uint32_t write(Protocol_* oprot) const;" << '\n';
     } else {
       out << indent() << "uint32_t write("
           << "::apache::thrift::protocol::TProtocol* oprot) const";
       if(!is_exception && !extends.empty())
         out << " override";
-      out << ';' << endl;
+      out << ';' << '\n';
     }
   }
-  out << endl;
+  out << '\n';
 
   if (is_user_struct && !has_custom_ostream(tstruct)) {
     out << indent() << "virtual ";
     generate_struct_print_method_decl(out, nullptr);
-    out << ";" << endl;
+    out << ";" << '\n';
   }
 
   // std::exception::what()
   if (is_exception) {
-    out << indent() << "mutable std::string thriftTExceptionMessageHolder_;" << endl;
+    out << indent() << "mutable std::string thriftTExceptionMessageHolder_;" << '\n';
     out << indent();
     generate_exception_what_method_decl(out, tstruct, false);
-    out << ";" << endl;
+    out << ";" << '\n';
   }
 
   indent_down();
-  indent(out) << "};" << endl << endl;
+  indent(out) << "};" << '\n' << '\n';
 
   if (swap) {
     // Generate a namespace-scope swap() function
     if (tstruct->get_name() == "a" || tstruct->get_name() == "b") {
       out << indent() << "void swap(" << tstruct->get_name() << " &a1, " << tstruct->get_name()
-          << " &a2);" << endl << endl;
+          << " &a2);" << '\n' << '\n';
     } else {
        out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
-           << " &b);" << endl << endl;
+           << " &b);" << '\n' << '\n';
     }
   }
 
@@ -1422,12 +1420,12 @@
 
   // Destructor
   if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) {
-    force_cpp_out << endl << indent() << tstruct->get_name() << "::~" << tstruct->get_name()
-                  << "() noexcept {" << endl;
+    force_cpp_out << '\n' << indent() << tstruct->get_name() << "::~" << tstruct->get_name()
+                  << "() noexcept {" << '\n';
     indent_up();
 
     indent_down();
-    force_cpp_out << indent() << "}" << endl << endl;
+    force_cpp_out << indent() << "}" << '\n' << '\n';
   }
 
   if (!pointers)
@@ -1442,32 +1440,32 @@
   if (setters) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if (is_reference((*m_iter))) {
-        out << endl << indent() << "void " << tstruct->get_name() << "::__set_"
+        out << '\n' << indent() << "void " << tstruct->get_name() << "::__set_"
             << (*m_iter)->get_name() << "(::std::shared_ptr<"
             << type_name((*m_iter)->get_type(), false, false) << ">";
-        out << " val) {" << endl;
+        out << " val) {" << '\n';
       } else {
-        out << endl << indent() << "void " << tstruct->get_name() << "::__set_"
+        out << '\n' << indent() << "void " << tstruct->get_name() << "::__set_"
             << (*m_iter)->get_name() << "(" << type_name((*m_iter)->get_type(), false, true);
-        out << " val) {" << endl;
+        out << " val) {" << '\n';
       }
       indent_up();
-      out << indent() << "this->" << (*m_iter)->get_name() << " = val;" << endl;
+      out << indent() << "this->" << (*m_iter)->get_name() << " = val;" << '\n';
       indent_down();
 
       // assume all fields are required except optional fields.
       // for optional fields change __isset.name to true
       bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
       if (is_optional) {
-        out << indent() << indent() << "__isset." << (*m_iter)->get_name() << " = true;" << endl;
+        out << indent() << indent() << "__isset." << (*m_iter)->get_name() << " = true;" << '\n';
       }
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
   }
   if (is_user_struct) {
     generate_struct_ostream_operator(out, tstruct);
   }
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1478,11 +1476,11 @@
  */
 void t_cpp_generator::generate_struct_reader(ostream& out, t_struct* tstruct, bool pointers) {
   if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::read(Protocol_* iprot) {" << endl;
+    out << indent() << "template <class Protocol_>" << '\n' << indent() << "uint32_t "
+        << tstruct->get_name() << "::read(Protocol_* iprot) {" << '\n';
   } else {
     indent(out) << "uint32_t " << tstruct->get_name()
-                << "::read(::apache::thrift::protocol::TProtocol* iprot) {" << endl;
+                << "::read(::apache::thrift::protocol::TProtocol* iprot) {" << '\n';
   }
   indent_up();
 
@@ -1490,49 +1488,49 @@
   vector<t_field*>::const_iterator f_iter;
 
   // Declare stack tmp variables
-  out << endl
-      << indent() << "::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);" << endl
-      << indent() << "uint32_t xfer = 0;" << endl
-      << indent() << "std::string fname;" << endl
-      << indent() << "::apache::thrift::protocol::TType ftype;" << endl
-      << indent() << "int16_t fid;" << endl
-      << endl
-      << indent() << "xfer += iprot->readStructBegin(fname);" << endl
-      << endl
-      << indent() << "using ::apache::thrift::protocol::TProtocolException;" << endl
-      << endl;
+  out << '\n'
+      << indent() << "::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);" << '\n'
+      << indent() << "uint32_t xfer = 0;" << '\n'
+      << indent() << "std::string fname;" << '\n'
+      << indent() << "::apache::thrift::protocol::TType ftype;" << '\n'
+      << indent() << "int16_t fid;" << '\n'
+      << '\n'
+      << indent() << "xfer += iprot->readStructBegin(fname);" << '\n'
+      << '\n'
+      << indent() << "using ::apache::thrift::protocol::TProtocolException;" << '\n'
+      << '\n';
 
   // Required variables aren't in __isset, so we need tmp vars to check them.
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED)
-      indent(out) << "bool isset_" << (*f_iter)->get_name() << " = false;" << endl;
+      indent(out) << "bool isset_" << (*f_iter)->get_name() << " = false;" << '\n';
   }
-  out << endl;
+  out << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
+  indent(out) << "while (true)" << '\n';
   scope_up(out);
 
   // Read beginning field marker
-  indent(out) << "xfer += iprot->readFieldBegin(fname, ftype, fid);" << endl;
+  indent(out) << "xfer += iprot->readFieldBegin(fname, ftype, fid);" << '\n';
 
   // Check for field STOP marker
-  out << indent() << "if (ftype == ::apache::thrift::protocol::T_STOP) {" << endl << indent()
-      << "  break;" << endl << indent() << "}" << endl;
+  out << indent() << "if (ftype == ::apache::thrift::protocol::T_STOP) {" << '\n' << indent()
+      << "  break;" << '\n' << indent() << "}" << '\n';
 
   if (fields.empty()) {
-    out << indent() << "xfer += iprot->skip(ftype);" << endl;
+    out << indent() << "xfer += iprot->skip(ftype);" << '\n';
   } else {
     // Switch statement on the field we are reading
-    indent(out) << "switch (fid)" << endl;
+    indent(out) << "switch (fid)" << '\n';
 
     scope_up(out);
 
     // Generate deserialization code for known cases
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
+      indent(out) << "case " << (*f_iter)->get_key() << ":" << '\n';
       indent_up();
-      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
       indent_up();
 
       const char* isset_prefix = ((*f_iter)->get_req() != t_field::T_REQUIRED) ? "this->__isset."
@@ -1544,8 +1542,8 @@
           // TODO(dreiss): Generate this code and "if" it out to make it easier
           // for people recompiling thrift to include it.
           out <<
-            indent() << "if (" << isset_prefix << (*f_iter)->get_name() << ")" << endl <<
-            indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl;
+            indent() << "if (" << isset_prefix << (*f_iter)->get_name() << ")" << '\n' <<
+            indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << '\n';
 #endif
 
       if (pointers && !(*f_iter)->get_type()->is_xception()) {
@@ -1553,44 +1551,44 @@
       } else {
         generate_deserialize_field(out, *f_iter, "this->");
       }
-      out << indent() << isset_prefix << (*f_iter)->get_name() << " = true;" << endl;
+      out << indent() << isset_prefix << (*f_iter)->get_name() << " = true;" << '\n';
       indent_down();
-      out << indent() << "} else {" << endl << indent() << "  xfer += iprot->skip(ftype);" << endl
+      out << indent() << "} else {" << '\n' << indent() << "  xfer += iprot->skip(ftype);" << '\n'
           <<
           // TODO(dreiss): Make this an option when thrift structs
           // have a common base class.
-          // indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl <<
-          indent() << "}" << endl << indent() << "break;" << endl;
+          // indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << '\n' <<
+          indent() << "}" << '\n' << indent() << "break;" << '\n';
       indent_down();
     }
 
     // In the default case we skip the field
-    out << indent() << "default:" << endl << indent() << "  xfer += iprot->skip(ftype);" << endl
-        << indent() << "  break;" << endl;
+    out << indent() << "default:" << '\n' << indent() << "  xfer += iprot->skip(ftype);" << '\n'
+        << indent() << "  break;" << '\n';
 
     scope_down(out);
   } //!fields.empty()
   // Read field end marker
-  indent(out) << "xfer += iprot->readFieldEnd();" << endl;
+  indent(out) << "xfer += iprot->readFieldEnd();" << '\n';
 
   scope_down(out);
 
-  out << endl << indent() << "xfer += iprot->readStructEnd();" << endl;
+  out << '\n' << indent() << "xfer += iprot->readStructEnd();" << '\n';
 
   // Throw if any required fields are missing.
   // We do this after reading the struct end so that
   // there might possibly be a chance of continuing.
-  out << endl;
+  out << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED)
-      out << indent() << "if (!isset_" << (*f_iter)->get_name() << ')' << endl << indent()
-          << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl;
+      out << indent() << "if (!isset_" << (*f_iter)->get_name() << ')' << '\n' << indent()
+          << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << '\n';
   }
 
-  indent(out) << "return xfer;" << endl;
+  indent(out) << "return xfer;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1605,33 +1603,33 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << endl;
+    out << indent() << "template <class Protocol_>" << '\n' << indent() << "uint32_t "
+        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << '\n';
   } else {
     indent(out) << "uint32_t " << tstruct->get_name()
-                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << endl;
+                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << '\n';
   }
   indent_up();
 
-  out << indent() << "uint32_t xfer = 0;" << endl;
+  out << indent() << "uint32_t xfer = 0;" << '\n';
 
-  indent(out) << "::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);" << endl;
-  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << endl;
+  indent(out) << "::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);" << '\n';
+  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool check_if_set = (*f_iter)->get_req() == t_field::T_OPTIONAL
                         || (*f_iter)->get_type()->is_xception();
     if (check_if_set) {
-      out << endl << indent() << "if (this->__isset." << (*f_iter)->get_name() << ") {" << endl;
+      out << '\n' << indent() << "if (this->__isset." << (*f_iter)->get_name() << ") {" << '\n';
       indent_up();
     } else {
-      out << endl;
+      out << '\n';
     }
 
     // Write field header
     out << indent() << "xfer += oprot->writeFieldBegin("
         << "\"" << (*f_iter)->get_name() << "\", " << type_to_enum((*f_iter)->get_type()) << ", "
-        << (*f_iter)->get_key() << ");" << endl;
+        << (*f_iter)->get_key() << ");" << '\n';
     // Write field contents
     if (pointers && !(*f_iter)->get_type()->is_xception()) {
       generate_serialize_field(out, *f_iter, "(*(this->", "))");
@@ -1639,22 +1637,22 @@
       generate_serialize_field(out, *f_iter, "this->");
     }
     // Write field closer
-    indent(out) << "xfer += oprot->writeFieldEnd();" << endl;
+    indent(out) << "xfer += oprot->writeFieldEnd();" << '\n';
     if (check_if_set) {
       indent_down();
       indent(out) << '}';
     }
   }
 
-  out << endl;
+  out << '\n';
 
   // Write the struct map
-  out << indent() << "xfer += oprot->writeFieldStop();" << endl << indent()
-      << "xfer += oprot->writeStructEnd();" << endl << indent()
-      << "return xfer;" << endl;
+  out << indent() << "xfer += oprot->writeFieldStop();" << '\n' << indent()
+      << "xfer += oprot->writeStructEnd();" << '\n' << indent()
+      << "return xfer;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1673,35 +1671,35 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << endl;
+    out << indent() << "template <class Protocol_>" << '\n' << indent() << "uint32_t "
+        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << '\n';
   } else {
     indent(out) << "uint32_t " << tstruct->get_name()
-                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << endl;
+                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << '\n';
   }
   indent_up();
 
-  out << endl << indent() << "uint32_t xfer = 0;" << endl << endl;
+  out << '\n' << indent() << "uint32_t xfer = 0;" << '\n' << '\n';
 
-  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << endl;
+  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << '\n';
 
   bool first = true;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (first) {
       first = false;
-      out << endl << indent() << "if ";
+      out << '\n' << indent() << "if ";
     } else {
       out << " else if ";
     }
 
-    out << "(this->__isset." << (*f_iter)->get_name() << ") {" << endl;
+    out << "(this->__isset." << (*f_iter)->get_name() << ") {" << '\n';
 
     indent_up();
 
     // Write field header
     out << indent() << "xfer += oprot->writeFieldBegin("
         << "\"" << (*f_iter)->get_name() << "\", " << type_to_enum((*f_iter)->get_type()) << ", "
-        << (*f_iter)->get_key() << ");" << endl;
+        << (*f_iter)->get_key() << ");" << '\n';
     // Write field contents
     if (pointers) {
       generate_serialize_field(out, *f_iter, "(*(this->", "))");
@@ -1709,18 +1707,18 @@
       generate_serialize_field(out, *f_iter, "this->");
     }
     // Write field closer
-    indent(out) << "xfer += oprot->writeFieldEnd();" << endl;
+    indent(out) << "xfer += oprot->writeFieldEnd();" << '\n';
 
     indent_down();
     indent(out) << "}";
   }
 
   // Write the struct map
-  out << endl << indent() << "xfer += oprot->writeFieldStop();" << endl << indent()
-      << "xfer += oprot->writeStructEnd();" << endl << indent() << "return xfer;" << endl;
+  out << '\n' << indent() << "xfer += oprot->writeFieldStop();" << '\n' << indent()
+      << "xfer += oprot->writeStructEnd();" << '\n' << indent() << "return xfer;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1732,10 +1730,10 @@
 void t_cpp_generator::generate_struct_swap(ostream& out, t_struct* tstruct) {
   if (tstruct->get_name() == "a" || tstruct->get_name() == "b") {
     out << indent() << "void swap(" << tstruct->get_name() << " &a1, " << tstruct->get_name()
-        << " &a2) {" << endl;
+        << " &a2) {" << '\n';
   } else {
     out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
-        << " &b) {" << endl;
+        << " &b) {" << '\n';
   }
 
   indent_up();
@@ -1743,7 +1741,7 @@
   // 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() << "using ::std::swap;" << '\n';
 
   bool has_nonrequired_fields = false;
   const vector<t_field*>& fields = tstruct->get_members();
@@ -1754,41 +1752,41 @@
 
     if (tstruct->get_name() == "a" || tstruct->get_name() == "b") {
       out << indent() << "swap(a1." << tfield->get_name() << ", a2." << tfield->get_name() << ");"
-          << endl;
+          << '\n';
     } else {
       out << indent() << "swap(a." << tfield->get_name() << ", b." << tfield->get_name() << ");"
-          << endl;
+          << '\n';
     }
   }
 
   if (has_nonrequired_fields) {
     if (tstruct->get_name() == "a" || tstruct->get_name() == "b") {
-      out << indent() << "swap(a1.__isset, a2.__isset);" << endl;
+      out << indent() << "swap(a1.__isset, a2.__isset);" << '\n';
     } else {
-      out << indent() << "swap(a.__isset, b.__isset);" << endl;
+      out << indent() << "swap(a.__isset, b.__isset);" << '\n';
     }
   }
 
   // handle empty structs
   if (fields.size() == 0) {
     if (tstruct->get_name() == "a" || tstruct->get_name() == "b") {
-      out << indent() << "(void) a1;" << endl;
-      out << indent() << "(void) a2;" << endl;
+      out << indent() << "(void) a1;" << '\n';
+      out << indent() << "(void) a2;" << '\n';
     } else {
-      out << indent() << "(void) a;" << endl;
-      out << indent() << "(void) b;" << endl;
+      out << indent() << "(void) a;" << '\n';
+      out << indent() << "(void) b;" << '\n';
     }
   }
 
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_cpp_generator::generate_struct_ostream_operator_decl(std::ostream& out, t_struct* tstruct) {
   out << "std::ostream& operator<<(std::ostream& out, const "
       << tstruct->get_name()
-      << "& obj);" << endl;
-  out << endl;
+      << "& obj);" << '\n';
+  out << '\n';
 }
 
 void t_cpp_generator::generate_struct_ostream_operator(std::ostream& out, t_struct* tstruct) {
@@ -1796,12 +1794,12 @@
     // thrift defines this behavior
     out << "std::ostream& operator<<(std::ostream& out, const "
         << tstruct->get_name()
-        << "& obj)" << endl;
+        << "& obj)" << '\n';
     scope_up(out);
-    out << indent() << "obj.printTo(out);" << endl
-        << indent() << "return out;" << endl;
+    out << indent() << "obj.printTo(out);" << '\n'
+        << indent() << "return out;" << '\n';
     scope_down(out);
-    out << endl;
+    out << '\n';
   }
 }
 
@@ -1866,7 +1864,7 @@
     }
 
     generate_field(out, *it);
-    out << ";" << endl;
+    out << ";" << '\n';
   }
 }
 }
@@ -1877,17 +1875,17 @@
 void t_cpp_generator::generate_struct_print_method(std::ostream& out, t_struct* tstruct) {
   out << indent();
   generate_struct_print_method_decl(out, tstruct);
-  out << " {" << endl;
+  out << " {" << '\n';
 
   indent_up();
 
-  out << indent() << "using ::apache::thrift::to_string;" << endl;
-  out << indent() << "out << \"" << tstruct->get_name() << "(\";" << endl;
+  out << indent() << "using ::apache::thrift::to_string;" << '\n';
+  out << indent() << "out << \"" << tstruct->get_name() << "(\";" << '\n';
   struct_ostream_operator_generator::generate_fields(out, tstruct->get_members(), indent());
-  out << indent() << "out << \")\";" << endl;
+  out << indent() << "out << \")\";" << '\n';
 
   indent_down();
-  out << "}" << endl << endl;
+  out << "}" << '\n' << '\n';
 }
 
 /**
@@ -1896,29 +1894,29 @@
 void t_cpp_generator::generate_exception_what_method(std::ostream& out, t_struct* tstruct) {
   out << indent();
   generate_exception_what_method_decl(out, tstruct, true);
-  out << " {" << endl;
+  out << " {" << '\n';
 
   indent_up();
-  out << indent() << "try {" << endl;
+  out << indent() << "try {" << '\n';
 
   indent_up();
-  out << indent() << "std::stringstream ss;" << endl;
-  out << indent() << "ss << \"TException - service has thrown: \" << *this;" << endl;
-  out << indent() << "this->thriftTExceptionMessageHolder_ = ss.str();" << endl;
-  out << indent() << "return this->thriftTExceptionMessageHolder_.c_str();" << endl;
+  out << indent() << "std::stringstream ss;" << '\n';
+  out << indent() << "ss << \"TException - service has thrown: \" << *this;" << '\n';
+  out << indent() << "this->thriftTExceptionMessageHolder_ = ss.str();" << '\n';
+  out << indent() << "return this->thriftTExceptionMessageHolder_.c_str();" << '\n';
   indent_down();
 
-  out << indent() << "} catch (const std::exception&) {" << endl;
+  out << indent() << "} catch (const std::exception&) {" << '\n';
 
   indent_up();
   out << indent() << "return \"TException - service has thrown: " << tstruct->get_name() << "\";"
-      << endl;
+      << '\n';
   indent_down();
 
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 
   indent_down();
-  out << "}" << endl << endl;
+  out << "}" << '\n' << '\n';
 }
 
 /**
@@ -1938,30 +1936,30 @@
 
   // Print header file includes
   f_header_ << autogen_comment();
-  f_header_ << "#ifndef " << svcname << "_H" << endl << "#define " << svcname << "_H" << endl
-            << endl;
+  f_header_ << "#ifndef " << svcname << "_H" << '\n' << "#define " << svcname << "_H" << '\n'
+            << '\n';
   if (gen_cob_style_) {
-    f_header_ << "#include <thrift/transport/TBufferTransports.h>" << endl // TMemoryBuffer
-              << "#include <functional>" << endl
-              << "namespace apache { namespace thrift { namespace async {" << endl
-              << "class TAsyncChannel;" << endl << "}}}" << endl;
+    f_header_ << "#include <thrift/transport/TBufferTransports.h>" << '\n' // TMemoryBuffer
+              << "#include <functional>" << '\n'
+              << "namespace apache { namespace thrift { namespace async {" << '\n'
+              << "class TAsyncChannel;" << '\n' << "}}}" << '\n';
   }
-  f_header_ << "#include <thrift/TDispatchProcessor.h>" << endl;
+  f_header_ << "#include <thrift/TDispatchProcessor.h>" << '\n';
   if (gen_cob_style_) {
-    f_header_ << "#include <thrift/async/TAsyncDispatchProcessor.h>" << endl;
+    f_header_ << "#include <thrift/async/TAsyncDispatchProcessor.h>" << '\n';
   }
-  f_header_ << "#include <thrift/async/TConcurrentClientSyncInfo.h>" << endl;
-  f_header_ << "#include <memory>" << endl;
+  f_header_ << "#include <thrift/async/TConcurrentClientSyncInfo.h>" << '\n';
+  f_header_ << "#include <memory>" << '\n';
   f_header_ << "#include \"" << get_include_prefix(*get_program()) << program_name_ << "_types.h\""
-            << endl;
+            << '\n';
 
   t_service* extends_service = tservice->get_extends();
   if (extends_service != nullptr) {
     f_header_ << "#include \"" << get_include_prefix(*(extends_service->get_program()))
-              << extends_service->get_name() << ".h\"" << endl;
+              << extends_service->get_name() << ".h\"" << '\n';
   }
 
-  f_header_ << endl << ns_open_ << endl << endl;
+  f_header_ << '\n' << ns_open_ << '\n' << '\n';
 
   f_header_ << "#ifdef _MSC_VER\n"
                "  #pragma warning( push )\n"
@@ -1972,30 +1970,30 @@
   string f_service_name = get_out_dir() + svcname + ".cpp";
   f_service_.open(f_service_name.c_str());
   f_service_ << autogen_comment();
-  f_service_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl;
+  f_service_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << '\n';
   if (gen_cob_style_) {
-    f_service_ << "#include \"thrift/async/TAsyncChannel.h\"" << endl;
+    f_service_ << "#include \"thrift/async/TAsyncChannel.h\"" << '\n';
   }
   if (gen_templates_) {
     f_service_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".tcc\""
-               << endl;
+               << '\n';
 
     string f_service_tcc_name = get_out_dir() + svcname + ".tcc";
     f_service_tcc_.open(f_service_tcc_name.c_str());
     f_service_tcc_ << autogen_comment();
     f_service_tcc_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\""
-                   << endl;
+                   << '\n';
 
-    f_service_tcc_ << "#ifndef " << svcname << "_TCC" << endl << "#define " << svcname << "_TCC"
-                   << endl << endl;
+    f_service_tcc_ << "#ifndef " << svcname << "_TCC" << '\n' << "#define " << svcname << "_TCC"
+                   << '\n' << '\n';
 
     if (gen_cob_style_) {
-      f_service_tcc_ << "#include \"thrift/async/TAsyncChannel.h\"" << endl;
+      f_service_tcc_ << "#include \"thrift/async/TAsyncChannel.h\"" << '\n';
     }
   }
 
-  f_service_ << endl << ns_open_ << endl << endl;
-  f_service_tcc_ << endl << ns_open_ << endl << endl;
+  f_service_ << '\n' << ns_open_ << '\n' << '\n';
+  f_service_tcc_ << '\n' << ns_open_ << '\n' << '\n';
 
   // Generate all the components
   generate_service_interface(tservice, "");
@@ -2032,19 +2030,19 @@
                "#endif\n\n";
 
   // Close the namespace
-  f_service_ << ns_close_ << endl << endl;
-  f_service_tcc_ << ns_close_ << endl << endl;
-  f_header_ << ns_close_ << endl << endl;
+  f_service_ << ns_close_ << '\n' << '\n';
+  f_service_tcc_ << ns_close_ << '\n' << '\n';
+  f_header_ << ns_close_ << '\n' << '\n';
 
   // TODO(simpkins): Make this a separate option
   if (gen_templates_) {
-    f_header_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".tcc\"" << endl
+    f_header_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".tcc\"" << '\n'
               << "#include \"" << get_include_prefix(*get_program()) << program_name_
-              << "_types.tcc\"" << endl << endl;
+              << "_types.tcc\"" << '\n' << '\n';
   }
 
-  f_header_ << "#endif" << endl;
-  f_service_tcc_ << "#endif" << endl;
+  f_header_ << "#endif" << '\n';
+  f_service_tcc_ << "#endif" << '\n';
 
   // Close the files
   f_service_tcc_.close();
@@ -2098,9 +2096,9 @@
     if (gen_templates_) {
       client_name += "T";
       service_if_name += "T";
-      indent(f_header_) << "template <class Protocol_>" << endl;
+      indent(f_header_) << "template <class Protocol_>" << '\n';
     }
-    indent(f_header_) << "class " << client_name << ";" << endl << endl;
+    indent(f_header_) << "class " << client_name << ";" << '\n' << '\n';
   }
 
   string extends = "";
@@ -2114,31 +2112,31 @@
   }
 
   if (style == "CobCl" && gen_templates_) {
-    f_header_ << "template <class Protocol_>" << endl;
+    f_header_ << "template <class Protocol_>" << '\n';
   }
 
   generate_java_doc(f_header_, tservice);
 
-  f_header_ << "class " << service_if_name << extends << " {" << endl << " public:" << endl;
+  f_header_ << "class " << service_if_name << extends << " {" << '\n' << " public:" << '\n';
   indent_up();
-  f_header_ << indent() << "virtual ~" << service_if_name << "() {}" << endl;
+  f_header_ << indent() << "virtual ~" << service_if_name << "() {}" << '\n';
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     if ((*f_iter)->has_doc())
-      f_header_ << endl;
+      f_header_ << '\n';
     generate_java_doc(f_header_, *f_iter);
-    f_header_ << indent() << "virtual " << function_signature(*f_iter, style) << " = 0;" << endl;
+    f_header_ << indent() << "virtual " << function_signature(*f_iter, style) << " = 0;" << '\n';
   }
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 
   if (style == "CobCl" && gen_templates_) {
     // generate a backwards-compatible typedef for clients that do not
     // know about the new template-style code
     f_header_ << "typedef " << service_if_name << "< ::apache::thrift::protocol::TProtocol> "
-              << service_name_ << style << "If;" << endl << endl;
+              << service_name_ << style << "If;" << '\n' << '\n';
   }
 }
 
@@ -2181,37 +2179,37 @@
     extends = " : virtual public " + type_name(tservice->get_extends()) + style + "IfFactory";
   }
 
-  f_header_ << "class " << factory_name << extends << " {" << endl << " public:" << endl;
+  f_header_ << "class " << factory_name << extends << " {" << '\n' << " public:" << '\n';
   indent_up();
-  f_header_ << indent() << "typedef " << service_if_name << " Handler;" << endl << endl << indent()
-            << "virtual ~" << factory_name << "() {}" << endl << endl << indent() << "virtual "
+  f_header_ << indent() << "typedef " << service_if_name << " Handler;" << '\n' << '\n' << indent()
+            << "virtual ~" << factory_name << "() {}" << '\n' << '\n' << indent() << "virtual "
             << service_if_name << "* getHandler("
             << "const ::apache::thrift::TConnectionInfo& connInfo)"
-            << (extends.empty() ? "" : " override") << " = 0;" << endl << indent()
+            << (extends.empty() ? "" : " override") << " = 0;" << '\n' << indent()
             << "virtual void releaseHandler(" << base_if_name << "* /* handler */)"
-            << (extends.empty() ? "" : " override") << " = 0;" << endl << indent();
+            << (extends.empty() ? "" : " override") << " = 0;" << '\n' << indent();
 
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 
   // Generate the singleton factory class
   string singleton_factory_name = service_if_name + "SingletonFactory";
   f_header_ << "class " << singleton_factory_name << " : virtual public " << factory_name << " {"
-            << endl << " public:" << endl;
+            << '\n' << " public:" << '\n';
   indent_up();
   f_header_ << indent() << singleton_factory_name << "(const ::std::shared_ptr<" << service_if_name
-            << ">& iface) : iface_(iface) {}" << endl << indent() << "virtual ~"
-            << singleton_factory_name << "() {}" << endl << endl << indent() << "virtual "
+            << ">& iface) : iface_(iface) {}" << '\n' << indent() << "virtual ~"
+            << singleton_factory_name << "() {}" << '\n' << '\n' << indent() << "virtual "
             << service_if_name << "* getHandler("
-            << "const ::apache::thrift::TConnectionInfo&) override {" << endl << indent()
-            << "  return iface_.get();" << endl << indent() << "}" << endl << indent()
-            << "virtual void releaseHandler(" << base_if_name << "* /* handler */) override {}" << endl;
+            << "const ::apache::thrift::TConnectionInfo&) override {" << '\n' << indent()
+            << "  return iface_.get();" << '\n' << indent() << "}" << '\n' << indent()
+            << "virtual void releaseHandler(" << base_if_name << "* /* handler */) override {}" << '\n';
 
-  f_header_ << endl << " protected:" << endl << indent() << "::std::shared_ptr<" << service_if_name
-            << "> iface_;" << endl;
+  f_header_ << '\n' << " protected:" << '\n' << indent() << "::std::shared_ptr<" << service_if_name
+            << "> iface_;" << '\n';
 
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 }
 
 /**
@@ -2225,14 +2223,14 @@
     extends = " , virtual public " + type_name(tservice->get_extends()) + style + "Null";
   }
   f_header_ << "class " << service_name_ << style << "Null : virtual public " << service_name_
-            << style << "If" << extends << " {" << endl << " public:" << endl;
+            << style << "If" << extends << " {" << '\n' << " public:" << '\n';
   indent_up();
-  f_header_ << indent() << "virtual ~" << service_name_ << style << "Null() {}" << endl;
+  f_header_ << indent() << "virtual ~" << service_name_ << style << "Null() {}" << '\n';
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_header_ << indent() << function_signature(*f_iter, style, "", false)
-              << " override {" << endl;
+              << " override {" << '\n';
     indent_up();
 
     t_type* returntype = (*f_iter)->get_returntype();
@@ -2240,18 +2238,18 @@
 
     if (style == "") {
       if (returntype->is_void() || is_complex_type(returntype)) {
-        f_header_ << indent() << "return;" << endl;
+        f_header_ << indent() << "return;" << '\n';
       } else {
-        f_header_ << indent() << declare_field(&returnfield, true) << endl << indent()
-                  << "return _return;" << endl;
+        f_header_ << indent() << declare_field(&returnfield, true) << '\n' << indent()
+                  << "return _return;" << '\n';
       }
     } else if (style == "CobSv") {
       if (returntype->is_void()) {
-        f_header_ << indent() << "return cob();" << endl;
+        f_header_ << indent() << "return cob();" << '\n';
       } else {
         t_field returnfield(returntype, "_return");
-        f_header_ << indent() << declare_field(&returnfield, true) << endl << indent()
-                  << "return cob(_return);" << endl;
+        f_header_ << indent() << declare_field(&returnfield, true) << '\n' << indent()
+                  << "return cob(_return);" << '\n';
       }
 
     } else {
@@ -2259,10 +2257,10 @@
     }
 
     indent_down();
-    f_header_ << indent() << "}" << endl;
+    f_header_ << indent() << "}" << '\n';
   }
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 }
 
 void t_cpp_generator::generate_function_call(ostream& out,
@@ -2293,7 +2291,7 @@
     }
     out << arg_prefix << (*f_iter)->get_name();
   }
-  out << ");" << endl;
+  out << ");" << '\n';
 }
 
 void t_cpp_generator::generate_service_async_skeleton(t_service* tservice) {
@@ -2307,58 +2305,58 @@
   ofstream_with_content_based_conditional_update f_skeleton;
   f_skeleton.open(f_skeleton_name.c_str());
   f_skeleton << "// This autogenerated skeleton file illustrates one way to adapt a synchronous"
-             << endl << "// interface into an asynchronous interface. You should copy it to another"
-             << endl
+             << '\n' << "// interface into an asynchronous interface. You should copy it to another"
+             << '\n'
              << "// filename to avoid overwriting it and rewrite as asynchronous any functions"
-             << endl << "// that would otherwise introduce unwanted latency." << endl << endl
-             << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl
-             << "#include <thrift/protocol/TBinaryProtocol.h>" << endl
-             << "#include <thrift/async/TAsyncProtocolProcessor.h>" << endl
-             << "#include <thrift/async/TEvhttpServer.h>" << endl
-             << "#include <event.h>" << endl
-             << "#include <evhttp.h>" << endl << endl
-             << "using namespace ::apache::thrift;" << endl
-             << "using namespace ::apache::thrift::protocol;" << endl
-             << "using namespace ::apache::thrift::transport;" << endl
-             << "using namespace ::apache::thrift::async;" << endl << endl;
+             << '\n' << "// that would otherwise introduce unwanted latency." << '\n' << '\n'
+             << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << '\n'
+             << "#include <thrift/protocol/TBinaryProtocol.h>" << '\n'
+             << "#include <thrift/async/TAsyncProtocolProcessor.h>" << '\n'
+             << "#include <thrift/async/TEvhttpServer.h>" << '\n'
+             << "#include <event.h>" << '\n'
+             << "#include <evhttp.h>" << '\n' << '\n'
+             << "using namespace ::apache::thrift;" << '\n'
+             << "using namespace ::apache::thrift::protocol;" << '\n'
+             << "using namespace ::apache::thrift::transport;" << '\n'
+             << "using namespace ::apache::thrift::async;" << '\n' << '\n';
 
   // the following code would not compile:
   // using namespace ;
   // using namespace ::;
   if ((!ns.empty()) && (ns.compare(" ::") != 0)) {
-    f_skeleton << "using namespace " << string(ns, 0, ns.size() - 2) << ";" << endl << endl;
+    f_skeleton << "using namespace " << string(ns, 0, ns.size() - 2) << ";" << '\n' << '\n';
   }
 
-  f_skeleton << "class " << svcname << "Handler : virtual public " << svcname << "If {" << endl
-             << " public:" << endl;
+  f_skeleton << "class " << svcname << "Handler : virtual public " << svcname << "If {" << '\n'
+             << " public:" << '\n';
   indent_up();
-  f_skeleton << indent() << svcname << "Handler() {" << endl << indent()
-             << "  // Your initialization goes here" << endl << indent() << "}" << endl << endl;
+  f_skeleton << indent() << svcname << "Handler() {" << '\n' << indent()
+             << "  // Your initialization goes here" << '\n' << indent() << "}" << '\n' << '\n';
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_skeleton, *f_iter);
-    f_skeleton << indent() << function_signature(*f_iter, "") << " {" << endl << indent()
-               << "  // Your implementation goes here" << endl << indent() << "  printf(\""
-               << (*f_iter)->get_name() << "\\n\");" << endl << indent() << "}" << endl << endl;
+    f_skeleton << indent() << function_signature(*f_iter, "") << " {" << '\n' << indent()
+               << "  // Your implementation goes here" << '\n' << indent() << "  printf(\""
+               << (*f_iter)->get_name() << "\\n\");" << '\n' << indent() << "}" << '\n' << '\n';
   }
 
   indent_down();
-  f_skeleton << "};" << endl << endl;
+  f_skeleton << "};" << '\n' << '\n';
 
   f_skeleton << "class " << svcname << "AsyncHandler : "
-             << "public " << svcname << "CobSvIf {" << endl << " public:" << endl;
+             << "public " << svcname << "CobSvIf {" << '\n' << " public:" << '\n';
   indent_up();
-  f_skeleton << indent() << svcname << "AsyncHandler() {" << endl << indent()
+  f_skeleton << indent() << svcname << "AsyncHandler() {" << '\n' << indent()
              << "  syncHandler_ = std::unique_ptr<" << svcname << "Handler>(new " << svcname
-             << "Handler);" << endl << indent() << "  // Your initialization goes here" << endl
-             << indent() << "}" << endl;
-  f_skeleton << indent() << "virtual ~" << service_name_ << "AsyncHandler();" << endl;
+             << "Handler);" << '\n' << indent() << "  // Your initialization goes here" << '\n'
+             << indent() << "}" << '\n';
+  f_skeleton << indent() << "virtual ~" << service_name_ << "AsyncHandler();" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_skeleton << endl << indent() << function_signature(*f_iter, "CobSv", "", true) << " {"
-               << endl;
+    f_skeleton << '\n' << indent() << function_signature(*f_iter, "CobSv", "", true) << " {"
+               << '\n';
     indent_up();
 
     t_type* returntype = (*f_iter)->get_returntype();
@@ -2366,32 +2364,32 @@
 
     string target = returntype->is_void() ? "" : "_return";
     if (!returntype->is_void()) {
-      f_skeleton << indent() << declare_field(&returnfield, true) << endl;
+      f_skeleton << indent() << declare_field(&returnfield, true) << '\n';
     }
     generate_function_call(f_skeleton, *f_iter, target, "syncHandler_", "");
-    f_skeleton << indent() << "return cob(" << target << ");" << endl;
+    f_skeleton << indent() << "return cob(" << target << ");" << '\n';
 
     scope_down(f_skeleton);
   }
-  f_skeleton << endl << " protected:" << endl << indent() << "std::unique_ptr<" << svcname
-             << "Handler> syncHandler_;" << endl;
+  f_skeleton << '\n' << " protected:" << '\n' << indent() << "std::unique_ptr<" << svcname
+             << "Handler> syncHandler_;" << '\n';
   indent_down();
-  f_skeleton << "};" << endl << endl;
+  f_skeleton << "};" << '\n' << '\n';
 
-  f_skeleton << indent() << "int main(int argc, char **argv) {" << endl;
+  f_skeleton << indent() << "int main(int argc, char **argv) {" << '\n';
   indent_up();
   f_skeleton
-      << indent() << "int port = 9090;" << endl << indent() << "::std::shared_ptr<" << svcname
-      << "AsyncHandler> handler(new " << svcname << "AsyncHandler());" << endl << indent()
-      << "::std::shared_ptr<" << svcname << "AsyncProcessor> processor(new " << svcname << "AsyncProcessor(handler));" << endl
+      << indent() << "int port = 9090;" << '\n' << indent() << "::std::shared_ptr<" << svcname
+      << "AsyncHandler> handler(new " << svcname << "AsyncHandler());" << '\n' << indent()
+      << "::std::shared_ptr<" << svcname << "AsyncProcessor> processor(new " << svcname << "AsyncProcessor(handler));" << '\n'
       << indent() << "::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());"
-      << endl
+      << '\n'
       << indent() << "::std::shared_ptr<TAsyncProtocolProcessor> protocolProcessor(new TAsyncProtocolProcessor(processor, protocolFactory));"
-      << endl << endl << indent()
+      << '\n' << '\n' << indent()
       << "TEvhttpServer server(protocolProcessor, port);"
-      << endl << indent() << "server.serve();" << endl << indent() << "return 0;" << endl;
+      << '\n' << indent() << "server.serve();" << '\n' << indent() << "return 0;" << '\n';
   indent_down();
-  f_skeleton << "}" << endl << endl;
+  f_skeleton << "}" << '\n' << '\n';
 }
 
 /**
@@ -2417,35 +2415,35 @@
 
   // Generate the header portion
   f_header_ << "class " << service_name_ << "Multiface : "
-            << "virtual public " << service_name_ << "If" << extends_multiface << " {" << endl
-            << " public:" << endl;
+            << "virtual public " << service_name_ << "If" << extends_multiface << " {" << '\n'
+            << " public:" << '\n';
   indent_up();
   f_header_ << indent() << service_name_ << "Multiface(" << list_type
-            << "& ifaces) : ifaces_(ifaces) {" << endl;
+            << "& ifaces) : ifaces_(ifaces) {" << '\n';
   if (!extends.empty()) {
     f_header_ << indent()
               << "  std::vector<std::shared_ptr<" + service_name_ + "If> >::iterator iter;"
-              << endl << indent() << "  for (iter = ifaces.begin(); iter != ifaces.end(); ++iter) {"
-              << endl << indent() << "    " << extends << "Multiface::add(*iter);" << endl
-              << indent() << "  }" << endl;
+              << '\n' << indent() << "  for (iter = ifaces.begin(); iter != ifaces.end(); ++iter) {"
+              << '\n' << indent() << "    " << extends << "Multiface::add(*iter);" << '\n'
+              << indent() << "  }" << '\n';
   }
-  f_header_ << indent() << "}" << endl << indent() << "virtual ~" << service_name_
-            << "Multiface() {}" << endl;
+  f_header_ << indent() << "}" << '\n' << indent() << "virtual ~" << service_name_
+            << "Multiface() {}" << '\n';
   indent_down();
 
   // Protected data members
-  f_header_ << " protected:" << endl;
+  f_header_ << " protected:" << '\n';
   indent_up();
-  f_header_ << indent() << list_type << " ifaces_;" << endl << indent() << service_name_
-            << "Multiface() {}" << endl << indent() << "void add(::std::shared_ptr<"
-            << service_name_ << "If> iface) {" << endl;
+  f_header_ << indent() << list_type << " ifaces_;" << '\n' << indent() << service_name_
+            << "Multiface() {}" << '\n' << indent() << "void add(::std::shared_ptr<"
+            << service_name_ << "If> iface) {" << '\n';
   if (!extends.empty()) {
-    f_header_ << indent() << "  " << extends << "Multiface::add(iface);" << endl;
+    f_header_ << indent() << "  " << extends << "Multiface::add(iface);" << '\n';
   }
-  f_header_ << indent() << "  ifaces_.push_back(iface);" << endl << indent() << "}" << endl;
+  f_header_ << indent() << "  ifaces_.push_back(iface);" << '\n' << indent() << "}" << '\n';
   indent_down();
 
-  f_header_ << indent() << " public:" << endl;
+  f_header_ << indent() << " public:" << '\n';
   indent_up();
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -2470,31 +2468,31 @@
     }
     call += ")";
 
-    f_header_ << indent() << function_signature(*f_iter, "") << " override {" << endl;
+    f_header_ << indent() << function_signature(*f_iter, "") << " override {" << '\n';
     indent_up();
-    f_header_ << indent() << "size_t sz = ifaces_.size();" << endl << indent() << "size_t i = 0;"
-              << endl << indent() << "for (; i < (sz - 1); ++i) {" << endl;
+    f_header_ << indent() << "size_t sz = ifaces_.size();" << '\n' << indent() << "size_t i = 0;"
+              << '\n' << indent() << "for (; i < (sz - 1); ++i) {" << '\n';
     indent_up();
-    f_header_ << indent() << call << ";" << endl;
+    f_header_ << indent() << call << ";" << '\n';
     indent_down();
-    f_header_ << indent() << "}" << endl;
+    f_header_ << indent() << "}" << '\n';
 
     if (!(*f_iter)->get_returntype()->is_void()) {
       if (is_complex_type((*f_iter)->get_returntype())) {
-        f_header_ << indent() << call << ";" << endl << indent() << "return;" << endl;
+        f_header_ << indent() << call << ";" << '\n' << indent() << "return;" << '\n';
       } else {
-        f_header_ << indent() << "return " << call << ";" << endl;
+        f_header_ << indent() << "return " << call << ";" << '\n';
       }
     } else {
-      f_header_ << indent() << call << ";" << endl;
+      f_header_ << indent() << call << ";" << '\n';
     }
 
     indent_down();
-    f_header_ << indent() << "}" << endl << endl;
+    f_header_ << indent() << "}" << '\n' << '\n';
   }
 
   indent_down();
-  f_header_ << indent() << "};" << endl << endl;
+  f_header_ << indent() << "};" << '\n' << '\n';
 }
 
 /**
@@ -2545,7 +2543,7 @@
   f_header_ << template_header << "class " << service_name_ << style << "Client" << short_suffix
             << " : "
             << "virtual public " << service_name_ << ifstyle << if_suffix << extends_client << " {"
-            << endl << " public:" << endl;
+            << '\n' << " public:" << '\n';
 
   indent_up();
   if (style != "Cob") {
@@ -2558,18 +2556,18 @@
 
     if (extends.empty()) {
       if (style == "Concurrent") {
-        f_header_ << ": sync_(sync)" << endl;
+        f_header_ << ": sync_(sync)" << '\n';
       }
-      f_header_ << "{" << endl;
-      f_header_ << indent() << "  setProtocol" << short_suffix << "(prot);" << endl << indent()
-                << "}" << endl;
+      f_header_ << "{" << '\n';
+      f_header_ << indent() << "  setProtocol" << short_suffix << "(prot);" << '\n' << indent()
+                << "}" << '\n';
     } else {
-      f_header_ << ":" << endl;
+      f_header_ << ":" << '\n';
       f_header_ << indent() << "  " << extends << style << client_suffix << "(prot, prot";
       if (style == "Concurrent") {
           f_header_ << ", sync";
       }
-      f_header_ << ") {}" << endl;
+      f_header_ << ") {}" << '\n';
     }
 
     f_header_ << indent() << service_name_ << style << "Client" << short_suffix << "(" << prot_ptr
@@ -2581,38 +2579,38 @@
 
     if (extends.empty()) {
       if (style == "Concurrent") {
-        f_header_ << ": sync_(sync)" << endl;
+        f_header_ << ": sync_(sync)" << '\n';
       }
-      f_header_ << "{" << endl;
-      f_header_ << indent() << "  setProtocol" << short_suffix << "(iprot,oprot);" << endl
-                << indent() << "}" << endl;
+      f_header_ << "{" << '\n';
+      f_header_ << indent() << "  setProtocol" << short_suffix << "(iprot,oprot);" << '\n'
+                << indent() << "}" << '\n';
     } else {
       f_header_ << ":" << indent() << "  " << extends << style << client_suffix
                 << "(iprot, oprot";
       if (style == "Concurrent") {
           f_header_ << ", sync";
       }
-      f_header_ << ") {}" << endl;
+      f_header_ << ") {}" << '\n';
     }
 
     // create the setProtocol methods
     if (extends.empty()) {
-      f_header_ << " private:" << endl;
+      f_header_ << " private:" << '\n';
       // 1: one parameter
       f_header_ << indent() << "void setProtocol" << short_suffix << "(" << prot_ptr << " prot) {"
-                << endl;
-      f_header_ << indent() << "setProtocol" << short_suffix << "(prot,prot);" << endl;
-      f_header_ << indent() << "}" << endl;
+                << '\n';
+      f_header_ << indent() << "setProtocol" << short_suffix << "(prot,prot);" << '\n';
+      f_header_ << indent() << "}" << '\n';
       // 2: two parameter
       f_header_ << indent() << "void setProtocol" << short_suffix << "(" << prot_ptr << " iprot, "
-                << prot_ptr << " oprot) {" << endl;
+                << prot_ptr << " oprot) {" << '\n';
 
-      f_header_ << indent() << "  piprot_=iprot;" << endl << indent() << "  poprot_=oprot;" << endl
-                << indent() << "  iprot_ = iprot.get();" << endl << indent()
-                << "  oprot_ = oprot.get();" << endl;
+      f_header_ << indent() << "  piprot_=iprot;" << '\n' << indent() << "  poprot_=oprot;" << '\n'
+                << indent() << "  iprot_ = iprot.get();" << '\n' << indent()
+                << "  oprot_ = oprot.get();" << '\n';
 
-      f_header_ << indent() << "}" << endl;
-      f_header_ << " public:" << endl;
+      f_header_ << indent() << "}" << '\n';
+      f_header_ << " public:" << '\n';
     }
 
     // Generate getters for the protocols.
@@ -2620,45 +2618,45 @@
     // TODO(simpkins): should they be templated?
     f_header_ << indent()
               << "std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {"
-              << endl << indent() << "  return " << _this << "piprot_;" << endl << indent() << "}"
-              << endl;
+              << '\n' << indent() << "  return " << _this << "piprot_;" << '\n' << indent() << "}"
+              << '\n';
 
     f_header_ << indent()
               << "std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {"
-              << endl << indent() << "  return " << _this << "poprot_;" << endl << indent() << "}"
-              << endl;
+              << '\n' << indent() << "  return " << _this << "poprot_;" << '\n' << indent() << "}"
+              << '\n';
 
   } else /* if (style == "Cob") */ {
     f_header_ << indent() << service_name_ << style << "Client" << short_suffix << "("
               << "std::shared_ptr< ::apache::thrift::async::TAsyncChannel> channel, "
-              << "::apache::thrift::protocol::TProtocolFactory* protocolFactory) :" << endl;
+              << "::apache::thrift::protocol::TProtocolFactory* protocolFactory) :" << '\n';
     if (extends.empty()) {
-      f_header_ << indent() << "  channel_(channel)," << endl << indent()
-                << "  itrans_(new ::apache::thrift::transport::TMemoryBuffer())," << endl
+      f_header_ << indent() << "  channel_(channel)," << '\n' << indent()
+                << "  itrans_(new ::apache::thrift::transport::TMemoryBuffer())," << '\n'
                 << indent() << "  otrans_(new ::apache::thrift::transport::TMemoryBuffer()),"
-                << endl;
+                << '\n';
       if (gen_templates_) {
         // TProtocolFactory classes return generic TProtocol pointers.
         // We have to dynamic cast to the Protocol_ type we are expecting.
         f_header_ << indent() << "  piprot_(::std::dynamic_pointer_cast<Protocol_>("
-                  << "protocolFactory->getProtocol(itrans_)))," << endl << indent()
+                  << "protocolFactory->getProtocol(itrans_)))," << '\n' << indent()
                   << "  poprot_(::std::dynamic_pointer_cast<Protocol_>("
-                  << "protocolFactory->getProtocol(otrans_))) {" << endl;
+                  << "protocolFactory->getProtocol(otrans_))) {" << '\n';
         // Throw a TException if either dynamic cast failed.
-        f_header_ << indent() << "  if (!piprot_ || !poprot_) {" << endl << indent()
+        f_header_ << indent() << "  if (!piprot_ || !poprot_) {" << '\n' << indent()
                   << "    throw ::apache::thrift::TException(\""
                   << "TProtocolFactory returned unexpected protocol type in " << service_name_
-                  << style << "Client" << short_suffix << " constructor\");" << endl << indent()
-                  << "  }" << endl;
+                  << style << "Client" << short_suffix << " constructor\");" << '\n' << indent()
+                  << "  }" << '\n';
       } else {
-        f_header_ << indent() << "  piprot_(protocolFactory->getProtocol(itrans_))," << endl
-                  << indent() << "  poprot_(protocolFactory->getProtocol(otrans_)) {" << endl;
+        f_header_ << indent() << "  piprot_(protocolFactory->getProtocol(itrans_))," << '\n'
+                  << indent() << "  poprot_(protocolFactory->getProtocol(otrans_)) {" << '\n';
       }
-      f_header_ << indent() << "  iprot_ = piprot_.get();" << endl << indent()
-                << "  oprot_ = poprot_.get();" << endl << indent() << "}" << endl;
+      f_header_ << indent() << "  iprot_ = piprot_.get();" << '\n' << indent()
+                << "  oprot_ = poprot_.get();" << '\n' << indent() << "}" << '\n';
     } else {
       f_header_ << indent() << "  " << extends << style << client_suffix
-                << "(channel, protocolFactory) {}" << endl;
+                << "(channel, protocolFactory) {}" << '\n';
     }
   }
 
@@ -2666,10 +2664,10 @@
     generate_java_doc(f_header_, tservice);
 
     f_header_ << indent()
-              << "::std::shared_ptr< ::apache::thrift::async::TAsyncChannel> getChannel() {" << endl
-              << indent() << "  return " << _this << "channel_;" << endl << indent() << "}" << endl;
+              << "::std::shared_ptr< ::apache::thrift::async::TAsyncChannel> getChannel() {" << '\n'
+              << indent() << "  return " << _this << "channel_;" << '\n' << indent() << "}" << '\n';
     if (!gen_no_client_completion_) {
-      f_header_ << indent() << "virtual void completed__(bool /* success */) {}" << endl;
+      f_header_ << indent() << "virtual void completed__(bool /* success */) {}" << '\n';
     }
   }
 
@@ -2678,7 +2676,7 @@
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_header_, *f_iter);
     indent(f_header_) << function_signature(*f_iter, ifstyle)
-                      << " override;" << endl;
+                      << " override;" << '\n';
     // TODO(dreiss): Use private inheritance to avoid generating thise in cob-style.
     if (style == "Concurrent" && !(*f_iter)->is_oneway()) {
       // concurrent clients need to move the seqid from the send function to the
@@ -2687,12 +2685,12 @@
       t_function send_function(g_type_i32, /*returning seqid*/
                                string("send_") + (*f_iter)->get_name(),
                                (*f_iter)->get_arglist());
-      indent(f_header_) << function_signature(&send_function, "") << ";" << endl;
+      indent(f_header_) << function_signature(&send_function, "") << ";" << '\n';
     } else {
       t_function send_function(g_type_void,
                                string("send_") + (*f_iter)->get_name(),
                                (*f_iter)->get_arglist());
-      indent(f_header_) << function_signature(&send_function, "") << ";" << endl;
+      indent(f_header_) << function_signature(&send_function, "") << ";" << '\n';
     }
     if (!(*f_iter)->is_oneway()) {
       if (style == "Concurrent") {
@@ -2702,52 +2700,52 @@
         t_function recv_function((*f_iter)->get_returntype(),
                                  string("recv_") + (*f_iter)->get_name(),
                                  &seqIdArgStruct);
-        indent(f_header_) << function_signature(&recv_function, "") << ";" << endl;
+        indent(f_header_) << function_signature(&recv_function, "") << ";" << '\n';
       } else {
         t_struct noargs(program_);
         t_function recv_function((*f_iter)->get_returntype(),
                                  string("recv_") + (*f_iter)->get_name(),
                                  &noargs);
-        indent(f_header_) << function_signature(&recv_function, "") << ";" << endl;
+        indent(f_header_) << function_signature(&recv_function, "") << ";" << '\n';
       }
     }
   }
   indent_down();
 
   if (extends.empty()) {
-    f_header_ << " protected:" << endl;
+    f_header_ << " protected:" << '\n';
     indent_up();
 
     if (style == "Cob") {
       f_header_ << indent()
-                << "::std::shared_ptr< ::apache::thrift::async::TAsyncChannel> channel_;" << endl
+                << "::std::shared_ptr< ::apache::thrift::async::TAsyncChannel> channel_;" << '\n'
                 << indent()
-                << "::std::shared_ptr< ::apache::thrift::transport::TMemoryBuffer> itrans_;" << endl
+                << "::std::shared_ptr< ::apache::thrift::transport::TMemoryBuffer> itrans_;" << '\n'
                 << indent()
                 << "::std::shared_ptr< ::apache::thrift::transport::TMemoryBuffer> otrans_;"
-                << endl;
+                << '\n';
     }
     f_header_ <<
-      indent() << prot_ptr << " piprot_;" << endl <<
-      indent() << prot_ptr << " poprot_;" << endl <<
-      indent() << protocol_type << "* iprot_;" << endl <<
-      indent() << protocol_type << "* oprot_;" << endl;
+      indent() << prot_ptr << " piprot_;" << '\n' <<
+      indent() << prot_ptr << " poprot_;" << '\n' <<
+      indent() << protocol_type << "* iprot_;" << '\n' <<
+      indent() << protocol_type << "* oprot_;" << '\n';
 
     if (style == "Concurrent") {
       f_header_ <<
-        indent() << "std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync_;"<<endl;
+        indent() << "std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync_;" << '\n';
     }
     indent_down();
   }
 
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 
   if (gen_templates_) {
     // Output a backwards compatibility typedef using
     // TProtocol as the template parameter.
     f_header_ << "typedef " << service_name_ << style
               << "ClientT< ::apache::thrift::protocol::TProtocol> " << service_name_ << style
-              << "Client;" << endl << endl;
+              << "Client;" << '\n' << '\n';
   }
 
   string scope = service_name_ + style + client_suffix + "::";
@@ -2769,7 +2767,7 @@
     if (gen_templates_) {
       indent(out) << template_header;
     }
-    indent(out) << function_signature(*f_iter, ifstyle, scope) << endl;
+    indent(out) << function_signature(*f_iter, ifstyle, scope) << '\n';
     scope_up(out);
     indent(out) << seqIdCapture << "send_" << funname << "(";
 
@@ -2788,33 +2786,33 @@
       }
       out << (*fld_iter)->get_name();
     }
-    out << ");" << endl;
+    out << ");" << '\n';
 
     if (style != "Cob") {
       if (!(*f_iter)->is_oneway()) {
         out << indent();
         if (!(*f_iter)->get_returntype()->is_void()) {
           if (is_complex_type((*f_iter)->get_returntype())) {
-            out << "recv_" << funname << "(_return" << seqIdCommaUse << ");" << endl;
+            out << "recv_" << funname << "(_return" << seqIdCommaUse << ");" << '\n';
           } else {
-            out << "return recv_" << funname << "(" << seqIdUse << ");" << endl;
+            out << "return recv_" << funname << "(" << seqIdUse << ");" << '\n';
           }
         } else {
-          out << "recv_" << funname << "(" << seqIdUse << ");" << endl;
+          out << "recv_" << funname << "(" << seqIdUse << ");" << '\n';
         }
       }
     } else {
       if (!(*f_iter)->is_oneway()) {
         out << indent() << _this << "channel_->sendAndRecvMessage("
             << "::std::bind(cob, this), " << _this << "otrans_.get(), " << _this << "itrans_.get());"
-            << endl;
+            << '\n';
       } else {
         out << indent() << _this << "channel_->sendMessage("
-            << "::std::bind(cob, this), " << _this << "otrans_.get());" << endl;
+            << "::std::bind(cob, this), " << _this << "otrans_.get());" << '\n';
       }
     }
     scope_down(out);
-    out << endl;
+    out << '\n';
 
     // if (style != "Cob") // TODO(dreiss): Libify the client and don't generate this for cob-style
     if (true) {
@@ -2831,7 +2829,7 @@
       if (gen_templates_) {
         indent(out) << template_header;
       }
-      indent(out) << function_signature(&send_function, "", scope) << endl;
+      indent(out) << function_signature(&send_function, "", scope) << '\n';
       scope_up(out);
 
       // Function arguments and results
@@ -2846,41 +2844,41 @@
       }
       // Serialize the request
       out <<
-        indent() << "int32_t cseqid = " << cseqidVal << ";" << endl;
+        indent() << "int32_t cseqid = " << cseqidVal << ";" << '\n';
       if(style == "Concurrent") {
         out <<
-          indent() << "::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());" << endl;
+          indent() << "::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());" << '\n';
       }
       if (style == "Cob") {
         out <<
-          indent() << _this << "otrans_->resetBuffer();" << endl;
+          indent() << _this << "otrans_->resetBuffer();" << '\n';
       }
       out <<
         indent() << _this << "oprot_->writeMessageBegin(\"" <<
         (*f_iter)->get_name() <<
         "\", ::apache::thrift::protocol::" << ((*f_iter)->is_oneway() ? "T_ONEWAY" : "T_CALL") <<
-        ", cseqid);" << endl << endl <<
-        indent() << argsname << " args;" << endl;
+        ", cseqid);" << '\n' << '\n' <<
+        indent() << argsname << " args;" << '\n';
 
       for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
         out << indent() << "args." << (*fld_iter)->get_name() << " = &" << (*fld_iter)->get_name()
-            << ";" << endl;
+            << ";" << '\n';
       }
 
-      out << indent() << "args.write(" << _this << "oprot_);" << endl << endl << indent() << _this
-          << "oprot_->writeMessageEnd();" << endl << indent() << _this
-          << "oprot_->getTransport()->writeEnd();" << endl << indent() << _this
-          << "oprot_->getTransport()->flush();" << endl;
+      out << indent() << "args.write(" << _this << "oprot_);" << '\n' << '\n' << indent() << _this
+          << "oprot_->writeMessageEnd();" << '\n' << indent() << _this
+          << "oprot_->getTransport()->writeEnd();" << '\n' << indent() << _this
+          << "oprot_->getTransport()->flush();" << '\n';
 
       if (style == "Concurrent") {
-        out << endl << indent() << "sentry.commit();" << endl;
+        out << '\n' << indent() << "sentry.commit();" << '\n';
 
         if (!(*f_iter)->is_oneway()) {
-          out << indent() << "return cseqid;" << endl;
+          out << indent() << "return cseqid;" << '\n';
         }
       }
       scope_down(out);
-      out << endl;
+      out << '\n';
 
       // Generate recv function only if not an oneway function
       if (!(*f_iter)->is_oneway()) {
@@ -2902,124 +2900,123 @@
         if (gen_templates_) {
           indent(out) << template_header;
         }
-        indent(out) << function_signature(&recv_function, "", scope) << endl;
+        indent(out) << function_signature(&recv_function, "", scope) << '\n';
         scope_up(out);
 
-        out << endl <<
-          indent() << "int32_t rseqid = 0;" << endl <<
-          indent() << "std::string fname;" << endl <<
-          indent() << "::apache::thrift::protocol::TMessageType mtype;" << endl;
+        out << '\n' <<
+          indent() << "int32_t rseqid = 0;" << '\n' <<
+          indent() << "std::string fname;" << '\n' <<
+          indent() << "::apache::thrift::protocol::TMessageType mtype;" << '\n';
         if(style == "Concurrent") {
-          out <<
-            endl <<
-            indent() << "// the read mutex gets dropped and reacquired as part of waitForWork()" << endl <<
-            indent() << "// The destructor of this sentry wakes up other clients" << endl <<
-            indent() << "::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);" << endl;
+          out << '\n' <<
+            indent() << "// the read mutex gets dropped and reacquired as part of waitForWork()" << '\n' <<
+            indent() << "// The destructor of this sentry wakes up other clients" << '\n' <<
+            indent() << "::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);" << '\n';
         }
         if (style == "Cob" && !gen_no_client_completion_) {
-          out << indent() << "bool completed = false;" << endl << endl << indent() << "try {";
+          out << indent() << "bool completed = false;" << '\n' << '\n' << indent() << "try {";
           indent_up();
         }
-        out << endl;
+        out << '\n';
         if (style == "Concurrent") {
           out <<
-            indent() << "while(true) {" << endl <<
-            indent() << "  if(!this->sync_->getPending(fname, mtype, rseqid)) {" << endl;
+            indent() << "while(true) {" << '\n' <<
+            indent() << "  if(!this->sync_->getPending(fname, mtype, rseqid)) {" << '\n';
           indent_up();
           indent_up();
         }
         out <<
-          indent() << _this << "iprot_->readMessageBegin(fname, mtype, rseqid);" << endl;
+          indent() << _this << "iprot_->readMessageBegin(fname, mtype, rseqid);" << '\n';
         if (style == "Concurrent") {
           scope_down(out);
-          out << indent() << "if(seqid == rseqid) {" << endl;
+          out << indent() << "if(seqid == rseqid) {" << '\n';
           indent_up();
         }
         out <<
-          indent() << "if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {" << endl <<
-          indent() << "  ::apache::thrift::TApplicationException x;" << endl <<
-          indent() << "  x.read(" << _this << "iprot_);" << endl <<
-          indent() << "  " << _this << "iprot_->readMessageEnd();" << endl <<
-          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << endl;
+          indent() << "if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {" << '\n' <<
+          indent() << "  ::apache::thrift::TApplicationException x;" << '\n' <<
+          indent() << "  x.read(" << _this << "iprot_);" << '\n' <<
+          indent() << "  " << _this << "iprot_->readMessageEnd();" << '\n' <<
+          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << '\n';
         if (style == "Cob" && !gen_no_client_completion_) {
-          out << indent() << "  completed = true;" << endl << indent() << "  completed__(true);"
-              << endl;
+          out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(true);"
+              << '\n';
         }
         if (style == "Concurrent") {
-          out << indent() << "  sentry.commit();" << endl;
+          out << indent() << "  sentry.commit();" << '\n';
         }
         out <<
-          indent() << "  throw x;" << endl <<
-          indent() << "}" << endl <<
-          indent() << "if (mtype != ::apache::thrift::protocol::T_REPLY) {" << endl <<
-          indent() << "  " << _this << "iprot_->skip(" << "::apache::thrift::protocol::T_STRUCT);" << endl <<
-          indent() << "  " << _this << "iprot_->readMessageEnd();" << endl <<
-          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << endl;
+          indent() << "  throw x;" << '\n' <<
+          indent() << "}" << '\n' <<
+          indent() << "if (mtype != ::apache::thrift::protocol::T_REPLY) {" << '\n' <<
+          indent() << "  " << _this << "iprot_->skip(" << "::apache::thrift::protocol::T_STRUCT);" << '\n' <<
+          indent() << "  " << _this << "iprot_->readMessageEnd();" << '\n' <<
+          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << '\n';
         if (style == "Cob" && !gen_no_client_completion_) {
-          out << indent() << "  completed = true;" << endl << indent() << "  completed__(false);"
-              << endl;
+          out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(false);"
+              << '\n';
         }
         out <<
-          indent() << "}" << endl <<
-          indent() << "if (fname.compare(\"" << (*f_iter)->get_name() << "\") != 0) {" << endl <<
-          indent() << "  " << _this << "iprot_->skip(" << "::apache::thrift::protocol::T_STRUCT);" << endl <<
-          indent() << "  " << _this << "iprot_->readMessageEnd();" << endl <<
-          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << endl;
+          indent() << "}" << '\n' <<
+          indent() << "if (fname.compare(\"" << (*f_iter)->get_name() << "\") != 0) {" << '\n' <<
+          indent() << "  " << _this << "iprot_->skip(" << "::apache::thrift::protocol::T_STRUCT);" << '\n' <<
+          indent() << "  " << _this << "iprot_->readMessageEnd();" << '\n' <<
+          indent() << "  " << _this << "iprot_->getTransport()->readEnd();" << '\n';
         if (style == "Cob" && !gen_no_client_completion_) {
-          out << indent() << "  completed = true;" << endl << indent() << "  completed__(false);"
-              << endl;
+          out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(false);"
+              << '\n';
         }
         if (style == "Concurrent") {
-          out << endl <<
-            indent() << "  // in a bad state, don't commit" << endl <<
-            indent() << "  using ::apache::thrift::protocol::TProtocolException;" << endl <<
-            indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl;
+          out << '\n' <<
+            indent() << "  // in a bad state, don't commit" << '\n' <<
+            indent() << "  using ::apache::thrift::protocol::TProtocolException;" << '\n' <<
+            indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << '\n';
         }
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
 
         if (!(*f_iter)->get_returntype()->is_void()
             && !is_complex_type((*f_iter)->get_returntype())) {
           t_field returnfield((*f_iter)->get_returntype(), "_return");
-          out << indent() << declare_field(&returnfield) << endl;
+          out << indent() << declare_field(&returnfield) << '\n';
         }
 
-        out << indent() << resultname << " result;" << endl;
+        out << indent() << resultname << " result;" << '\n';
 
         if (!(*f_iter)->get_returntype()->is_void()) {
-          out << indent() << "result.success = &_return;" << endl;
+          out << indent() << "result.success = &_return;" << '\n';
         }
 
-        out << indent() << "result.read(" << _this << "iprot_);" << endl << indent() << _this
-            << "iprot_->readMessageEnd();" << endl << indent() << _this
-            << "iprot_->getTransport()->readEnd();" << endl << endl;
+        out << indent() << "result.read(" << _this << "iprot_);" << '\n' << indent() << _this
+            << "iprot_->readMessageEnd();" << '\n' << indent() << _this
+            << "iprot_->getTransport()->readEnd();" << '\n' << '\n';
 
         // Careful, only look for _result if not a void function
         if (!(*f_iter)->get_returntype()->is_void()) {
           if (is_complex_type((*f_iter)->get_returntype())) {
             out <<
-              indent() << "if (result.__isset.success) {" << endl;
+              indent() << "if (result.__isset.success) {" << '\n';
             out <<
-              indent() << "  // _return pointer has now been filled" << endl;
+              indent() << "  // _return pointer has now been filled" << '\n';
             if (style == "Cob" && !gen_no_client_completion_) {
-              out << indent() << "  completed = true;" << endl << indent() << "  completed__(true);"
-                  << endl;
+              out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(true);"
+                  << '\n';
             }
             if (style == "Concurrent") {
-              out << indent() << "  sentry.commit();" << endl;
+              out << indent() << "  sentry.commit();" << '\n';
             }
             out <<
-              indent() << "  return;" << endl <<
-              indent() << "}" << endl;
+              indent() << "  return;" << '\n' <<
+              indent() << "}" << '\n';
           } else {
-            out << indent() << "if (result.__isset.success) {" << endl;
+            out << indent() << "if (result.__isset.success) {" << '\n';
             if (style == "Cob" && !gen_no_client_completion_) {
-              out << indent() << "  completed = true;" << endl << indent() << "  completed__(true);"
-                  << endl;
+              out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(true);"
+                  << '\n';
             }
             if (style == "Concurrent") {
-              out << indent() << "  sentry.commit();" << endl;
+              out << indent() << "  sentry.commit();" << '\n';
             }
-            out << indent() << "  return _return;" << endl << indent() << "}" << endl;
+            out << indent() << "  return _return;" << '\n' << indent() << "}" << '\n';
           }
         }
 
@@ -3027,62 +3024,62 @@
         const std::vector<t_field*>& xceptions = xs->get_members();
         vector<t_field*>::const_iterator x_iter;
         for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-          out << indent() << "if (result.__isset." << (*x_iter)->get_name() << ") {" << endl;
+          out << indent() << "if (result.__isset." << (*x_iter)->get_name() << ") {" << '\n';
           if (style == "Cob" && !gen_no_client_completion_) {
-            out << indent() << "  completed = true;" << endl << indent() << "  completed__(true);"
-                << endl;
+            out << indent() << "  completed = true;" << '\n' << indent() << "  completed__(true);"
+                << '\n';
           }
           if (style == "Concurrent") {
-            out << indent() << "  sentry.commit();" << endl;
+            out << indent() << "  sentry.commit();" << '\n';
           }
-          out << indent() << "  throw result." << (*x_iter)->get_name() << ";" << endl << indent()
-              << "}" << endl;
+          out << indent() << "  throw result." << (*x_iter)->get_name() << ";" << '\n' << indent()
+              << "}" << '\n';
         }
 
         // We only get here if we are a void function
         if ((*f_iter)->get_returntype()->is_void()) {
           if (style == "Cob" && !gen_no_client_completion_) {
-            out << indent() << "completed = true;" << endl << indent() << "completed__(true);"
-                << endl;
+            out << indent() << "completed = true;" << '\n' << indent() << "completed__(true);"
+                << '\n';
           }
           if (style == "Concurrent") {
-            out << indent() << "sentry.commit();" << endl;
+            out << indent() << "sentry.commit();" << '\n';
           }
-          indent(out) << "return;" << endl;
+          indent(out) << "return;" << '\n';
         } else {
           if (style == "Cob" && !gen_no_client_completion_) {
-            out << indent() << "completed = true;" << endl << indent() << "completed__(true);"
-                << endl;
+            out << indent() << "completed = true;" << '\n' << indent() << "completed__(true);"
+                << '\n';
           }
           if (style == "Concurrent") {
-            out << indent() << "// in a bad state, don't commit" << endl;
+            out << indent() << "// in a bad state, don't commit" << '\n';
           }
           out << indent() << "throw "
                              "::apache::thrift::TApplicationException(::apache::thrift::"
                              "TApplicationException::MISSING_RESULT, \"" << (*f_iter)->get_name()
-              << " failed: unknown result\");" << endl;
+              << " failed: unknown result\");" << '\n';
         }
         if (style == "Concurrent") {
           indent_down();
           indent_down();
-          out <<
-            indent() << "  }" << endl <<
-            indent() << "  // seqid != rseqid" << endl <<
-            indent() << "  this->sync_->updatePending(fname, mtype, rseqid);" << endl <<
-            endl <<
-            indent() << "  // this will temporarily unlock the readMutex, and let other clients get work done" << endl <<
-            indent() << "  this->sync_->waitForWork(seqid);" << endl <<
-            indent() << "} // end while(true)" << endl;
+          out << indent() << "  }" << '\n'
+              << indent() << "  // seqid != rseqid" << '\n'
+              << indent() << "  this->sync_->updatePending(fname, mtype, rseqid);" << '\n'
+              << '\n'
+              << indent()
+              << "  // this will temporarily unlock the readMutex, and let other clients get work done" << '\n'
+              << indent() << "  this->sync_->waitForWork(seqid);" << '\n'
+              << indent() << "} // end while(true)" << '\n';
         }
         if (style == "Cob" && !gen_no_client_completion_) {
           indent_down();
-          out << indent() << "} catch (...) {" << endl << indent() << "  if (!completed) {" << endl
-              << indent() << "    completed__(false);" << endl << indent() << "  }" << endl
-              << indent() << "  throw;" << endl << indent() << "}" << endl;
+          out << indent() << "} catch (...) {" << '\n' << indent() << "  if (!completed) {" << '\n'
+              << indent() << "    completed__(false);" << '\n' << indent() << "  }" << '\n'
+              << indent() << "  throw;" << '\n' << indent() << "}" << '\n';
         }
         // Close function
         scope_down(out);
-        out << endl;
+        out << '\n';
       }
     }
   }
@@ -3218,61 +3215,61 @@
 
   // Generate the header portion
   f_header_ << template_header_ << "class " << class_name_ << " : public " << parent_class << " {"
-            << endl;
+            << '\n';
 
   // Protected data members
-  f_header_ << " protected:" << endl;
+  f_header_ << " protected:" << '\n';
   indent_up();
-  f_header_ << indent() << "::std::shared_ptr<" << if_name_ << "> iface_;" << endl;
+  f_header_ << indent() << "::std::shared_ptr<" << if_name_ << "> iface_;" << '\n';
   f_header_ << indent() << "virtual " << ret_type_ << "dispatchCall(" << finish_cob_
             << "::apache::thrift::protocol::TProtocol* iprot, "
             << "::apache::thrift::protocol::TProtocol* oprot, "
             << "const std::string& fname, int32_t seqid" << call_context_
-            << ") override;" << endl;
+            << ") override;" << '\n';
   if (generator_->gen_templates_) {
     f_header_ << indent() << "virtual " << ret_type_ << "dispatchCallTemplated(" << finish_cob_
               << "Protocol_* iprot, Protocol_* oprot, "
-              << "const std::string& fname, int32_t seqid" << call_context_ << ");" << endl;
+              << "const std::string& fname, int32_t seqid" << call_context_ << ");" << '\n';
   }
   indent_down();
 
   // Process function declarations
-  f_header_ << " private:" << endl;
+  f_header_ << " private:" << '\n';
   indent_up();
 
   // Declare processMap_
   f_header_ << indent() << "typedef  void (" << class_name_ << "::*"
             << "ProcessFunction)(" << finish_cob_decl_ << "int32_t, "
             << "::apache::thrift::protocol::TProtocol*, "
-            << "::apache::thrift::protocol::TProtocol*" << call_context_decl_ << ");" << endl;
+            << "::apache::thrift::protocol::TProtocol*" << call_context_decl_ << ");" << '\n';
   if (generator_->gen_templates_) {
     f_header_ << indent() << "typedef void (" << class_name_ << "::*"
               << "SpecializedProcessFunction)(" << finish_cob_decl_ << "int32_t, "
-              << "Protocol_*, Protocol_*" << call_context_decl_ << ");" << endl << indent()
-              << "struct ProcessFunctions {" << endl << indent() << "  ProcessFunction generic;"
-              << endl << indent() << "  SpecializedProcessFunction specialized;" << endl << indent()
+              << "Protocol_*, Protocol_*" << call_context_decl_ << ");" << '\n' << indent()
+              << "struct ProcessFunctions {" << '\n' << indent() << "  ProcessFunction generic;"
+              << '\n' << indent() << "  SpecializedProcessFunction specialized;" << '\n' << indent()
               << "  ProcessFunctions(ProcessFunction g, "
-              << "SpecializedProcessFunction s) :" << endl << indent() << "    generic(g)," << endl
-              << indent() << "    specialized(s) {}" << endl << indent()
+              << "SpecializedProcessFunction s) :" << '\n' << indent() << "    generic(g)," << '\n'
+              << indent() << "    specialized(s) {}" << '\n' << indent()
               << "  ProcessFunctions() : generic(nullptr), specialized(nullptr) "
-              << "{}" << endl << indent() << "};" << endl << indent()
+              << "{}" << '\n' << indent() << "};" << '\n' << indent()
               << "typedef std::map<std::string, ProcessFunctions> "
-              << "ProcessMap;" << endl;
+              << "ProcessMap;" << '\n';
   } else {
     f_header_ << indent() << "typedef std::map<std::string, ProcessFunction> "
-              << "ProcessMap;" << endl;
+              << "ProcessMap;" << '\n';
   }
-  f_header_ << indent() << "ProcessMap processMap_;" << endl;
+  f_header_ << indent() << "ProcessMap processMap_;" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_header_) << "void process_" << (*f_iter)->get_name() << "(" << finish_cob_
                       << "int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, "
                          "::apache::thrift::protocol::TProtocol* oprot" << call_context_ << ");"
-                      << endl;
+                      << '\n';
     if (generator_->gen_templates_) {
       indent(f_header_) << "void process_" << (*f_iter)->get_name() << "(" << finish_cob_
                         << "int32_t seqid, Protocol_* iprot, Protocol_* oprot" << call_context_
-                        << ");" << endl;
+                        << ");" << '\n';
     }
     if (style_ == "Cob") {
       // XXX Factor this out, even if it is a pain.
@@ -3282,56 +3279,56 @@
       f_header_ << indent() << "void return_" << (*f_iter)->get_name()
                 << "(::std::function<void(bool ok)> cob, int32_t seqid, "
                 << "::apache::thrift::protocol::TProtocol* oprot, "
-                << "void* ctx" << ret_arg << ");" << endl;
+                << "void* ctx" << ret_arg << ");" << '\n';
       if (generator_->gen_templates_) {
         f_header_ << indent() << "void return_" << (*f_iter)->get_name()
                   << "(::std::function<void(bool ok)> cob, int32_t seqid, "
-                  << "Protocol_* oprot, void* ctx" << ret_arg << ");" << endl;
+                  << "Protocol_* oprot, void* ctx" << ret_arg << ");" << '\n';
       }
       // XXX Don't declare throw if it doesn't exist
       f_header_ << indent() << "void throw_" << (*f_iter)->get_name()
                 << "(::std::function<void(bool ok)> cob, int32_t seqid, "
                 << "::apache::thrift::protocol::TProtocol* oprot, void* ctx, "
-                << "::apache::thrift::TDelayedException* _throw);" << endl;
+                << "::apache::thrift::TDelayedException* _throw);" << '\n';
       if (generator_->gen_templates_) {
         f_header_ << indent() << "void throw_" << (*f_iter)->get_name()
                   << "(::std::function<void(bool ok)> cob, int32_t seqid, "
                   << "Protocol_* oprot, void* ctx, "
-                  << "::apache::thrift::TDelayedException* _throw);" << endl;
+                  << "::apache::thrift::TDelayedException* _throw);" << '\n';
       }
     }
   }
 
-  f_header_ << " public:" << endl << indent() << class_name_ << "(::std::shared_ptr<" << if_name_
-            << "> iface) :" << endl;
+  f_header_ << " public:" << '\n' << indent() << class_name_ << "(::std::shared_ptr<" << if_name_
+            << "> iface) :" << '\n';
   if (!extends_.empty()) {
-    f_header_ << indent() << "  " << extends_ << "(iface)," << endl;
+    f_header_ << indent() << "  " << extends_ << "(iface)," << '\n';
   }
-  f_header_ << indent() << "  iface_(iface) {" << endl;
+  f_header_ << indent() << "  iface_(iface) {" << '\n';
   indent_up();
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_header_ << indent() << "processMap_[\"" << (*f_iter)->get_name() << "\"] = ";
     if (generator_->gen_templates_) {
-      f_header_ << "ProcessFunctions(" << endl;
+      f_header_ << "ProcessFunctions(" << '\n';
       if (generator_->gen_templates_only_) {
-        indent(f_header_) << "  nullptr," << endl;
+        indent(f_header_) << "  nullptr," << '\n';
       } else {
         indent(f_header_) << "  &" << class_name_ << "::process_" << (*f_iter)->get_name() << ","
-                          << endl;
+                          << '\n';
       }
       indent(f_header_) << "  &" << class_name_ << "::process_" << (*f_iter)->get_name() << ")";
     } else {
       f_header_ << "&" << class_name_ << "::process_" << (*f_iter)->get_name();
     }
-    f_header_ << ";" << endl;
+    f_header_ << ";" << '\n';
   }
 
   indent_down();
-  f_header_ << indent() << "}" << endl << endl << indent() << "virtual ~" << class_name_ << "() {}"
-            << endl;
+  f_header_ << indent() << "}" << '\n' << '\n' << indent() << "virtual ~" << class_name_ << "() {}"
+            << '\n';
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 
   if (generator_->gen_templates_) {
     // Generate a backwards compatible typedef, for callers who don't know
@@ -3344,7 +3341,7 @@
     // Therefore, we define TDummyProtocol solely so we can use it as the
     // template parameter here.
     f_header_ << "typedef " << class_name_ << "< ::apache::thrift::protocol::TDummyProtocol > "
-              << service_name_ << pstyle_ << "Processor;" << endl << endl;
+              << service_name_ << pstyle_ << "Processor;" << '\n' << '\n';
   }
 }
 
@@ -3366,32 +3363,32 @@
   f_out_ << template_header_ << ret_type_ << class_name_ << template_suffix_ << "::dispatchCall"
          << function_suffix << "(" << finish_cob_ << protocol << "* iprot, " << protocol
          << "* oprot, "
-         << "const std::string& fname, int32_t seqid" << call_context_ << ") {" << endl;
+         << "const std::string& fname, int32_t seqid" << call_context_ << ") {" << '\n';
   indent_up();
 
   // HOT: member function pointer map
-  f_out_ << indent() << typename_str_ << "ProcessMap::iterator pfn;" << endl << indent()
-         << "pfn = processMap_.find(fname);" << endl << indent()
-         << "if (pfn == processMap_.end()) {" << endl;
+  f_out_ << indent() << typename_str_ << "ProcessMap::iterator pfn;" << '\n' << indent()
+         << "pfn = processMap_.find(fname);" << '\n' << indent()
+         << "if (pfn == processMap_.end()) {" << '\n';
   if (extends_.empty()) {
-    f_out_ << indent() << "  iprot->skip(::apache::thrift::protocol::T_STRUCT);" << endl << indent()
-           << "  iprot->readMessageEnd();" << endl << indent()
-           << "  iprot->getTransport()->readEnd();" << endl << indent()
+    f_out_ << indent() << "  iprot->skip(::apache::thrift::protocol::T_STRUCT);" << '\n' << indent()
+           << "  iprot->readMessageEnd();" << '\n' << indent()
+           << "  iprot->getTransport()->readEnd();" << '\n' << indent()
            << "  ::apache::thrift::TApplicationException "
               "x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, \"Invalid method name: "
-              "'\"+fname+\"'\");" << endl << indent()
+              "'\"+fname+\"'\");" << '\n' << indent()
            << "  oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);"
-           << endl << indent() << "  x.write(oprot);" << endl << indent()
-           << "  oprot->writeMessageEnd();" << endl << indent()
-           << "  oprot->getTransport()->writeEnd();" << endl << indent()
-           << "  oprot->getTransport()->flush();" << endl << indent()
-           << (style_ == "Cob" ? "  return cob(true);" : "  return true;") << endl;
+           << '\n' << indent() << "  x.write(oprot);" << '\n' << indent()
+           << "  oprot->writeMessageEnd();" << '\n' << indent()
+           << "  oprot->getTransport()->writeEnd();" << '\n' << indent()
+           << "  oprot->getTransport()->flush();" << '\n' << indent()
+           << (style_ == "Cob" ? "  return cob(true);" : "  return true;") << '\n';
   } else {
     f_out_ << indent() << "  return " << extends_ << "::dispatchCall("
            << (style_ == "Cob" ? "cob, " : "") << "iprot, oprot, fname, seqid" << call_context_arg_
-           << ");" << endl;
+           << ");" << '\n';
   }
-  f_out_ << indent() << "}" << endl;
+  f_out_ << indent() << "}" << '\n';
   if (template_protocol) {
     f_out_ << indent() << "(this->*(pfn->second.specialized))";
   } else {
@@ -3405,17 +3402,17 @@
       f_out_ << indent() << "(this->*(pfn->second))";
     }
   }
-  f_out_ << "(" << cob_arg_ << "seqid, iprot, oprot" << call_context_arg_ << ");" << endl;
+  f_out_ << "(" << cob_arg_ << "seqid, iprot, oprot" << call_context_arg_ << ");" << '\n';
 
   // TODO(dreiss): return pfn ret?
   if (style_ == "Cob") {
-    f_out_ << indent() << "return;" << endl;
+    f_out_ << indent() << "return;" << '\n';
   } else {
-    f_out_ << indent() << "return true;" << endl;
+    f_out_ << indent() << "return true;" << '\n';
   }
 
   indent_down();
-  f_out_ << "}" << endl << endl;
+  f_out_ << "}" << '\n' << '\n';
 }
 
 void ProcessorGenerator::generate_process_functions() {
@@ -3437,49 +3434,49 @@
   // Generate the factory class definition
   f_header_ << template_header_ << "class " << factory_class_name_ << " : public ::apache::thrift::"
             << (style_ == "Cob" ? "async::TAsyncProcessorFactory" : "TProcessorFactory") << " {"
-            << endl << " public:" << endl;
+            << '\n' << " public:" << '\n';
   indent_up();
 
   f_header_ << indent() << factory_class_name_ << "(const ::std::shared_ptr< " << if_factory_name
-            << " >& handlerFactory) noexcept :" << endl << indent()
-            << "    handlerFactory_(handlerFactory) {}" << endl << endl << indent()
+            << " >& handlerFactory) noexcept :" << '\n' << indent()
+            << "    handlerFactory_(handlerFactory) {}" << '\n' << '\n' << indent()
             << "::std::shared_ptr< ::apache::thrift::"
             << (style_ == "Cob" ? "async::TAsyncProcessor" : "TProcessor") << " > "
             << "getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) override;"
-            << endl;
+            << '\n';
 
-  f_header_ << endl << " protected:" << endl << indent() << "::std::shared_ptr< "
-            << if_factory_name << " > handlerFactory_;" << endl;
+  f_header_ << '\n' << " protected:" << '\n' << indent() << "::std::shared_ptr< "
+            << if_factory_name << " > handlerFactory_;" << '\n';
 
   indent_down();
-  f_header_ << "};" << endl << endl;
+  f_header_ << "};" << '\n' << '\n';
 
   // If we are generating templates, output a typedef for the plain
   // factory name.
   if (generator_->gen_templates_) {
     f_header_ << "typedef " << factory_class_name_
               << "< ::apache::thrift::protocol::TDummyProtocol > " << service_name_ << pstyle_
-              << "ProcessorFactory;" << endl << endl;
+              << "ProcessorFactory;" << '\n' << '\n';
   }
 
   // Generate the getProcessor() method
   f_out_ << template_header_ << indent() << "::std::shared_ptr< ::apache::thrift::"
          << (style_ == "Cob" ? "async::TAsyncProcessor" : "TProcessor") << " > "
          << factory_class_name_ << template_suffix_ << "::getProcessor("
-         << "const ::apache::thrift::TConnectionInfo& connInfo) {" << endl;
+         << "const ::apache::thrift::TConnectionInfo& connInfo) {" << '\n';
   indent_up();
 
   f_out_ << indent() << "::apache::thrift::ReleaseHandler< " << if_factory_name
-         << " > cleanup(handlerFactory_);" << endl << indent() << "::std::shared_ptr< "
+         << " > cleanup(handlerFactory_);" << '\n' << indent() << "::std::shared_ptr< "
          << if_name_ << " > handler("
-         << "handlerFactory_->getHandler(connInfo), cleanup);" << endl << indent()
+         << "handlerFactory_->getHandler(connInfo), cleanup);" << '\n' << indent()
          << "::std::shared_ptr< ::apache::thrift::"
          << (style_ == "Cob" ? "async::TAsyncProcessor" : "TProcessor") << " > "
-         << "processor(new " << class_name_ << template_suffix_ << "(handler));" << endl << indent()
-         << "return processor;" << endl;
+         << "processor(new " << class_name_ << template_suffix_ << "(handler));" << '\n' << indent()
+         << "return processor;" << '\n';
 
   indent_down();
-  f_out_ << indent() << "}" << endl << endl;
+  f_out_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -3561,45 +3558,45 @@
   if (style != "Cob") {
     // Open function
     if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl;
+      out << indent() << "template <class Protocol_>" << '\n';
     }
     const bool unnamed_oprot_seqid = tfunction->is_oneway() && !(gen_templates_ && !specialized);
     out << "void " << tservice->get_name() << "Processor" << class_suffix << "::"
         << "process_" << tfunction->get_name() << "("
         << "int32_t" << (unnamed_oprot_seqid ? ", " : " seqid, ") << prot_type << "* iprot, "
         << prot_type << "*" << (unnamed_oprot_seqid ? ", " : " oprot, ") << "void* callContext)"
-        << endl;
+        << '\n';
     scope_up(out);
 
     string argsname = tservice->get_name() + "_" + tfunction->get_name() + "_args";
     string resultname = tservice->get_name() + "_" + tfunction->get_name() + "_result";
 
     if (tfunction->is_oneway() && !unnamed_oprot_seqid) {
-      out << indent() << "(void) seqid;" << endl << indent() << "(void) oprot;" << endl;
+      out << indent() << "(void) seqid;" << '\n' << indent() << "(void) oprot;" << '\n';
     }
 
-    out << indent() << "void* ctx = nullptr;" << endl << indent()
-        << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
+    out << indent() << "void* ctx = nullptr;" << '\n' << indent()
+        << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
         << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", callContext);"
-        << endl << indent() << "}" << endl << indent()
+        << '\n' << indent() << "}" << '\n' << indent()
         << "::apache::thrift::TProcessorContextFreer freer("
-        << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << endl << endl
-        << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->preRead(ctx, " << service_func_name << ");" << endl << indent()
-        << "}" << endl << endl << indent() << argsname << " args;" << endl << indent()
-        << "args.read(iprot);" << endl << indent() << "iprot->readMessageEnd();" << endl << indent()
-        << "uint32_t bytes = iprot->getTransport()->readEnd();" << endl << endl << indent()
-        << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->postRead(ctx, " << service_func_name << ", bytes);" << endl
-        << indent() << "}" << endl << endl;
+        << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << '\n' << '\n'
+        << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->preRead(ctx, " << service_func_name << ");" << '\n' << indent()
+        << "}" << '\n' << '\n' << indent() << argsname << " args;" << '\n' << indent()
+        << "args.read(iprot);" << '\n' << indent() << "iprot->readMessageEnd();" << '\n' << indent()
+        << "uint32_t bytes = iprot->getTransport()->readEnd();" << '\n' << '\n' << indent()
+        << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->postRead(ctx, " << service_func_name << ", bytes);" << '\n'
+        << indent() << "}" << '\n' << '\n';
 
     // Declare result
     if (!tfunction->is_oneway()) {
-      out << indent() << resultname << " result;" << endl;
+      out << indent() << resultname << " result;" << '\n';
     }
 
     // Try block for functions with exceptions
-    out << indent() << "try {" << endl;
+    out << indent() << "try {" << '\n';
     indent_up();
 
     // Generate the function call
@@ -3623,11 +3620,11 @@
       }
       out << "args." << (*f_iter)->get_name();
     }
-    out << ");" << endl;
+    out << ");" << '\n';
 
     // Set isset on success field
     if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-      out << indent() << "result.__isset.success = true;" << endl;
+      out << indent() << "result.__isset.success = true;" << '\n';
     }
 
     indent_down();
@@ -3636,12 +3633,12 @@
     if (!tfunction->is_oneway()) {
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         out << " catch (" << type_name((*x_iter)->get_type()) << " &" << (*x_iter)->get_name()
-            << ") {" << endl;
+            << ") {" << '\n';
         if (!tfunction->is_oneway()) {
           indent_up();
           out << indent() << "result." << (*x_iter)->get_name()
-                          << " = std::move(" << (*x_iter)->get_name() << ");" << endl
-              << indent() << "result.__isset." << (*x_iter)->get_name() << " = true;" << endl;
+                          << " = std::move(" << (*x_iter)->get_name() << ");" << '\n'
+              << indent() << "result.__isset." << (*x_iter)->get_name() << " = true;" << '\n';
           indent_down();
           out << indent() << "}";
         } else {
@@ -3651,53 +3648,53 @@
     }
 
     if (!tfunction->is_oneway()) {
-      out << " catch (const std::exception& e) {" << endl;
+      out << " catch (const std::exception& e) {" << '\n';
     } else {
-      out << " catch (const std::exception&) {" << endl;
+      out << " catch (const std::exception&) {" << '\n';
     }
 
     indent_up();
-    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << endl
-        << indent() << "}" << endl;
+    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << '\n'
+        << indent() << "}" << '\n';
 
     if (!tfunction->is_oneway()) {
-      out << endl << indent() << "::apache::thrift::TApplicationException x(e.what());" << endl
+      out << '\n' << indent() << "::apache::thrift::TApplicationException x(e.what());" << '\n'
           << indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name()
-          << "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << endl << indent()
-          << "x.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();" << endl
-          << indent() << "oprot->getTransport()->writeEnd();" << endl << indent()
-          << "oprot->getTransport()->flush();" << endl;
+          << "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << '\n' << indent()
+          << "x.write(oprot);" << '\n' << indent() << "oprot->writeMessageEnd();" << '\n'
+          << indent() << "oprot->getTransport()->writeEnd();" << '\n' << indent()
+          << "oprot->getTransport()->flush();" << '\n';
     }
-    out << indent() << "return;" << endl;
+    out << indent() << "return;" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     // Shortcut out here for oneway functions
     if (tfunction->is_oneway()) {
-      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->asyncComplete(ctx, " << service_func_name << ");" << endl
-          << indent() << "}" << endl << endl << indent() << "return;" << endl;
+      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->asyncComplete(ctx, " << service_func_name << ");" << '\n'
+          << indent() << "}" << '\n' << '\n' << indent() << "return;" << '\n';
       indent_down();
-      out << "}" << endl << endl;
+      out << "}" << '\n' << '\n';
       return;
     }
 
     // Serialize the result into a struct
-    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << endl << indent()
-        << "}" << endl << endl << indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name()
-        << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl << indent()
-        << "result.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();" << endl
-        << indent() << "bytes = oprot->getTransport()->writeEnd();" << endl << indent()
-        << "oprot->getTransport()->flush();" << endl << endl << indent()
-        << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << endl
-        << indent() << "}" << endl;
+    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << '\n' << indent()
+        << "}" << '\n' << '\n' << indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name()
+        << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << '\n' << indent()
+        << "result.write(oprot);" << '\n' << indent() << "oprot->writeMessageEnd();" << '\n'
+        << indent() << "bytes = oprot->getTransport()->writeEnd();" << '\n' << indent()
+        << "oprot->getTransport()->flush();" << '\n' << '\n' << indent()
+        << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << '\n'
+        << indent() << "}" << '\n';
 
     // Close function
     scope_down(out);
-    out << endl;
+    out << '\n';
   }
 
   // Cob style.
@@ -3705,11 +3702,11 @@
     // Processor entry point.
     // TODO(edhall) update for callContext when TEventServer is ready
     if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl;
+      out << indent() << "template <class Protocol_>" << '\n';
     }
     out << "void " << tservice->get_name() << "AsyncProcessor" << class_suffix << "::process_"
         << tfunction->get_name() << "(::std::function<void(bool ok)> cob, int32_t seqid, "
-        << prot_type << "* iprot, " << prot_type << "* oprot)" << endl;
+        << prot_type << "* iprot, " << prot_type << "* oprot)" << '\n';
     scope_up(out);
 
     // TODO(simpkins): we could try to consoldate this
@@ -3717,55 +3714,55 @@
     if (gen_templates_ && !specialized) {
       // If these are instances of Protocol_, instead of any old TProtocol,
       // use the specialized process function instead.
-      out << indent() << "Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);" << endl << indent()
-          << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << endl << indent()
-          << "if (_iprot && _oprot) {" << endl << indent() << "  return process_"
-          << tfunction->get_name() << "(cob, seqid, _iprot, _oprot);" << endl << indent() << "}"
-          << endl << indent() << "T_GENERIC_PROTOCOL(this, iprot, _iprot);" << endl << indent()
-          << "T_GENERIC_PROTOCOL(this, oprot, _oprot);" << endl << endl;
+      out << indent() << "Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);" << '\n' << indent()
+          << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << '\n' << indent()
+          << "if (_iprot && _oprot) {" << '\n' << indent() << "  return process_"
+          << tfunction->get_name() << "(cob, seqid, _iprot, _oprot);" << '\n' << indent() << "}"
+          << '\n' << indent() << "T_GENERIC_PROTOCOL(this, iprot, _iprot);" << '\n' << indent()
+          << "T_GENERIC_PROTOCOL(this, oprot, _oprot);" << '\n' << '\n';
     }
 
     if (tfunction->is_oneway()) {
-      out << indent() << "(void) seqid;" << endl << indent() << "(void) oprot;" << endl;
+      out << indent() << "(void) seqid;" << '\n' << indent() << "(void) oprot;" << '\n';
     }
 
-    out << indent() << tservice->get_name() + "_" + tfunction->get_name() << "_args args;" << endl
-        << indent() << "void* ctx = nullptr;" << endl << indent()
-        << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << endl
-        << indent() << "}" << endl << indent() << "::apache::thrift::TProcessorContextFreer freer("
-        << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << endl << endl
-        << indent() << "try {" << endl;
+    out << indent() << tservice->get_name() + "_" + tfunction->get_name() << "_args args;" << '\n'
+        << indent() << "void* ctx = nullptr;" << '\n' << indent()
+        << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << '\n'
+        << indent() << "}" << '\n' << indent() << "::apache::thrift::TProcessorContextFreer freer("
+        << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << '\n' << '\n'
+        << indent() << "try {" << '\n';
     indent_up();
-    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->preRead(ctx, " << service_func_name << ");" << endl << indent()
-        << "}" << endl << indent() << "args.read(iprot);" << endl << indent()
-        << "iprot->readMessageEnd();" << endl << indent()
-        << "uint32_t bytes = iprot->getTransport()->readEnd();" << endl << indent()
-        << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "  this->eventHandler_->postRead(ctx, " << service_func_name << ", bytes);" << endl
-        << indent() << "}" << endl;
+    out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->preRead(ctx, " << service_func_name << ");" << '\n' << indent()
+        << "}" << '\n' << indent() << "args.read(iprot);" << '\n' << indent()
+        << "iprot->readMessageEnd();" << '\n' << indent()
+        << "uint32_t bytes = iprot->getTransport()->readEnd();" << '\n' << indent()
+        << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "  this->eventHandler_->postRead(ctx, " << service_func_name << ", bytes);" << '\n'
+        << indent() << "}" << '\n';
     scope_down(out);
 
     // TODO(dreiss): Handle TExceptions?  Expose to server?
-    out << indent() << "catch (const std::exception&) {" << endl << indent()
-        << "  if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-        << "    this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << endl
-        << indent() << "  }" << endl << indent() << "  return cob(false);" << endl << indent()
-        << "}" << endl;
+    out << indent() << "catch (const std::exception&) {" << '\n' << indent()
+        << "  if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+        << "    this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << '\n'
+        << indent() << "  }" << '\n' << indent() << "  return cob(false);" << '\n' << indent()
+        << "}" << '\n';
 
     if (tfunction->is_oneway()) {
-      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->asyncComplete(ctx, " << service_func_name << ");" << endl
-          << indent() << "}" << endl;
+      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->asyncComplete(ctx, " << service_func_name << ");" << '\n'
+          << indent() << "}" << '\n';
     }
     // TODO(dreiss): Figure out a strategy for exceptions in async handlers.
-    out << indent() << "freer.unregister();" << endl;
+    out << indent() << "freer.unregister();" << '\n';
     if (tfunction->is_oneway()) {
       // No return.  Just hand off our cob.
       // TODO(dreiss): Call the cob immediately?
       out << indent() << "iface_->" << tfunction->get_name() << "("
-          << "::std::bind(cob, true)" << endl;
+          << "::std::bind(cob, true)" << '\n';
       indent_up();
       indent_up();
     } else {
@@ -3781,38 +3778,38 @@
       out << indent() << "void (" << tservice->get_name() << "AsyncProcessor" << class_suffix
           << "::*return_fn)(::std::function<void(bool ok)> "
           << "cob, int32_t seqid, " << prot_type << "* oprot, void* ctx" << ret_arg
-          << ") =" << endl;
+          << ") =" << '\n';
       out << indent() << "  &" << tservice->get_name() << "AsyncProcessor" << class_suffix
-          << "::return_" << tfunction->get_name() << ";" << endl;
+          << "::return_" << tfunction->get_name() << ";" << '\n';
       if (!xceptions.empty()) {
         out << indent() << "void (" << tservice->get_name() << "AsyncProcessor" << class_suffix
             << "::*throw_fn)(::std::function<void(bool ok)> "
             << "cob, int32_t seqid, " << prot_type << "* oprot, void* ctx, "
-            << "::apache::thrift::TDelayedException* _throw) =" << endl;
+            << "::apache::thrift::TDelayedException* _throw) =" << '\n';
         out << indent() << "  &" << tservice->get_name() << "AsyncProcessor" << class_suffix
-            << "::throw_" << tfunction->get_name() << ";" << endl;
+            << "::throw_" << tfunction->get_name() << ";" << '\n';
       }
 
-      out << indent() << "iface_->" << tfunction->get_name() << "(" << endl;
+      out << indent() << "iface_->" << tfunction->get_name() << "(" << '\n';
       indent_up();
       indent_up();
       out << indent() << "::std::bind(return_fn, this, cob, seqid, oprot, ctx" << ret_placeholder
           << ")";
       if (!xceptions.empty()) {
-        out << ',' << endl << indent() << "::std::bind(throw_fn, this, cob, seqid, oprot, "
+        out << ',' << '\n' << indent() << "::std::bind(throw_fn, this, cob, seqid, oprot, "
             << "ctx, ::std::placeholders::_1)";
       }
     }
 
     // XXX Whitespace cleanup.
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      out << ',' << endl << indent() << "args." << (*f_iter)->get_name();
+      out << ',' << '\n' << indent() << "args." << (*f_iter)->get_name();
     }
-    out << ");" << endl;
+    out << ");" << '\n';
     indent_down();
     indent_down();
     scope_down(out);
-    out << endl;
+    out << '\n';
 
     // Normal return.
     if (!tfunction->is_oneway()) {
@@ -3822,128 +3819,128 @@
         ret_arg_name = ", _return";
       }
       if (gen_templates_) {
-        out << indent() << "template <class Protocol_>" << endl;
+        out << indent() << "template <class Protocol_>" << '\n';
       }
       out << "void " << tservice->get_name() << "AsyncProcessor" << class_suffix << "::return_"
           << tfunction->get_name() << "(::std::function<void(bool ok)> cob, int32_t seqid, "
-          << prot_type << "* oprot, void* ctx" << ret_arg_decl << ')' << endl;
+          << prot_type << "* oprot, void* ctx" << ret_arg_decl << ')' << '\n';
       scope_up(out);
 
       if (gen_templates_ && !specialized) {
         // If oprot is a Protocol_ instance,
         // use the specialized return function instead.
-        out << indent() << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << endl
-            << indent() << "if (_oprot) {" << endl << indent() << "  return return_"
-            << tfunction->get_name() << "(cob, seqid, _oprot, ctx" << ret_arg_name << ");" << endl
-            << indent() << "}" << endl << indent() << "T_GENERIC_PROTOCOL(this, oprot, _oprot);"
-            << endl << endl;
+        out << indent() << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << '\n'
+            << indent() << "if (_oprot) {" << '\n' << indent() << "  return return_"
+            << tfunction->get_name() << "(cob, seqid, _oprot, ctx" << ret_arg_name << ");" << '\n'
+            << indent() << "}" << '\n' << indent() << "T_GENERIC_PROTOCOL(this, oprot, _oprot);"
+            << '\n' << '\n';
       }
 
       out << indent() << tservice->get_name() << "_" << tfunction->get_name() << "_presult result;"
-          << endl;
+          << '\n';
       if (!tfunction->get_returntype()->is_void()) {
         // The const_cast here is unfortunate, but it would be a pain to avoid,
         // and we only do a write with this struct, which is const-safe.
         out << indent() << "result.success = const_cast<" << type_name(tfunction->get_returntype())
-            << "*>(&_return);" << endl << indent() << "result.__isset.success = true;" << endl;
+            << "*>(&_return);" << '\n' << indent() << "result.__isset.success = true;" << '\n';
       }
       // Serialize the result into a struct
-      out << endl << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << endl
-          << indent() << "}" << endl << indent()
+      out << '\n' << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << '\n'
+          << indent() << "}" << '\n' << indent()
           << "::apache::thrift::TProcessorContextFreer freer("
-          << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << endl << endl
-          << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << endl
-          << indent() << "}" << endl << endl << indent() << "oprot->writeMessageBegin(\""
-          << tfunction->get_name() << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl
-          << indent() << "result.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();"
-          << endl << indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" << endl
-          << indent() << "oprot->getTransport()->flush();" << endl << indent()
-          << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << endl
-          << indent() << "}" << endl << indent() << "return cob(true);" << endl;
+          << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << '\n' << '\n'
+          << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << '\n'
+          << indent() << "}" << '\n' << '\n' << indent() << "oprot->writeMessageBegin(\""
+          << tfunction->get_name() << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << '\n'
+          << indent() << "result.write(oprot);" << '\n' << indent() << "oprot->writeMessageEnd();"
+          << '\n' << indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" << '\n'
+          << indent() << "oprot->getTransport()->flush();" << '\n' << indent()
+          << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << '\n'
+          << indent() << "}" << '\n' << indent() << "return cob(true);" << '\n';
       scope_down(out);
-      out << endl;
+      out << '\n';
     }
 
     // Exception return.
     if (!tfunction->is_oneway() && !xceptions.empty()) {
       if (gen_templates_) {
-        out << indent() << "template <class Protocol_>" << endl;
+        out << indent() << "template <class Protocol_>" << '\n';
       }
       out << "void " << tservice->get_name() << "AsyncProcessor" << class_suffix << "::throw_"
           << tfunction->get_name() << "(::std::function<void(bool ok)> cob, int32_t seqid, "
           << prot_type << "* oprot, void* ctx, "
-          << "::apache::thrift::TDelayedException* _throw)" << endl;
+          << "::apache::thrift::TDelayedException* _throw)" << '\n';
       scope_up(out);
 
       if (gen_templates_ && !specialized) {
         // If oprot is a Protocol_ instance,
         // use the specialized throw function instead.
-        out << indent() << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << endl
-            << indent() << "if (_oprot) {" << endl << indent() << "  return throw_"
-            << tfunction->get_name() << "(cob, seqid, _oprot, ctx, _throw);" << endl << indent()
-            << "}" << endl << indent() << "T_GENERIC_PROTOCOL(this, oprot, _oprot);" << endl
-            << endl;
+        out << indent() << "Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);" << '\n'
+            << indent() << "if (_oprot) {" << '\n' << indent() << "  return throw_"
+            << tfunction->get_name() << "(cob, seqid, _oprot, ctx, _throw);" << '\n' << indent()
+            << "}" << '\n' << indent() << "T_GENERIC_PROTOCOL(this, oprot, _oprot);" << '\n'
+            << '\n';
       }
 
       // Get the event handler context
-      out << endl << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << endl
-          << indent() << "}" << endl << indent()
+      out << '\n' << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  ctx = this->eventHandler_->getContext(" << service_func_name << ", nullptr);" << '\n'
+          << indent() << "}" << '\n' << indent()
           << "::apache::thrift::TProcessorContextFreer freer("
-          << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << endl << endl;
+          << "this->eventHandler_.get(), ctx, " << service_func_name << ");" << '\n' << '\n';
 
       // Throw the TDelayedException, and catch the result
       out << indent() << tservice->get_name() << "_" << tfunction->get_name() << "_result result;"
-          << endl << endl << indent() << "try {" << endl;
+          << '\n' << '\n' << indent() << "try {" << '\n';
       indent_up();
-      out << indent() << "_throw->throw_it();" << endl << indent() << "return cob(false);"
-          << endl; // Is this possible?  TBD.
+      out << indent() << "_throw->throw_it();" << '\n' << indent() << "return cob(false);"
+          << '\n'; // Is this possible?  TBD.
       indent_down();
       out << indent() << '}';
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         out << "  catch (" << type_name((*x_iter)->get_type()) << " &" << (*x_iter)->get_name()
-            << ") {" << endl;
+            << ") {" << '\n';
         indent_up();
         out << indent() << "result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name()
-            << ";" << endl << indent() << "result.__isset." << (*x_iter)->get_name() << " = true;"
-            << endl;
+            << ";" << '\n' << indent() << "result.__isset." << (*x_iter)->get_name() << " = true;"
+            << '\n';
         scope_down(out);
       }
 
       // Handle the case where an undeclared exception is thrown
-      out << " catch (std::exception& e) {" << endl;
+      out << " catch (std::exception& e) {" << '\n';
       indent_up();
-      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << endl
-          << indent() << "}" << endl << endl << indent()
-          << "::apache::thrift::TApplicationException x(e.what());" << endl << indent()
+      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->handlerError(ctx, " << service_func_name << ");" << '\n'
+          << indent() << "}" << '\n' << '\n' << indent()
+          << "::apache::thrift::TApplicationException x(e.what());" << '\n' << indent()
           << "oprot->writeMessageBegin(\"" << tfunction->get_name()
-          << "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << endl << indent()
-          << "x.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();" << endl
-          << indent() << "oprot->getTransport()->writeEnd();" << endl << indent()
-          << "oprot->getTransport()->flush();" << endl <<
+          << "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << '\n' << indent()
+          << "x.write(oprot);" << '\n' << indent() << "oprot->writeMessageEnd();" << '\n'
+          << indent() << "oprot->getTransport()->writeEnd();" << '\n' << indent()
+          << "oprot->getTransport()->flush();" << '\n' <<
           // We pass true to the cob here, since we did successfully write a
           // response, even though it is an exception response.
           // It looks like the argument is currently ignored, anyway.
-          indent() << "return cob(true);" << endl;
+          indent() << "return cob(true);" << '\n';
       scope_down(out);
 
       // Serialize the result into a struct
-      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << endl
-          << indent() << "}" << endl << endl << indent() << "oprot->writeMessageBegin(\""
-          << tfunction->get_name() << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl
-          << indent() << "result.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();"
-          << endl << indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" << endl
-          << indent() << "oprot->getTransport()->flush();" << endl << indent()
-          << "if (this->eventHandler_.get() != nullptr) {" << endl << indent()
-          << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << endl
-          << indent() << "}" << endl << indent() << "return cob(true);" << endl;
+      out << indent() << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->preWrite(ctx, " << service_func_name << ");" << '\n'
+          << indent() << "}" << '\n' << '\n' << indent() << "oprot->writeMessageBegin(\""
+          << tfunction->get_name() << "\", ::apache::thrift::protocol::T_REPLY, seqid);" << '\n'
+          << indent() << "result.write(oprot);" << '\n' << indent() << "oprot->writeMessageEnd();"
+          << '\n' << indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" << '\n'
+          << indent() << "oprot->getTransport()->flush();" << '\n' << indent()
+          << "if (this->eventHandler_.get() != nullptr) {" << '\n' << indent()
+          << "  this->eventHandler_->postWrite(ctx, " << service_func_name << ", bytes);" << '\n'
+          << indent() << "}" << '\n' << indent() << "return cob(true);" << '\n';
       scope_down(out);
-      out << endl;
+      out << '\n';
     } // for each function
   }   // cob style
 }
@@ -3963,58 +3960,58 @@
 
   ofstream_with_content_based_conditional_update f_skeleton;
   f_skeleton.open(f_skeleton_name.c_str());
-  f_skeleton << "// This autogenerated skeleton file illustrates how to build a server." << endl
-             << "// You should copy it to another filename to avoid overwriting it." << endl << endl
-             << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl
-             << "#include <thrift/protocol/TBinaryProtocol.h>" << endl
-             << "#include <thrift/server/TSimpleServer.h>" << endl
-             << "#include <thrift/transport/TServerSocket.h>" << endl
-             << "#include <thrift/transport/TBufferTransports.h>" << endl << endl
-             << "using namespace ::apache::thrift;" << endl
-             << "using namespace ::apache::thrift::protocol;" << endl
-             << "using namespace ::apache::thrift::transport;" << endl
-             << "using namespace ::apache::thrift::server;" << endl << endl;
+  f_skeleton << "// This autogenerated skeleton file illustrates how to build a server." << '\n'
+             << "// You should copy it to another filename to avoid overwriting it." << '\n' << '\n'
+             << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << '\n'
+             << "#include <thrift/protocol/TBinaryProtocol.h>" << '\n'
+             << "#include <thrift/server/TSimpleServer.h>" << '\n'
+             << "#include <thrift/transport/TServerSocket.h>" << '\n'
+             << "#include <thrift/transport/TBufferTransports.h>" << '\n' << '\n'
+             << "using namespace ::apache::thrift;" << '\n'
+             << "using namespace ::apache::thrift::protocol;" << '\n'
+             << "using namespace ::apache::thrift::transport;" << '\n'
+             << "using namespace ::apache::thrift::server;" << '\n' << '\n';
 
   // the following code would not compile:
   // using namespace ;
   // using namespace ::;
   if ((!ns.empty()) && (ns.compare(" ::") != 0)) {
-    f_skeleton << "using namespace " << string(ns, 0, ns.size() - 2) << ";" << endl << endl;
+    f_skeleton << "using namespace " << string(ns, 0, ns.size() - 2) << ";" << '\n' << '\n';
   }
 
-  f_skeleton << "class " << svcname << "Handler : virtual public " << svcname << "If {" << endl
-             << " public:" << endl;
+  f_skeleton << "class " << svcname << "Handler : virtual public " << svcname << "If {" << '\n'
+             << " public:" << '\n';
   indent_up();
-  f_skeleton << indent() << svcname << "Handler() {" << endl << indent()
-             << "  // Your initialization goes here" << endl << indent() << "}" << endl << endl;
+  f_skeleton << indent() << svcname << "Handler() {" << '\n' << indent()
+             << "  // Your initialization goes here" << '\n' << indent() << "}" << '\n' << '\n';
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_skeleton, *f_iter);
-    f_skeleton << indent() << function_signature(*f_iter, "") << " {" << endl << indent()
-               << "  // Your implementation goes here" << endl << indent() << "  printf(\""
-               << (*f_iter)->get_name() << "\\n\");" << endl << indent() << "}" << endl << endl;
+    f_skeleton << indent() << function_signature(*f_iter, "") << " {" << '\n' << indent()
+               << "  // Your implementation goes here" << '\n' << indent() << "  printf(\""
+               << (*f_iter)->get_name() << "\\n\");" << '\n' << indent() << "}" << '\n' << '\n';
   }
 
   indent_down();
-  f_skeleton << "};" << endl << endl;
+  f_skeleton << "};" << '\n' << '\n';
 
-  f_skeleton << indent() << "int main(int argc, char **argv) {" << endl;
+  f_skeleton << indent() << "int main(int argc, char **argv) {" << '\n';
   indent_up();
   f_skeleton
-      << indent() << "int port = 9090;" << endl << indent() << "::std::shared_ptr<" << svcname
-      << "Handler> handler(new " << svcname << "Handler());" << endl << indent()
-      << "::std::shared_ptr<TProcessor> processor(new " << svcname << "Processor(handler));" << endl
+      << indent() << "int port = 9090;" << '\n' << indent() << "::std::shared_ptr<" << svcname
+      << "Handler> handler(new " << svcname << "Handler());" << '\n' << indent()
+      << "::std::shared_ptr<TProcessor> processor(new " << svcname << "Processor(handler));" << '\n'
       << indent() << "::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));"
-      << endl << indent()
-      << "::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());" << endl
+      << '\n' << indent()
+      << "::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());" << '\n'
       << indent() << "::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());"
-      << endl << endl << indent()
+      << '\n' << '\n' << indent()
       << "TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);"
-      << endl << indent() << "server.serve();" << endl << indent() << "return 0;" << endl;
+      << '\n' << indent() << "server.serve();" << '\n' << indent() << "return 0;" << '\n';
   indent_down();
-  f_skeleton << "}" << endl << endl;
+  f_skeleton << "}" << '\n' << '\n';
 
   // Close the files
   f_skeleton.close();
@@ -4077,12 +4074,12 @@
     default:
       throw "compiler error: no C++ reader for base type " + t_base_type::t_base_name(tbase) + " " + name;
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_enum()) {
     string t = tmp("ecast");
-    out << indent() << "int32_t " << t << ";" << endl << indent() << "xfer += iprot->readI32(" << t
-        << ");" << endl << indent() << name << " = static_cast<"
-        << type_name(type) << ">(" << t << ");" << endl;
+    out << indent() << "int32_t " << t << ";" << '\n' << indent() << "xfer += iprot->readI32(" << t
+        << ");" << '\n' << indent() << name << " = static_cast<"
+        << type_name(type) << ">(" << t << ");" << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -4101,22 +4098,22 @@
                                                   string prefix,
                                                   bool pointer) {
   if (pointer) {
-    indent(out) << "if (!" << prefix << ") { " << endl;
+    indent(out) << "if (!" << prefix << ") { " << '\n';
     indent(out) << "  " << prefix << " = ::std::shared_ptr<" << type_name(tstruct) << ">(new "
-                << type_name(tstruct) << ");" << endl;
-    indent(out) << "}" << endl;
-    indent(out) << "xfer += " << prefix << "->read(iprot);" << endl;
-    indent(out) << "bool wasSet = false;" << endl;
+                << type_name(tstruct) << ");" << '\n';
+    indent(out) << "}" << '\n';
+    indent(out) << "xfer += " << prefix << "->read(iprot);" << '\n';
+    indent(out) << "bool wasSet = false;" << '\n';
     const vector<t_field*>& members = tstruct->get_members();
     vector<t_field*>::const_iterator f_iter;
     for (f_iter = members.begin(); f_iter != members.end(); ++f_iter) {
 
       indent(out) << "if (" << prefix << "->__isset." << (*f_iter)->get_name()
-                  << ") { wasSet = true; }" << endl;
+                  << ") { wasSet = true; }" << '\n';
     }
-    indent(out) << "if (!wasSet) { " << prefix << ".reset(); }" << endl;
+    indent(out) << "if (!wasSet) { " << prefix << ".reset(); }" << '\n';
   } else {
-    indent(out) << "xfer += " << prefix << ".read(iprot);" << endl;
+    indent(out) << "xfer += " << prefix << ".read(iprot);" << '\n';
   }
 }
 
@@ -4131,28 +4128,28 @@
   t_container* tcontainer = (t_container*)ttype;
   bool use_push = tcontainer->has_cpp_name();
 
-  indent(out) << prefix << ".clear();" << endl << indent() << "uint32_t " << size << ";" << endl;
+  indent(out) << prefix << ".clear();" << '\n' << indent() << "uint32_t " << size << ";" << '\n';
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << "::apache::thrift::protocol::TType " << ktype << ";" << endl << indent()
-        << "::apache::thrift::protocol::TType " << vtype << ";" << endl << indent()
-        << "xfer += iprot->readMapBegin(" << ktype << ", " << vtype << ", " << size << ");" << endl;
+    out << indent() << "::apache::thrift::protocol::TType " << ktype << ";" << '\n' << indent()
+        << "::apache::thrift::protocol::TType " << vtype << ";" << '\n' << indent()
+        << "xfer += iprot->readMapBegin(" << ktype << ", " << vtype << ", " << size << ");" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << "::apache::thrift::protocol::TType " << etype << ";" << endl << indent()
-        << "xfer += iprot->readSetBegin(" << etype << ", " << size << ");" << endl;
+    out << indent() << "::apache::thrift::protocol::TType " << etype << ";" << '\n' << indent()
+        << "xfer += iprot->readSetBegin(" << etype << ", " << size << ");" << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << "::apache::thrift::protocol::TType " << etype << ";" << endl << indent()
-        << "xfer += iprot->readListBegin(" << etype << ", " << size << ");" << endl;
+    out << indent() << "::apache::thrift::protocol::TType " << etype << ";" << '\n' << indent()
+        << "xfer += iprot->readListBegin(" << etype << ", " << size << ");" << '\n';
     if (!use_push) {
-      indent(out) << prefix << ".resize(" << size << ");" << endl;
+      indent(out) << prefix << ".resize(" << size << ");" << '\n';
     }
   }
 
   // For loop iterates over elements
   string i = tmp("_i");
-  out << indent() << "uint32_t " << i << ";" << endl << indent() << "for (" << i << " = 0; " << i
-      << " < " << size << "; ++" << i << ")" << endl;
+  out << indent() << "uint32_t " << i << ";" << '\n' << indent() << "for (" << i << " = 0; " << i
+      << " < " << size << "; ++" << i << ")" << '\n';
 
   scope_up(out);
 
@@ -4168,11 +4165,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "xfer += iprot->readMapEnd();" << endl;
+    indent(out) << "xfer += iprot->readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "xfer += iprot->readSetEnd();" << endl;
+    indent(out) << "xfer += iprot->readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "xfer += iprot->readListEnd();" << endl;
+    indent(out) << "xfer += iprot->readListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -4187,11 +4184,11 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  out << indent() << declare_field(&fkey) << endl;
+  out << indent() << declare_field(&fkey) << '\n';
 
   generate_deserialize_field(out, &fkey);
   indent(out) << declare_field(&fval, false, false, false, true) << " = " << prefix << "[" << key
-              << "];" << endl;
+              << "];" << '\n';
 
   generate_deserialize_field(out, &fval);
 }
@@ -4200,11 +4197,11 @@
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".insert(" << elem << ");" << endl;
+  indent(out) << prefix << ".insert(" << elem << ");" << '\n';
 }
 
 void t_cpp_generator::generate_deserialize_list_element(ostream& out,
@@ -4215,9 +4212,9 @@
   if (use_push) {
     string elem = tmp("_elem");
     t_field felem(tlist->get_elem_type(), elem);
-    indent(out) << declare_field(&felem) << endl;
+    indent(out) << declare_field(&felem) << '\n';
     generate_deserialize_field(out, &felem);
-    indent(out) << prefix << ".push_back(" << elem << ");" << endl;
+    indent(out) << prefix << ".push_back(" << elem << ");" << '\n';
   } else {
     t_field felem(tlist->get_elem_type(), prefix + "[" + index + "]");
     generate_deserialize_field(out, &felem);
@@ -4292,7 +4289,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(static_cast<int32_t>(" << name << "));";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
            name.c_str(),
@@ -4311,15 +4308,15 @@
                                                 string prefix,
                                                 bool pointer) {
   if (pointer) {
-    indent(out) << "if (" << prefix << ") {" << endl;
-    indent(out) << "  xfer += " << prefix << "->write(oprot); " << endl;
+    indent(out) << "if (" << prefix << ") {" << '\n';
+    indent(out) << "  xfer += " << prefix << "->write(oprot); " << '\n';
     indent(out) << "} else {"
-                << "oprot->writeStructBegin(\"" << tstruct->get_name() << "\"); " << endl;
-    indent(out) << "  oprot->writeStructEnd();" << endl;
-    indent(out) << "  oprot->writeFieldStop();" << endl;
-    indent(out) << "}" << endl;
+                << "oprot->writeStructBegin(\"" << tstruct->get_name() << "\"); " << '\n';
+    indent(out) << "  oprot->writeStructEnd();" << '\n';
+    indent(out) << "  oprot->writeFieldStop();" << '\n';
+    indent(out) << "}" << '\n';
   } else {
-    indent(out) << "xfer += " << prefix << ".write(oprot);" << endl;
+    indent(out) << "xfer += " << prefix << ".write(oprot);" << '\n';
   }
 }
 
@@ -4329,21 +4326,21 @@
   if (ttype->is_map()) {
     indent(out) << "xfer += oprot->writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type())
                 << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
+                << "static_cast<uint32_t>(" << prefix << ".size()));" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "xfer += oprot->writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type())
                 << ", "
-                << "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
+                << "static_cast<uint32_t>(" << prefix << ".size()));" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "xfer += oprot->writeListBegin("
                 << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", "
-                << "static_cast<uint32_t>(" << prefix << ".size()));" << endl;
+                << "static_cast<uint32_t>(" << prefix << ".size()));" << '\n';
   }
 
   string iter = tmp("_iter");
-  out << indent() << type_name(ttype) << "::const_iterator " << iter << ";" << endl << indent()
+  out << indent() << type_name(ttype) << "::const_iterator " << iter << ";" << '\n' << indent()
       << "for (" << iter << " = " << prefix << ".begin(); " << iter << " != " << prefix
-      << ".end(); ++" << iter << ")" << endl;
+      << ".end(); ++" << iter << ")" << '\n';
   scope_up(out);
   if (ttype->is_map()) {
     generate_serialize_map_element(out, (t_map*)ttype, iter);
@@ -4355,11 +4352,11 @@
   scope_down(out);
 
   if (ttype->is_map()) {
-    indent(out) << "xfer += oprot->writeMapEnd();" << endl;
+    indent(out) << "xfer += oprot->writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "xfer += oprot->writeSetEnd();" << endl;
+    indent(out) << "xfer += oprot->writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "xfer += oprot->writeListEnd();" << endl;
+    indent(out) << "xfer += oprot->writeListEnd();" << '\n';
   }
 
   scope_down(out);
diff --git a/compiler/cpp/src/thrift/generate/t_d_generator.cc b/compiler/cpp/src/thrift/generate/t_d_generator.cc
index 38194c2..61988df 100644
--- a/compiler/cpp/src/thrift/generate/t_d_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_d_generator.cc
@@ -43,8 +43,6 @@
 using std::string;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * D code generator.
  *
@@ -105,7 +103,7 @@
 
     // Print header
     f_types_ << autogen_comment() << "module " << render_package(*program_) << program_name_
-             << "_types;" << endl << endl;
+             << "_types;" << '\n' << '\n';
 
     print_default_imports(f_types_);
 
@@ -113,10 +111,10 @@
     const vector<t_program*>& includes = program_->get_includes();
     for (auto include : includes) {
       f_types_ << "public import " << render_package(*include) << include->get_name()
-               << "_types;" << endl;
+               << "_types;" << '\n';
     }
     if (!includes.empty())
-      f_types_ << endl;
+      f_types_ << '\n';
   }
 
   void close_generator() override {
@@ -131,22 +129,22 @@
       f_consts.open(f_consts_name.c_str());
 
       f_consts << autogen_comment() << "module " << render_package(*program_) << program_name_
-               << "_constants;" << endl << endl;
+               << "_constants;" << '\n' << '\n';
 
       print_default_imports(f_consts);
 
-      f_consts << "import " << render_package(*get_program()) << program_name_ << "_types;" << endl
-               << endl;
+      f_consts << "import " << render_package(*get_program()) << program_name_ << "_types;" << '\n'
+               << '\n';
 
       vector<t_const*>::iterator c_iter;
       for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
         this->emit_doc(*c_iter, f_consts);
         string name = suffix_if_reserved((*c_iter)->get_name());
         t_type* type = (*c_iter)->get_type();
-        indent(f_consts) << "immutable(" << render_type_name(type) << ") " << name << ";" << endl;
+        indent(f_consts) << "immutable(" << render_type_name(type) << ") " << name << ";" << '\n';
       }
 
-      f_consts << endl << "shared static this() {" << endl;
+      f_consts << '\n' << "shared static this() {" << '\n';
       indent_up();
 
       bool first = true;
@@ -154,24 +152,24 @@
         if (first) {
           first = false;
         } else {
-          f_consts << endl;
+          f_consts << '\n';
         }
         t_type* type = (*c_iter)->get_type();
         indent(f_consts) << suffix_if_reserved((*c_iter)->get_name()) << " = ";
         if (!is_immutable_type(type)) {
           f_consts << "cast(immutable(" << render_type_name(type) << ")) ";
         }
-        f_consts << render_const_value(type, (*c_iter)->get_value()) << ";" << endl;
+        f_consts << render_const_value(type, (*c_iter)->get_value()) << ";" << '\n';
       }
       indent_down();
-      indent(f_consts) << "}" << endl;
+      indent(f_consts) << "}" << '\n';
     }
   }
 
   void generate_typedef(t_typedef* ttypedef) override {
     this->emit_doc(ttypedef, f_types_);
     f_types_ << indent() << "alias " << render_type_name(ttypedef->get_type()) << " "
-             << ttypedef->get_symbolic() << ";" << endl << endl;
+             << ttypedef->get_symbolic() << ";" << '\n' << '\n';
   }
 
   void generate_enum(t_enum* tenum) override {
@@ -179,7 +177,7 @@
 
     this->emit_doc(tenum, f_types_);
     string enum_name = suffix_if_reserved(tenum->get_name());
-    f_types_ << indent() << "enum " << enum_name << " {" << endl;
+    f_types_ << indent() << "enum " << enum_name << " {" << '\n';
 
     indent_up();
 
@@ -190,11 +188,11 @@
       f_types_ << " = " << (*c_iter)->get_value() << ",";
     }
 
-    f_types_ << endl;
+    f_types_ << '\n';
     indent_down();
-    indent(f_types_) << "}" << endl;
+    indent(f_types_) << "}" << '\n';
 
-    f_types_ << endl;
+    f_types_ << '\n';
   }
 
   void generate_struct(t_struct* tstruct) override {
@@ -213,19 +211,19 @@
     ofstream_with_content_based_conditional_update f_service;
     f_service.open(f_servicename.c_str());
     f_service << autogen_comment() << "module " << suffix_if_reserved(render_package(*program_)) << svc_name << ";"
-              << endl << endl;
+              << '\n' << '\n';
 
     print_default_imports(f_service);
 
-    f_service << "import " << suffix_if_reserved(render_package(*get_program())) << program_name_ << "_types;" << endl;
+    f_service << "import " << suffix_if_reserved(render_package(*get_program())) << program_name_ << "_types;" << '\n';
 
     t_service* extends_service = tservice->get_extends();
     if (extends_service != nullptr) {
       f_service << "import " << suffix_if_reserved(render_package(*(extends_service->get_program())))
-                << suffix_if_reserved(extends_service->get_name()) << ";" << endl;
+                << suffix_if_reserved(extends_service->get_name()) << ";" << '\n';
     }
 
-    f_service << endl;
+    f_service << '\n';
 
     string extends = "";
     if (tservice->get_extends() != nullptr) {
@@ -233,7 +231,7 @@
     }
 
     this->emit_doc(tservice, f_service);
-    f_service << indent() << "interface " << svc_name << extends << " {" << endl;
+    f_service << indent() << "interface " << svc_name << extends << " {" << '\n';
     indent_up();
 
     // Collect all the exception types service methods can throw so we can
@@ -247,7 +245,7 @@
       this->emit_doc(*fn_iter, f_service);
       f_service << indent();
       print_function_signature(f_service, *fn_iter);
-      f_service << ";" << endl;
+      f_service << ";" << '\n';
 
       const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
       vector<t_field*>::const_iterator ex_iter;
@@ -258,13 +256,13 @@
 
     // Alias the exception types into the current scope.
     if (!exception_types.empty())
-      f_service << endl;
+      f_service << '\n';
     set<t_type*>::const_iterator et_iter;
     for (et_iter = exception_types.begin(); et_iter != exception_types.end(); ++et_iter) {
       indent(f_service) << "alias " << render_package(*(*et_iter)->get_program())
                         << (*et_iter)->get_program()->get_name() << "_types"
                         << "." << (*et_iter)->get_name() << " " << (*et_iter)->get_name() << ";"
-                        << endl;
+                        << '\n';
     }
 
     // Write the method metadata.
@@ -283,7 +281,7 @@
         meta << ",";
       }
 
-      meta << endl << indent() << "TMethodMeta(`" << suffix_if_reserved((*fn_iter)->get_name()) << "`, " << endl;
+      meta << '\n' << indent() << "TMethodMeta(`" << suffix_if_reserved((*fn_iter)->get_name()) << "`, " << '\n';
       indent_up();
       indent(meta) << "[";
 
@@ -309,7 +307,7 @@
       meta << "]";
 
       if (!(*fn_iter)->get_xceptions()->get_members().empty() || (*fn_iter)->is_oneway()) {
-        meta << "," << endl << indent() << "[";
+        meta << "," << '\n' << indent() << "[";
 
         bool first = true;
         const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
@@ -329,22 +327,22 @@
       }
 
       if ((*fn_iter)->is_oneway()) {
-        meta << "," << endl << indent() << "TMethodType.ONEWAY";
+        meta << "," << '\n' << indent() << "TMethodType.ONEWAY";
       }
 
       indent_down();
-      meta << endl << indent() << ")";
+      meta << '\n' << indent() << ")";
     }
     indent_down();
 
     string meta_str(meta.str());
     if (!meta_str.empty()) {
-      f_service << endl << indent() << "enum methodMeta = [" << meta_str << endl << indent() << "];"
-                << endl;
+      f_service << '\n' << indent() << "enum methodMeta = [" << meta_str << '\n' << indent() << "];"
+                << '\n';
     }
 
     indent_down();
-    indent(f_service) << "}" << endl;
+    indent(f_service) << "}" << '\n';
 
     // Server skeleton generation.
     string f_skeletonname = package_dir_ + svc_name + "_server.skeleton.d";
@@ -358,14 +356,14 @@
     if (!doc->has_doc()) {
       return;
     }
-    indent(out) << "/**" << std::endl;
+    indent(out) << "/**" << '\n';
     indent_up();
-    // No endl -- comments reliably have a newline at the end.
+    // No line break -- comments reliably have a newline at the end.
     // This is true even for stuff like:
     //     /** method infos */ void foo(/** huh?*/ 1: i64 stuff)
     indent(out) << doc->get_doc();
     indent_down();
-    indent(out) << "*/" << std::endl;
+    indent(out) << "*/" << '\n';
   }
 
 private:
@@ -376,59 +374,59 @@
   void print_server_skeleton(ostream& out, t_service* tservice) {
     string svc_name = suffix_if_reserved(tservice->get_name());
 
-    out << "/*" << endl
-        << " * This auto-generated skeleton file illustrates how to build a server. If you" << endl
-        << " * intend to customize it, you should edit a copy with another file name to " << endl
-        << " * avoid overwriting it when running the generator again." << endl << " */" << endl
-        << "module " << render_package(*tservice->get_program()) << svc_name << "_server;" << endl
-        << endl << "import std.stdio;" << endl << "import thrift.codegen.processor;" << endl
-        << "import thrift.protocol.binary;" << endl << "import thrift.server.simple;" << endl
-        << "import thrift.server.transport.socket;" << endl << "import thrift.transport.buffered;"
-        << endl << "import thrift.util.hashset;" << endl << endl << "import "
-        << render_package(*tservice->get_program()) << svc_name << ";" << endl << "import "
-        << render_package(*get_program()) << program_name_ << "_types;" << endl << endl << endl
-        << "class " << svc_name << "Handler : " << svc_name << " {" << endl;
+    out << "/*" << '\n'
+        << " * This auto-generated skeleton file illustrates how to build a server. If you" << '\n'
+        << " * intend to customize it, you should edit a copy with another file name to " << '\n'
+        << " * avoid overwriting it when running the generator again." << '\n' << " */" << '\n'
+        << "module " << render_package(*tservice->get_program()) << svc_name << "_server;" << '\n'
+        << '\n' << "import std.stdio;" << '\n' << "import thrift.codegen.processor;" << '\n'
+        << "import thrift.protocol.binary;" << '\n' << "import thrift.server.simple;" << '\n'
+        << "import thrift.server.transport.socket;" << '\n' << "import thrift.transport.buffered;"
+        << '\n' << "import thrift.util.hashset;" << '\n' << '\n' << "import "
+        << render_package(*tservice->get_program()) << svc_name << ";" << '\n' << "import "
+        << render_package(*get_program()) << program_name_ << "_types;" << '\n' << '\n' << '\n'
+        << "class " << svc_name << "Handler : " << svc_name << " {" << '\n';
 
     indent_up();
-    out << indent() << "this() {" << endl << indent() << "  // Your initialization goes here."
-        << endl << indent() << "}" << endl << endl;
+    out << indent() << "this() {" << '\n' << indent() << "  // Your initialization goes here."
+        << '\n' << indent() << "}" << '\n' << '\n';
 
     vector<t_function*> functions = tservice->get_functions();
     vector<t_function*>::iterator f_iter;
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       out << indent();
       print_function_signature(out, *f_iter);
-      out << " {" << endl;
+      out << " {" << '\n';
 
       indent_up();
 
-      out << indent() << "// Your implementation goes here." << endl << indent() << "writeln(\""
-          << suffix_if_reserved((*f_iter)->get_name()) << " called\");" << endl;
+      out << indent() << "// Your implementation goes here." << '\n' << indent() << "writeln(\""
+          << suffix_if_reserved((*f_iter)->get_name()) << " called\");" << '\n';
 
       t_type* rt = (*f_iter)->get_returntype();
       if (!rt->is_void()) {
-        indent(out) << "return typeof(return).init;" << endl;
+        indent(out) << "return typeof(return).init;" << '\n';
       }
 
       indent_down();
 
-      out << indent() << "}" << endl << endl;
+      out << indent() << "}" << '\n' << '\n';
     }
 
     indent_down();
-    out << "}" << endl << endl;
+    out << "}" << '\n' << '\n';
 
-    out << indent() << "void main() {" << endl;
+    out << indent() << "void main() {" << '\n';
     indent_up();
-    out << indent() << "auto protocolFactory = new TBinaryProtocolFactory!();" << endl << indent()
+    out << indent() << "auto protocolFactory = new TBinaryProtocolFactory!();" << '\n' << indent()
         << "auto processor = new TServiceProcessor!" << svc_name << "(new " << svc_name
-        << "Handler);" << endl << indent() << "auto serverTransport = new TServerSocket(9090);"
-        << endl << indent() << "auto transportFactory = new TBufferedTransportFactory;" << endl
-        << indent() << "auto server = new TSimpleServer(" << endl << indent()
-        << "  processor, serverTransport, transportFactory, protocolFactory);" << endl << indent()
-        << "server.serve();" << endl;
+        << "Handler);" << '\n' << indent() << "auto serverTransport = new TServerSocket(9090);"
+        << '\n' << indent() << "auto transportFactory = new TBufferedTransportFactory;" << '\n'
+        << indent() << "auto server = new TSimpleServer(" << '\n' << indent()
+        << "  processor, serverTransport, transportFactory, protocolFactory);" << '\n' << indent()
+        << "server.serve();" << '\n';
     indent_down();
-    out << "}" << endl;
+    out << "}" << '\n';
   }
 
   /**
@@ -439,9 +437,9 @@
     const vector<t_field*>& members = tstruct->get_members();
 
     if (is_exception) {
-      indent(out) << "class " << suffix_if_reserved(tstruct->get_name()) << " : TException {" << endl;
+      indent(out) << "class " << suffix_if_reserved(tstruct->get_name()) << " : TException {" << '\n';
     } else {
-      indent(out) << "struct " << suffix_if_reserved(tstruct->get_name()) << " {" << endl;
+      indent(out) << "struct " << suffix_if_reserved(tstruct->get_name()) << " {" << '\n';
     }
     indent_up();
 
@@ -449,11 +447,11 @@
     vector<t_field*>::const_iterator m_iter;
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       indent(out) << render_type_name((*m_iter)->get_type()) << " " << suffix_if_reserved((*m_iter)->get_name()) << ";"
-                  << endl;
+                  << '\n';
     }
 
     if (!members.empty())
-      indent(out) << endl;
+      indent(out) << '\n';
     indent(out) << "mixin TStructHelpers!(";
 
     if (!members.empty()) {
@@ -471,7 +469,7 @@
         } else {
           out << ",";
         }
-        out << endl;
+        out << '\n';
 
         indent(out) << "TFieldMeta(`" << suffix_if_reserved((*m_iter)->get_name()) << "`, " << (*m_iter)->get_key();
 
@@ -485,13 +483,13 @@
       }
 
       indent_down();
-      out << endl << indent() << "]";
+      out << '\n' << indent() << "]";
     }
 
-    out << ");" << endl;
+    out << ");" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 
   /**
@@ -559,13 +557,13 @@
     } else if (type->is_enum()) {
       out << "cast(" << render_type_name(type) << ")" << value->get_integer();
     } else {
-      out << "{" << endl;
+      out << "{" << '\n';
       indent_up();
 
-      indent(out) << render_type_name(type) << " v;" << endl;
+      indent(out) << render_type_name(type) << " v;" << '\n';
       if (type->is_struct() || type->is_xception()) {
         indent(out) << "v = " << (type->is_xception() ? "new " : "") << render_type_name(type)
-                    << "();" << endl;
+                    << "();" << '\n';
 
         const vector<t_field*>& fields = ((t_struct*)type)->get_members();
         vector<t_field*>::const_iterator f_iter;
@@ -583,7 +581,7 @@
                 + v_iter->first->get_string();
           }
           string val = render_const_value(field_type, v_iter->second);
-          indent(out) << "v.set!`" << v_iter->first->get_string() << "`(" << val << ");" << endl;
+          indent(out) << "v.set!`" << v_iter->first->get_string() << "`(" << val << ");" << '\n';
         }
       } else if (type->is_map()) {
         t_type* ktype = ((t_map*)type)->get_key_type();
@@ -597,7 +595,7 @@
           if (!is_immutable_type(ktype)) {
             out << "cast(immutable(" << render_type_name(ktype) << "))";
           }
-          out << key << "] = " << val << ";" << endl;
+          out << key << "] = " << val << ";" << '\n';
         }
       } else if (type->is_list()) {
         t_type* etype = ((t_list*)type)->get_elem_type();
@@ -605,7 +603,7 @@
         vector<t_const_value*>::const_iterator v_iter;
         for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
           string val = render_const_value(etype, *v_iter);
-          indent(out) << "v ~= " << val << ";" << endl;
+          indent(out) << "v ~= " << val << ";" << '\n';
         }
       } else if (type->is_set()) {
         t_type* etype = ((t_set*)type)->get_elem_type();
@@ -613,12 +611,12 @@
         vector<t_const_value*>::const_iterator v_iter;
         for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
           string val = render_const_value(etype, *v_iter);
-          indent(out) << "v ~= " << val << ";" << endl;
+          indent(out) << "v ~= " << val << ";" << '\n';
         }
       } else {
         throw "Compiler error: Invalid type in render_const_value: " + type->get_name();
       }
-      indent(out) << "return v;" << endl;
+      indent(out) << "return v;" << '\n';
 
       indent_down();
       indent(out) << "}()";
@@ -728,8 +726,8 @@
    */
 
   void print_default_imports(ostream& out) {
-    indent(out) << "import thrift.base;" << endl << "import thrift.codegen.base;" << endl
-                << "import thrift.util.hashset;" << endl << endl;
+    indent(out) << "import thrift.base;" << '\n' << "import thrift.codegen.base;" << '\n'
+                << "import thrift.util.hashset;" << '\n' << '\n';
   }
 
   /**
diff --git a/compiler/cpp/src/thrift/generate/t_dart_generator.cc b/compiler/cpp/src/thrift/generate/t_dart_generator.cc
index fda989b..0055043 100644
--- a/compiler/cpp/src/thrift/generate/t_dart_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_dart_generator.cc
@@ -37,9 +37,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-static const string endl2 = "\n\n";
-
 /**
  * Use the current Thrift version for static libraries.  When releasing, update
  * the version in these files.
@@ -89,11 +86,11 @@
   }
 
   void scope_up(std::ostream& out, std::string prefix=" ") {
-    out << prefix << "{" << endl;
+    out << prefix << "{" << '\n';
     indent_up();
   }
 
-  void scope_down(std::ostream& out, std::string postfix=endl) {
+  void scope_down(std::ostream& out, std::string postfix="\n") {
     indent_down();
     indent(out) << "}" << postfix;
   }
@@ -339,7 +336,7 @@
  * @return List of imports for services
  */
 string t_dart_generator::service_imports() {
-  return "import 'dart:async';" + endl;
+  return string("import 'dart:async';") + "\n";
 }
 
 /**
@@ -348,14 +345,14 @@
  * @return List of imports necessary for thrift
  */
 string t_dart_generator::dart_thrift_imports() {
-  string imports = "import 'dart:typed_data' show Uint8List;" + endl +
-                   "import 'package:thrift/thrift.dart';" + endl;
+  string imports = string("import 'dart:typed_data' show Uint8List;") + "\n" +
+                   string("import 'package:thrift/thrift.dart';") + "\n";
 
   // add import for this library
   if (package_prefix_.empty()) {
-    imports += "import 'package:" + library_name_ + "/" + library_name_ + ".dart';" + endl;
+    imports += "import 'package:" + library_name_ + "/" + library_name_ + ".dart';" + "\n";
   } else {
-    imports += "import 'package:" + package_prefix_ + library_name_ + ".dart';" + endl;
+    imports += "import 'package:" + package_prefix_ + library_name_ + ".dart';" + "\n";
   }
 
   // add imports for included thrift files
@@ -364,9 +361,9 @@
     string include_name = find_library_name(include);
     string named_import = "t_" + include_name;
     if (package_prefix_.empty()) {
-      imports += "import 'package:" + include_name + "/" + include_name + ".dart' as " + named_import + ";" + endl;
+      imports += "import 'package:" + include_name + "/" + include_name + ".dart' as " + named_import + ";" + "\n";
     } else {
-      imports += "import 'package:" + package_prefix_ + include_name + ".dart' as " + named_import + ";" + endl;
+      imports += "import 'package:" + package_prefix_ + include_name + ".dart' as " + named_import + ";" + "\n";
     }
   }
 
@@ -395,8 +392,8 @@
   ofstream_with_content_based_conditional_update f_library;
   f_library.open(f_library_name.c_str());
 
-  f_library << autogen_comment() << endl;
-  f_library << "library " << library_prefix_ << library_name_ << ";" << endl2;
+  f_library << autogen_comment() << '\n';
+  f_library << "library " << library_prefix_ << library_name_ << ";" << '\n' << '\n';
   f_library << library_exports_;
 
   f_library.close();
@@ -409,7 +406,7 @@
   } else {
     subdir = library_name_;
   }
-  library_exports_ += "export '" + subdir + "/" + file_name + ".dart' show " + class_name + ";" + endl;
+  library_exports_ += "export '" + subdir + "/" + file_name + ".dart' show " + class_name + ";" + "\n";
 }
 
 void t_dart_generator::generate_dart_pubspec() {
@@ -417,30 +414,30 @@
   ofstream_with_content_based_conditional_update f_pubspec;
   f_pubspec.open(f_pubspec_name.c_str());
 
-  indent(f_pubspec) << "name: " << library_name_ << endl;
-  indent(f_pubspec) << "version: 0.0.1" << endl;
-  indent(f_pubspec) << "description: Autogenerated by Thrift Compiler" << endl;
-  f_pubspec << endl;
+  indent(f_pubspec) << "name: " << library_name_ << '\n';
+  indent(f_pubspec) << "version: 0.0.1" << '\n';
+  indent(f_pubspec) << "description: Autogenerated by Thrift Compiler" << '\n';
+  f_pubspec << '\n';
 
-  indent(f_pubspec) << "environment:" << endl;
+  indent(f_pubspec) << "environment:" << '\n';
   indent_up();
-  indent(f_pubspec) << "sdk: '>=1.24.3 <3.0.0'" << endl;
+  indent(f_pubspec) << "sdk: '>=1.24.3 <3.0.0'" << '\n';
   indent_down();
-  f_pubspec << endl;
+  f_pubspec << '\n';
 
-  indent(f_pubspec) << "dependencies:" << endl;
+  indent(f_pubspec) << "dependencies:" << '\n';
   indent_up();
 
   if (pubspec_lib_.empty()) {
     // default to relative path within working directory, which works for tests
-    indent(f_pubspec) << "thrift:  # ^" << dart_thrift_version << endl;
+    indent(f_pubspec) << "thrift:  # ^" << dart_thrift_version << '\n';
     indent_up();
-    indent(f_pubspec) << "path: ../../../../lib/dart" << endl;
+    indent(f_pubspec) << "path: ../../../../lib/dart" << '\n';
     indent_down();
   } else {
     const vector<std::string> lines = split(pubspec_lib_, '|');
     for (const auto & line : lines) {
-      indent(f_pubspec) << line << endl;
+      indent(f_pubspec) << line << '\n';
     }
   }
 
@@ -448,14 +445,14 @@
   const vector<t_program*>& includes = program_->get_includes();
   for (auto include : includes) {
     string include_name = find_library_name(include);
-    indent(f_pubspec) << include_name << ":" << endl;
+    indent(f_pubspec) << include_name << ":" << '\n';
     indent_up();
-    indent(f_pubspec) << "path: ../" << include_name << endl;
+    indent(f_pubspec) << "path: ../" << include_name << '\n';
     indent_down();
   }
 
   indent_down();
-  f_pubspec << endl;
+  f_pubspec << '\n';
 
   f_pubspec.close();
 }
@@ -483,7 +480,7 @@
   f_enum.open(f_enum_name.c_str());
 
   // Comment and add library
-  f_enum << autogen_comment() << dart_library(file_name) << endl;
+  f_enum << autogen_comment() << dart_library(file_name) << '\n';
 
   string class_name = tenum->get_name();
   export_class_to_library(file_name, class_name);
@@ -495,34 +492,34 @@
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     indent(f_enum) << "static const int " << (*c_iter)->get_name() << " = " << value << ";"
-                   << endl;
+                   << '\n';
   }
 
   // Create a static Set with all valid values for this enum
-  f_enum << endl;
+  f_enum << '\n';
 
-  indent(f_enum) << "static final Set<int> VALID_VALUES = new Set.from([" << endl;
+  indent(f_enum) << "static final Set<int> VALID_VALUES = new Set.from([" << '\n';
   indent_up();
   bool firstValue = true;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     // populate set
     indent(f_enum) << (firstValue ? "" : ", ");
-    f_enum << (*c_iter)->get_name() << endl;
+    f_enum << (*c_iter)->get_name() << '\n';
     firstValue = false;
   }
   indent_down();
-  indent(f_enum) << "]);" << endl;
+  indent(f_enum) << "]);" << '\n';
 
-  indent(f_enum) << "static final Map<int, String> VALUES_TO_NAMES = {" << endl;
+  indent(f_enum) << "static final Map<int, String> VALUES_TO_NAMES = {" << '\n';
   indent_up();
   firstValue = true;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     indent(f_enum) << (firstValue ? "" : ", ");
-    f_enum  << (*c_iter)->get_name() << ": '" << (*c_iter)->get_name() << "'" << endl;
+    f_enum  << (*c_iter)->get_name() << ": '" << (*c_iter)->get_name() << "'" << '\n';
     firstValue = false;
   }
   indent_down();
-  indent(f_enum) << "};" << endl;
+  indent(f_enum) << "};" << '\n';
 
   scope_down(f_enum); // end class
 
@@ -545,8 +542,8 @@
   f_consts.open(f_consts_name.c_str());
 
   // Print header
-  f_consts << autogen_comment() << dart_library(file_name) << endl;
-  f_consts << dart_thrift_imports() << endl;
+  f_consts << autogen_comment() << dart_library(file_name) << '\n';
+  f_consts << dart_thrift_imports() << '\n';
 
   export_class_to_library(file_name, class_name);
   indent(f_consts) << "class " << class_name;
@@ -559,7 +556,7 @@
                       (*c_iter)->get_type(),
                       (*c_iter)->get_value(),
                       false);
-    f_consts << endl;
+    f_consts << '\n';
   }
 
   scope_down(f_consts);
@@ -585,13 +582,13 @@
     }
     string v2 = render_const_value(out, name, type, value);
     out << name;
-    out << " = " << v2 << ";" << endl << endl;
+    out << " = " << v2 << ";" << '\n' << '\n';
   } else if (type->is_enum()) {
     if (!defval) {
       out << type_name(type) << " ";
     }
     out << name;
-    out << " = " << value->get_integer() << ";" << endl << endl;
+    out << " = " << value->get_integer() << ";" << '\n' << '\n';
   } else if (type->is_struct() || type->is_xception()) {
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -610,11 +607,11 @@
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
       string val = render_const_value(out, name, field_type, v_iter->second);
-      out << endl;
+      out << '\n';
       indent(out) << ".." << v_iter->first->get_string() << " = " << val;
     }
     indent_down();
-    out << ";" << endl;
+    out << ";" << '\n';
   } else if (type->is_map()) {
     if (!defval) {
       out << type_name(type) << " ";
@@ -630,11 +627,11 @@
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string key = render_const_value(out, name, ktype, v_iter->first);
       string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << key << ": " << val << "," << endl;
+      indent(out) << key << ": " << val << "," << '\n';
     }
-    scope_down(out, ";" + endl);
+    scope_down(out, string(";") + "\n");
 
-    out << endl;
+    out << '\n';
   } else if (type->is_list() || type->is_set()) {
     if (!defval) {
       out << type_name(type) << " ";
@@ -642,10 +639,10 @@
     out << name << " = ";
     t_type* etype;
     if (type->is_list()) {
-      out << "[" << endl;
+      out << "[" << '\n';
       etype = ((t_list*)type)->get_elem_type();
     } else {
-      out << "new " << type_name(type) << ".from([" << endl;
+      out << "new " << type_name(type) << ".from([" << '\n';
       etype = ((t_set*)type)->get_elem_type();
     }
     const vector<t_const_value*>& val = value->get_list();
@@ -654,14 +651,14 @@
     indent_up();
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << val << "," << endl;
+      indent(out) << val << "," << '\n';
     }
     indent_down();
 
     if (type->is_list()) {
-      indent(out) << "];" << endl;
+      indent(out) << "];" << '\n';
     } else {
-      indent(out) << "]);" << endl;
+      indent(out) << "]);" << '\n';
     }
 
   } else {
@@ -707,7 +704,7 @@
   } else {
     string t = tmp("tmp");
     print_const_value(out, t, type, value, true);
-    out << endl;
+    out << '\n';
     render << t;
   }
 
@@ -744,11 +741,11 @@
   ofstream_with_content_based_conditional_update f_struct;
   f_struct.open(f_struct_name.c_str());
 
-  f_struct << autogen_comment() << dart_library(file_name) << endl;
+  f_struct << autogen_comment() << dart_library(file_name) << '\n';
 
   string imports;
 
-  f_struct << dart_thrift_imports() << endl;
+  f_struct << dart_thrift_imports() << '\n';
 
   generate_dart_struct_definition(f_struct, tstruct, is_exception, false, file_name);
 
@@ -785,7 +782,7 @@
   scope_up(out);
 
   indent(out) << "static final TStruct _STRUCT_DESC = new TStruct(\"" << class_name
-              << "\");" << endl;
+              << "\");" << '\n';
 
   // Members are public for -dart, private for -dartbean
   const vector<t_field*>& members = tstruct->get_members();
@@ -795,33 +792,33 @@
     indent(out) << "static final TField _" << constant_name((*m_iter)->get_name())
                 << "_FIELD_DESC = new TField(\"" << (*m_iter)->get_name() << "\", "
                 << type_to_enum((*m_iter)->get_type()) << ", " << (*m_iter)->get_key() << ");"
-                << endl;
+                << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     generate_dart_doc(out, *m_iter);
     indent(out) << type_name((*m_iter)->get_type()) + " _"
-                << get_member_name((*m_iter)->get_name()) << init_value(*m_iter) << ";" << endl;
+                << get_member_name((*m_iter)->get_name()) << init_value(*m_iter) << ";" << '\n';
 
     indent(out) << "static const int " << upcase_string((*m_iter)->get_name())
-                << " = " << (*m_iter)->get_key() << ";" << endl;
+                << " = " << (*m_iter)->get_key() << ";" << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   // Inner Isset class
   if (members.size() > 0) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if (!type_can_be_null((*m_iter)->get_type())) {
         string field_name = get_member_name((*m_iter)->get_name());
-        indent(out) << "bool __isset_" << field_name << " = false;" << endl;
+        indent(out) << "bool __isset_" << field_name << " = false;" << '\n';
       }
     }
   }
 
-  out << endl;
+  out << '\n';
 
   // Default constructor
   indent(out) << tstruct->get_name() << "()";
@@ -838,7 +835,7 @@
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 
   generate_dart_bean_boilerplate(out, tstruct);
   generate_generic_field_getters(out, tstruct);
@@ -854,7 +851,7 @@
   generate_dart_struct_tostring(out, tstruct);
   generate_dart_validator(out, tstruct);
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -870,20 +867,20 @@
   vector<t_field*>::const_iterator f_iter;
 
   // Declare stack tmp variables and read struct header
-  indent(out) << "TField field;" << endl;
-  indent(out) << "iprot.readStructBegin();" << endl;
+  indent(out) << "TField field;" << '\n';
+  indent(out) << "iprot.readStructBegin();" << '\n';
 
   // Loop over reading in fields
   indent(out) << "while (true)";
   scope_up(out);
 
   // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
+  indent(out) << "field = iprot.readFieldBegin();" << '\n';
 
   // Check for field STOP marker and break
   indent(out) << "if (field.type == TType.STOP)";
   scope_up(out);
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   scope_down(out);
 
   // Switch statement on the field we are reading
@@ -892,7 +889,7 @@
 
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << ":" << endl;
+    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << ":" << '\n';
     indent_up();
 
     indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ")";
@@ -903,33 +900,33 @@
 
     scope_down(out, " else");
     scope_up(out);
-    indent(out) << "TProtocolUtil.skip(iprot, field.type);" << endl;
+    indent(out) << "TProtocolUtil.skip(iprot, field.type);" << '\n';
     scope_down(out);
 
-    indent(out) << "break;" << endl;
+    indent(out) << "break;" << '\n';
     indent_down();
   }
 
   // In the default case we skip the field
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent_up();
-  indent(out) << "TProtocolUtil.skip(iprot, field.type);" << endl;
-  indent(out) << "break;" << endl;
+  indent(out) << "TProtocolUtil.skip(iprot, field.type);" << '\n';
+  indent(out) << "break;" << '\n';
   indent_down();
 
   scope_down(out);
 
   // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
+  indent(out) << "iprot.readFieldEnd();" << '\n';
 
   scope_down(out);
 
-  indent(out) << "iprot.readStructEnd();" << endl2;
+  indent(out) << "iprot.readStructEnd();" << '\n' << '\n';
 
   // in non-beans style, check for required fields of primitive type
   // (which can be checked here but not in the general validate method)
   indent(out) << "// check for required fields of primitive type, which can't be "
-                 "checked in the validate method" << endl;
+                 "checked in the validate method" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
       string field_name = get_member_name((*f_iter)->get_name());
@@ -937,15 +934,15 @@
       scope_up(out);
       indent(out) << "  throw new TProtocolError(TProtocolErrorType.UNKNOWN, \"Required field '"
           << field_name
-          << "' was not found in serialized data! Struct: \" + toString());" << endl;
-      scope_down(out, endl2);
+          << "' was not found in serialized data! Struct: \" + toString());" << '\n';
+      scope_down(out, "\n\n");
     }
   }
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
+  indent(out) << "validate();" << '\n';
 
-  scope_down(out, endl2);
+  scope_down(out, "\n\n");
 }
 
 // generates dart method to perform various checks
@@ -957,7 +954,7 @@
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "// check for required fields" << endl;
+  indent(out) << "// check for required fields" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       string field_name = get_member_name((*f_iter)->get_name());
@@ -966,17 +963,17 @@
         scope_up(out);
         indent(out) << "throw new TProtocolError(TProtocolErrorType.UNKNOWN, \"Required field '"
                     << field_name << "' was not present! Struct: \" + toString());"
-                    << endl;
+                    << '\n';
         scope_down(out);
       } else {
         indent(out) << "// alas, we cannot check '" << field_name
-                    << "' because it's a primitive and you chose the non-beans generator." << endl;
+                    << "' because it's a primitive and you chose the non-beans generator." << '\n';
       }
     }
   }
 
   // check that fields of type enum have valid values
-  indent(out) << "// check that fields of type enum have valid values" << endl;
+  indent(out) << "// check that fields of type enum have valid values" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = (*f_iter);
     t_type* type = field->get_type();
@@ -988,12 +985,12 @@
       scope_up(out);
       indent(out) << "throw new TProtocolError(TProtocolErrorType.UNKNOWN, \"The field '"
                   << field_name << "' has been assigned the invalid value "
-                  << "$" << field_name << "\");" << endl;
+                  << "$" << field_name << "\");" << '\n';
       scope_down(out);
     }
   }
 
-  scope_down(out, endl2);
+  scope_down(out, "\n\n");
 }
 
 /**
@@ -1009,9 +1006,9 @@
   vector<t_field*>::const_iterator f_iter;
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl2;
+  indent(out) << "validate();" << '\n' << '\n';
 
-  indent(out) << "oprot.writeStructBegin(_STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(_STRUCT_DESC);" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     string field_name = get_member_name((*f_iter)->get_name());
@@ -1027,13 +1024,13 @@
     }
 
     indent(out) << "oprot.writeFieldBegin(_" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     if (null_allowed) {
       scope_down(out);
@@ -1043,10 +1040,10 @@
     }
   }
   // Write the struct map
-  indent(out) << "oprot.writeFieldStop();" << endl << indent() << "oprot.writeStructEnd();"
-      << endl;
+  indent(out) << "oprot.writeFieldStop();" << '\n' << indent() << "oprot.writeStructEnd();"
+      << '\n';
 
-  scope_down(out, endl2);
+  scope_down(out, "\n\n");
 }
 
 /**
@@ -1064,7 +1061,7 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "oprot.writeStructBegin(_STRUCT_DESC);" << endl2;
+  indent(out) << "oprot.writeStructBegin(_STRUCT_DESC);" << '\n' << '\n';
 
   bool first = true;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1079,23 +1076,23 @@
     scope_up(out);
 
     indent(out) << "oprot.writeFieldBegin(_" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     scope_down(out, "");
   }
-  out << endl;
+  out << '\n';
 
   // Write the struct map
-  indent(out) << "oprot.writeFieldStop();" << endl << indent()
-      << "oprot.writeStructEnd();" << endl;
+  indent(out) << "oprot.writeFieldStop();" << '\n' << indent()
+      << "oprot.writeStructEnd();" << '\n';
 
-  scope_down(out, endl2);
+  scope_down(out, "\n\n");
 }
 
 void t_dart_generator::generate_generic_field_getters(std::ostream& out,
@@ -1113,19 +1110,19 @@
     t_field* field = *f_iter;
     std::string field_name = get_member_name(field->get_name());
 
-    indent(out) << "case " << upcase_string(field_name) << ":" << endl;
+    indent(out) << "case " << upcase_string(field_name) << ":" << '\n';
     indent_up();
-    indent(out) << "return this." << field_name << ";" << endl;
+    indent(out) << "return this." << field_name << ";" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent_up();
-  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << endl;
+  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << '\n';
   indent_down();
 
   scope_down(out);  // switch
-  scope_down(out, endl2);  // method
+  scope_down(out, "\n\n");  // method
 }
 
 void t_dart_generator::generate_generic_field_setters(std::ostream& out,
@@ -1145,31 +1142,31 @@
     t_field* field = *f_iter;
     std::string field_name = get_member_name(field->get_name());
 
-    indent(out) << "case " << upcase_string(field_name) << ":" << endl;
+    indent(out) << "case " << upcase_string(field_name) << ":" << '\n';
     indent_up();
 
     indent(out) << "if (value == null)";
     scope_up(out);
-    indent(out) << "unset" << get_cap_name(field_name) << "();" << endl;
+    indent(out) << "unset" << get_cap_name(field_name) << "();" << '\n';
 
     scope_down(out, " else");
     scope_up(out);
-    indent(out) << "this." << field_name << " = value;" << endl;
+    indent(out) << "this." << field_name << " = value;" << '\n';
     scope_down(out);
 
-    indent(out) << "break;" << endl;
+    indent(out) << "break;" << '\n';
 
     indent_down();
-    out << endl;
+    out << '\n';
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent_up();
-  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << endl;
+  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << '\n';
   indent_down();
 
   scope_down(out);  // switch
-  scope_down(out, endl2);  // method
+  scope_down(out, "\n\n");  // method
 }
 
 // Creates a generic isSet method that takes the field number as argument
@@ -1179,7 +1176,7 @@
 
   // create the isSet method
   indent(out) << "// Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise" << endl;
+                 "value) and false otherwise" << '\n';
   indent(out) << "bool isSet(int fieldID)";
   scope_up(out);
 
@@ -1188,19 +1185,19 @@
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = *f_iter;
-    indent(out) << "case " << upcase_string(field->get_name()) << ":" << endl;
+    indent(out) << "case " << upcase_string(field->get_name()) << ":" << '\n';
     indent_up();
-    indent(out) << "return " << generate_isset_check(field) << ";" << endl;
+    indent(out) << "return " << generate_isset_check(field) << ";" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent_up();
-  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << endl;
+  indent(out) << "throw new ArgumentError(\"Field $fieldID doesn't exist!\");" << '\n';
   indent_down();
 
   scope_down(out);  // switch
-  scope_down(out, endl2);  // method
+  scope_down(out, "\n\n");  // method
 }
 
 /**
@@ -1219,37 +1216,37 @@
     std::string field_name = get_member_name(field->get_name());
     std::string cap_name = get_cap_name(field_name);
 
-    indent(out) << "// " << field_name << endl;
+    indent(out) << "// " << field_name << '\n';
 
     // Simple getter
     generate_dart_doc(out, field);
-    indent(out) << type_name(type) << " get " << field_name << " => this._" << field_name << ";" << endl2;
+    indent(out) << type_name(type) << " get " << field_name << " => this._" << field_name << ";" << '\n' << '\n';
 
     // Simple setter
     generate_dart_doc(out, field);
     indent(out) << "set " << field_name << "(" << type_name(type) << " " << field_name << ")";
     scope_up(out);
-    indent(out) << "this._" << field_name << " = " << field_name << ";" << endl;
+    indent(out) << "this._" << field_name << " = " << field_name << ";" << '\n';
     generate_isset_set(out, field);
-    scope_down(out, endl2);
+    scope_down(out, "\n\n");
 
     // isSet method
     indent(out) << "bool is" << get_cap_name("set") << cap_name << "()";
     if (type_can_be_null(type)) {
-      out << " => this." << field_name << " != null;" << endl2;
+      out << " => this." << field_name << " != null;" << '\n' << '\n';
     } else {
-      out << " => this.__isset_" << field_name << ";" << endl2;
+      out << " => this.__isset_" << field_name << ";" << '\n' << '\n';
     }
 
     // Unsetter
     indent(out) << "unset" << cap_name << "()";
     scope_up(out);
     if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
+      indent(out) << "this." << field_name << " = null;" << '\n';
     } else {
-      indent(out) << "this.__isset_" << field_name << " = false;" << endl;
+      indent(out) << "this.__isset_" << field_name << " = false;" << '\n';
     }
-    scope_down(out, endl2);
+    scope_down(out, "\n\n");
   }
 }
 
@@ -1264,7 +1261,7 @@
   scope_up(out);
 
   indent(out) << "StringBuffer ret = new StringBuffer(\""
-              << tstruct->get_name() << "(\");" << endl2;
+              << tstruct->get_name() << "(\");" << '\n' << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -1281,36 +1278,36 @@
     std::string field_name = get_member_name(field->get_name());
 
     if (!first) {
-      indent(out) << "ret.write(\", \");" << endl;
+      indent(out) << "ret.write(\", \");" << '\n';
     }
-    indent(out) << "ret.write(\"" << field_name << ":\");" << endl;
+    indent(out) << "ret.write(\"" << field_name << ":\");" << '\n';
     bool can_be_null = type_can_be_null(field->get_type());
     if (can_be_null) {
       indent(out) << "if (this." << field_name << " == null)";
       scope_up(out);
-      indent(out) << "ret.write(\"null\");" << endl;
+      indent(out) << "ret.write(\"null\");" << '\n';
       scope_down(out, " else");
       scope_up(out);
     }
 
     if (field->get_type()->is_binary()) {
-      indent(out) << "ret.write(\"BINARY\");" << endl;
+      indent(out) << "ret.write(\"BINARY\");" << '\n';
     } else if (field->get_type()->is_enum()) {
       indent(out) << "String " << field_name << "_name = "
                   << get_ttype_class_name(field->get_type())
-                  << ".VALUES_TO_NAMES[this." << field_name << "];" << endl;
+                  << ".VALUES_TO_NAMES[this." << field_name << "];" << '\n';
       indent(out) << "if (" << field_name << "_name != null)";
       scope_up(out);
-      indent(out) << "ret.write(" << field_name << "_name);" << endl;
-      indent(out) << "ret.write(\" (\");" << endl;
+      indent(out) << "ret.write(" << field_name << "_name);" << '\n';
+      indent(out) << "ret.write(\" (\");" << '\n';
       scope_down(out);
-      indent(out) << "ret.write(this." << field_name << ");" << endl;
+      indent(out) << "ret.write(this." << field_name << ");" << '\n';
       indent(out) << "if (" << field_name << "_name != null)";
       scope_up(out);
-      indent(out) << "ret.write(\")\");" << endl;
+      indent(out) << "ret.write(\")\");" << '\n';
       scope_down(out);
     } else {
-      indent(out) << "ret.write(this." << field_name << ");" << endl;
+      indent(out) << "ret.write(this." << field_name << ");" << '\n';
     }
 
     if (can_be_null) {
@@ -1320,15 +1317,15 @@
       scope_down(out);
     }
 
-    out << endl;
+    out << '\n';
     first = false;
   }
 
-  indent(out) << "ret.write(\")\");" << endl2;
+  indent(out) << "ret.write(\")\");" << '\n' << '\n';
 
-  indent(out) << "return ret.toString();" << endl;
+  indent(out) << "return ret.toString();" << '\n';
 
-  scope_down(out, endl2);
+  scope_down(out, "\n\n");
 }
 
 /**
@@ -1391,9 +1388,9 @@
   string f_service_name = src_dir_ + "/" + file_name + ".dart";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << autogen_comment() << dart_library(file_name) << endl;
-  f_service_ << service_imports() << dart_thrift_imports() << endl;
-  f_service_ << endl;
+  f_service_ << autogen_comment() << dart_library(file_name) << '\n';
+  f_service_ << service_imports() << dart_thrift_imports() << '\n';
+  f_service_ << '\n';
 
   generate_service_interface(tservice);
   generate_service_client(tservice);
@@ -1424,12 +1421,12 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << endl;
+    f_service_ << '\n';
     generate_dart_doc(f_service_, *f_iter);
-    indent(f_service_) << function_signature(*f_iter) << ";" << endl;
+    indent(f_service_) << function_signature(*f_iter) << ";" << '\n';
   }
 
-  scope_down(f_service_, endl2);
+  scope_down(f_service_, "\n\n");
 }
 
 /**
@@ -1465,31 +1462,31 @@
   indent(f_service_) << "class " << class_name << extends_client
                      << " implements " << service_name_;
   scope_up(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   indent(f_service_) << class_name << "(TProtocol iprot, [TProtocol oprot = null])";
 
   if (!extends.empty()) {
     indent_up();
-    f_service_ << endl;
-    indent(f_service_) << ": super(iprot, oprot);" << endl;
+    f_service_ << '\n';
+    indent(f_service_) << ": super(iprot, oprot);" << '\n';
     indent_down();
   } else {
     scope_up(f_service_);
-    indent(f_service_) << "_iprot = iprot;" << endl;
-    indent(f_service_) << "_oprot = (oprot == null) ? iprot : oprot;" << endl;
+    indent(f_service_) << "_iprot = iprot;" << '\n';
+    indent(f_service_) << "_oprot = (oprot == null) ? iprot : oprot;" << '\n';
     scope_down(f_service_);
   }
-  f_service_ << endl;
+  f_service_ << '\n';
 
   if (extends.empty()) {
-    indent(f_service_) << "TProtocol _iprot;" << endl2;
-    indent(f_service_) << "TProtocol get iprot => _iprot;" << endl2;
-    indent(f_service_) << "TProtocol _oprot;" << endl2;
-    indent(f_service_) << "TProtocol get oprot => _oprot;" << endl2;
-    indent(f_service_) << "int _seqid = 0;" << endl2;
-    indent(f_service_) << "int get seqid => _seqid;" << endl2;
-    indent(f_service_) << "int nextSeqid() => ++_seqid;" << endl2;
+    indent(f_service_) << "TProtocol _iprot;" << '\n' << '\n';
+    indent(f_service_) << "TProtocol get iprot => _iprot;" << '\n' << '\n';
+    indent(f_service_) << "TProtocol _oprot;" << '\n' << '\n';
+    indent(f_service_) << "TProtocol get oprot => _oprot;" << '\n' << '\n';
+    indent(f_service_) << "int _seqid = 0;" << '\n' << '\n';
+    indent(f_service_) << "int get seqid => _seqid;" << '\n' << '\n';
+    indent(f_service_) << "int nextSeqid() => ++_seqid;" << '\n' << '\n';
   }
 
   // Generate client method implementations
@@ -1510,40 +1507,40 @@
     // Serialize the request
     indent(f_service_) << "oprot.writeMessageBegin(new TMessage(\"" << (*f_iter)->get_name() << "\", "
                << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-               << ", nextSeqid()));" << endl;
-    indent(f_service_) << argsname << " args = new " << argsname << "();" << endl;
+               << ", nextSeqid()));" << '\n';
+    indent(f_service_) << argsname << " args = new " << argsname << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       string arg_field_name = get_member_name((*fld_iter)->get_name());
       indent(f_service_) << "args." << arg_field_name << " = "
-                 << arg_field_name << ";" << endl;
+                 << arg_field_name << ";" << '\n';
     }
 
-    indent(f_service_) << "args.write(oprot);" << endl;
-    indent(f_service_) << "oprot.writeMessageEnd();" << endl2;
+    indent(f_service_) << "args.write(oprot);" << '\n';
+    indent(f_service_) << "oprot.writeMessageEnd();" << '\n' << '\n';
 
-    indent(f_service_) << "await oprot.transport.flush();" << endl2;
+    indent(f_service_) << "await oprot.transport.flush();" << '\n' << '\n';
 
     if (!(*f_iter)->is_oneway()) {
-      indent(f_service_) << "TMessage msg = iprot.readMessageBegin();" << endl;
+      indent(f_service_) << "TMessage msg = iprot.readMessageBegin();" << '\n';
       indent(f_service_) << "if (msg.type == TMessageType.EXCEPTION)";
       scope_up(f_service_);
-      indent(f_service_) << "TApplicationError error = TApplicationError.read(iprot);" << endl;
-      indent(f_service_) << "iprot.readMessageEnd();" << endl;
-      indent(f_service_) << "throw error;" << endl;
-      scope_down(f_service_, endl2);
+      indent(f_service_) << "TApplicationError error = TApplicationError.read(iprot);" << '\n';
+      indent(f_service_) << "iprot.readMessageEnd();" << '\n';
+      indent(f_service_) << "throw error;" << '\n';
+      scope_down(f_service_, "\n\n");
 
       string result_class = get_result_class_name((*f_iter)->get_name());
-      indent(f_service_) << result_class << " result = new " << result_class << "();" << endl;
-      indent(f_service_) << "result.read(iprot);" << endl;
-      indent(f_service_) << "iprot.readMessageEnd();" << endl;
+      indent(f_service_) << result_class << " result = new " << result_class << "();" << '\n';
+      indent(f_service_) << "result.read(iprot);" << '\n';
+      indent(f_service_) << "iprot.readMessageEnd();" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
         indent(f_service_) << "if (result." << generate_isset_check("success") << ")";
         scope_up(f_service_);
-        indent(f_service_) << "return result.success;" << endl;
-        scope_down(f_service_, endl2);
+        indent(f_service_) << "return result.success;" << '\n';
+        scope_down(f_service_, "\n\n");
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -1553,23 +1550,23 @@
         string result_field_name = get_member_name((*x_iter)->get_name());
         indent(f_service_) << "if (result." << result_field_name << " != null)";
         scope_up(f_service_);
-        indent(f_service_) << "throw result." << result_field_name << ";" << endl;
+        indent(f_service_) << "throw result." << result_field_name << ";" << '\n';
         scope_down(f_service_);
       }
 
       // If you get here it's an exception, unless a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "return;" << '\n';
       } else {
         indent(f_service_) << "throw new TApplicationError(TApplicationErrorType.MISSING_RESULT, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
+                   << (*f_iter)->get_name() << " failed: unknown result\");" << '\n';
       }
     }
 
-    scope_down(f_service_, endl2);
+    scope_down(f_service_, "\n\n");
   }
 
-  scope_down(f_service_, endl2);
+  scope_down(f_service_, "\n\n");
 }
 
 /**
@@ -1583,7 +1580,7 @@
   vector<t_function*>::iterator f_iter;
 
   // typedef
-  indent(f_service_) << "typedef void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);" << endl2;
+  indent(f_service_) << "typedef void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);" << '\n' << '\n';
 
   // Extends stuff
   string extends = "";
@@ -1602,57 +1599,57 @@
   indent(f_service_) << class_name << "(" << service_name_ << " iface)";
   if (!extends.empty()) {
     indent_up();
-    f_service_ << endl;
+    f_service_ << '\n';
     indent(f_service_) << ": super(iface)";
     indent_down();
   }
   scope_up(f_service_);
 
   if (extends.empty()) {
-    indent(f_service_) << "iface_ = iface;" << endl;
+    indent(f_service_) << "iface_ = iface;" << '\n';
   }
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "PROCESS_MAP[\"" << (*f_iter)->get_name()
-               << "\"] = " << get_member_name((*f_iter)->get_name()) << ";" << endl;
+               << "\"] = " << get_member_name((*f_iter)->get_name()) << ";" << '\n';
   }
-  scope_down(f_service_, endl2);
+  scope_down(f_service_, "\n\n");
 
-  indent(f_service_) << service_name_ << " iface_;" << endl;
+  indent(f_service_) << service_name_ << " iface_;" << '\n';
 
   if (extends.empty()) {
-    indent(f_service_) << "final Map<String, ProcessFunction> PROCESS_MAP = {};" << endl;
+    indent(f_service_) << "final Map<String, ProcessFunction> PROCESS_MAP = {};" << '\n';
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the server implementation
   indent(f_service_) << "bool process(TProtocol iprot, TProtocol oprot)";
   scope_up(f_service_);
-  indent(f_service_) << "TMessage msg = iprot.readMessageBegin();" << endl;
-  indent(f_service_) << "ProcessFunction fn = PROCESS_MAP[msg.name];" << endl;
+  indent(f_service_) << "TMessage msg = iprot.readMessageBegin();" << '\n';
+  indent(f_service_) << "ProcessFunction fn = PROCESS_MAP[msg.name];" << '\n';
   indent(f_service_) << "if (fn == null)";
   scope_up(f_service_);
-  indent(f_service_) << "TProtocolUtil.skip(iprot, TType.STRUCT);" << endl;
-  indent(f_service_) << "iprot.readMessageEnd();" << endl;
+  indent(f_service_) << "TProtocolUtil.skip(iprot, TType.STRUCT);" << '\n';
+  indent(f_service_) << "iprot.readMessageEnd();" << '\n';
   indent(f_service_) << "TApplicationError x = new TApplicationError(TApplicationErrorType.UNKNOWN_METHOD, "
-         "\"Invalid method name: '\"+msg.name+\"'\");" << endl;
-  indent(f_service_) << "oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));" << endl;
-  indent(f_service_) << "x.write(oprot);" << endl;
-  indent(f_service_) << "oprot.writeMessageEnd();" << endl;
-  indent(f_service_) << "oprot.transport.flush();" << endl;
-  indent(f_service_) << "return true;" << endl;
+         "\"Invalid method name: '\"+msg.name+\"'\");" << '\n';
+  indent(f_service_) << "oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));" << '\n';
+  indent(f_service_) << "x.write(oprot);" << '\n';
+  indent(f_service_) << "oprot.writeMessageEnd();" << '\n';
+  indent(f_service_) << "oprot.transport.flush();" << '\n';
+  indent(f_service_) << "return true;" << '\n';
   scope_down(f_service_);
-  indent(f_service_) << "fn(msg.seqid, iprot, oprot);" << endl;
-  indent(f_service_) << "return true;" << endl;
-  scope_down(f_service_, endl2); // process function
+  indent(f_service_) << "fn(msg.seqid, iprot, oprot);" << '\n';
+  indent(f_service_) << "return true;" << '\n';
+  scope_down(f_service_, "\n\n"); // process function
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_process_function(tservice, *f_iter);
   }
 
-  scope_down(f_service_, endl2); // class
+  scope_down(f_service_, "\n\n"); // class
 }
 
 /**
@@ -1700,16 +1697,16 @@
   string argsname = get_args_class_name(tfunction->get_name());
   string resultname = get_result_class_name(tfunction->get_name());
 
-  indent(f_service_) << argsname << " args = new " << argsname << "();" << endl;
-  indent(f_service_) << "args.read(iprot);" << endl;
-  indent(f_service_) << "iprot.readMessageEnd();" << endl;
+  indent(f_service_) << argsname << " args = new " << argsname << "();" << '\n';
+  indent(f_service_) << "args.read(iprot);" << '\n';
+  indent(f_service_) << "iprot.readMessageEnd();" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
   vector<t_field*>::const_iterator x_iter;
 
   if (!tfunction->is_oneway()) {
-    indent(f_service_) << resultname << " result = new " << resultname << "();" << endl;
+    indent(f_service_) << resultname << " result = new " << resultname << "();" << '\n';
   }
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
@@ -1736,7 +1733,7 @@
     }
     f_service_ << "args." << get_member_name((*f_iter)->get_name());
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
@@ -1747,36 +1744,36 @@
       scope_up(f_service_);
       if (!tfunction->is_oneway()) {
         indent(f_service_) << "result." << result_field_name << " = "
-                   << result_field_name << ";" << endl;
+                   << result_field_name << ";" << '\n';
       }
     }
     scope_down(f_service_, " ");
     f_service_ << "catch (th)";
     scope_up(f_service_);
-    indent(f_service_) << "// Internal error" << endl;
+    indent(f_service_) << "// Internal error" << '\n';
     indent(f_service_) << "TApplicationError x = new "
                "TApplicationError(TApplicationErrorType.INTERNAL_ERROR, \"Internal error processing "
-               << tfunction->get_name() << "\");" << endl;
+               << tfunction->get_name() << "\");" << '\n';
     indent(f_service_) << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-               << "\", TMessageType.EXCEPTION, seqid));" << endl;
-    indent(f_service_) << "x.write(oprot);" << endl;
-    indent(f_service_) << "oprot.writeMessageEnd();" << endl;
-    indent(f_service_) << "oprot.transport.flush();" << endl;
-    indent(f_service_) << "return;" << endl;
+               << "\", TMessageType.EXCEPTION, seqid));" << '\n';
+    indent(f_service_) << "x.write(oprot);" << '\n';
+    indent(f_service_) << "oprot.writeMessageEnd();" << '\n';
+    indent(f_service_) << "oprot.transport.flush();" << '\n';
+    indent(f_service_) << "return;" << '\n';
     scope_down(f_service_);
   }
 
   if (tfunction->is_oneway()) {
-    indent(f_service_) << "return;" << endl;
+    indent(f_service_) << "return;" << '\n';
   } else {
     indent(f_service_) << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-               << "\", TMessageType.REPLY, seqid));" << endl;
-    indent(f_service_) << "result.write(oprot);" << endl;
-    indent(f_service_) << "oprot.writeMessageEnd();" << endl;
-    indent(f_service_) << "oprot.transport.flush();" << endl;
+               << "\", TMessageType.REPLY, seqid));" << '\n';
+    indent(f_service_) << "result.write(oprot);" << '\n';
+    indent(f_service_) << "oprot.writeMessageEnd();" << '\n';
+    indent(f_service_) << "oprot.transport.flush();" << '\n';
   }
 
-  scope_down(f_service_, endl2);
+  scope_down(f_service_, "\n\n");
 }
 
 /**
@@ -1840,7 +1837,7 @@
     } else if (type->is_enum()) {
       out << "readI32();";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            field_name.c_str(),
@@ -1852,8 +1849,8 @@
  * Generates an unserializer for a struct, invokes read()
  */
 void t_dart_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
-  indent(out) << prefix << " = new " << type_name(tstruct) << "();" << endl;
-  indent(out) << prefix << ".read(iprot);" << endl;
+  indent(out) << prefix << " = new " << type_name(tstruct) << "();" << '\n';
+  indent(out) << prefix << ".read(iprot);" << '\n';
 }
 
 /**
@@ -1875,14 +1872,14 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    indent(out) << "TMap " << obj << " = iprot.readMapBegin();" << endl;
+    indent(out) << "TMap " << obj << " = iprot.readMapBegin();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "TSet " << obj << " = iprot.readSetBegin();" << endl;
+    indent(out) << "TSet " << obj << " = iprot.readSetBegin();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "TList " << obj << " = iprot.readListBegin();" << endl;
+    indent(out) << "TList " << obj << " = iprot.readListBegin();" << '\n';
   }
 
-  indent(out) << prefix << " = new " << type_name(ttype) << "();" << endl;
+  indent(out) << prefix << " = new " << type_name(ttype) << "();" << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
@@ -1903,11 +1900,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd();" << endl;
+    indent(out) << "iprot.readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd();" << endl;
+    indent(out) << "iprot.readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd();" << endl;
+    indent(out) << "iprot.readListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -1922,13 +1919,13 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
+  indent(out) << declare_field(&fkey) << '\n';
+  indent(out) << declare_field(&fval) << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << prefix << "[" << key << "] = " << val << ";" << endl;
+  indent(out) << prefix << "[" << key << "] = " << val << ";" << '\n';
 }
 
 /**
@@ -1938,11 +1935,11 @@
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 }
 
 /**
@@ -1954,11 +1951,11 @@
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 }
 
 /**
@@ -2022,7 +2019,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(" << name << ");";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -2039,7 +2036,7 @@
  */
 void t_dart_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << prefix << ".write(oprot);" << endl;
+  indent(out) << prefix << ".write(oprot);" << '\n';
 }
 
 /**
@@ -2056,14 +2053,14 @@
     string iter = tmp("_key");
     indent(out) << "oprot.writeMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
                 << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix << ".length));"
-                << endl;
+                << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot.writeSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".length));" << endl;
+                << ", " << prefix << ".length));" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot.writeListBegin(new TList("
                 << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".length));"
-                << endl;
+                << '\n';
   }
 
   string iter = tmp("elem");
@@ -2086,11 +2083,11 @@
   scope_down(out);
 
   if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd();" << endl;
+    indent(out) << "oprot.writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd();" << endl;
+    indent(out) << "oprot.writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd();" << endl;
+    indent(out) << "oprot.writeListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -2496,7 +2493,7 @@
 void t_dart_generator::generate_isset_set(ostream& out, t_field* field) {
   if (!type_can_be_null(field->get_type())) {
     string field_name = get_member_name(field->get_name());
-    indent(out) << "this.__isset_" << field_name << " = true;" << endl;
+    indent(out) << "this.__isset_" << field_name << " = true;" << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_delphi_generator.cc b/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
index c599836..d5e8d5d 100644
--- a/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
@@ -53,8 +53,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 class t_delphi_generator : public t_oop_generator {
 public:
   t_delphi_generator(t_program* program,
@@ -409,12 +407,12 @@
 
   const std::string DELPHI_KEYWORDS[81] = {
     // keywords
-    "and", "array", "as", "asm", "at", "automated", "begin", "case", "class", "const", "constructor", 
-    "destructor", "dispinterface", "div", "do", "downto", "else", "end", "except", "exports", "file", 
-    "finalization", "finally", "for", "function", "goto", "if", "implementation", "in", "inherited", 
-    "initialization", "inline", "interface", "is", "label", "library", "mod", "nil", "not", "object", 
-    "of", "on", "or", "out", "packed", "private", "procedure", "program", "property", "protected", 
-    "public", "published", "raise", "record", "repeat", "resourcestring", "set", "shl", "shr", "string", 
+    "and", "array", "as", "asm", "at", "automated", "begin", "case", "class", "const", "constructor",
+    "destructor", "dispinterface", "div", "do", "downto", "else", "end", "except", "exports", "file",
+    "finalization", "finally", "for", "function", "goto", "if", "implementation", "in", "inherited",
+    "initialization", "inline", "interface", "is", "label", "library", "mod", "nil", "not", "object",
+    "of", "on", "or", "out", "packed", "private", "procedure", "program", "property", "protected",
+    "public", "published", "raise", "record", "repeat", "resourcestring", "set", "shl", "shr", "string",
     "then", "threadvar", "to", "try", "type", "unit", "until", "uses", "var", "while", "with", "xor",
     // predefined types (lowercase!)
     "ansistring", "boolean", "double", "int64", "integer", "shortint", "smallint", "string", "unicodestring"
@@ -427,19 +425,19 @@
 
   // reserved method names (lowercase!)
   const std::string DELPHI_RESERVED_METHOD[31] = {
-    "afterconstruction", "beforedestruction", "classinfo", "classname", "classnameis", "classparent", 
-    "classtype", "cleanupinstance", "create", "defaulthandler", "destroy", "dispatch", "equals", 
-    "fieldaddress", "free", "freeinstance", "gethashcode", "getinterface", "getinterfaceentry", 
-    "getinterfacetable", "inheritsfrom", "initinstance", "instancesize", "methodaddress", "methodname", 
+    "afterconstruction", "beforedestruction", "classinfo", "classname", "classnameis", "classparent",
+    "classtype", "cleanupinstance", "create", "defaulthandler", "destroy", "dispatch", "equals",
+    "fieldaddress", "free", "freeinstance", "gethashcode", "getinterface", "getinterfaceentry",
+    "getinterfacetable", "inheritsfrom", "initinstance", "instancesize", "methodaddress", "methodname",
     "newinstance", "read", "safecallexception", "tostring", "unitname", "write"
   };
 
   // reserved exception class method names (lowercase!)
   const std::string DELPHI_RESERVED_METHOD_EXCEPTION[23] = {
-    "setinnerexception", "setstackinfo", "getstacktrace", "raisingexception", "createfmt", "createres", 
-    "createresfmt", "createhelp", "createfmthelp", "createreshelp", "createresfmthelp", "getbaseexception", 
-    "baseexception", "helpcontext", "innerexception", "message", "stacktrace", "stackinfo", 
-    "getexceptionstackinfoproc", "getstackinfostringproc", "cleanupstackinfoproc", "raiseouterexception", 
+    "setinnerexception", "setstackinfo", "getstacktrace", "raisingexception", "createfmt", "createres",
+    "createresfmt", "createhelp", "createfmthelp", "createreshelp", "createresfmthelp", "getbaseexception",
+    "baseexception", "helpcontext", "innerexception", "message", "stacktrace", "stackinfo",
+    "getexceptionstackinfoproc", "getstackinfostringproc", "cleanupstackinfoproc", "raiseouterexception",
     "throwouterexception"
   };
 
@@ -628,10 +626,10 @@
   }
 
   // neither reserved nor keyword?
-  if (!(b_reserved || b_keyword)) {  
+  if (!(b_reserved || b_keyword)) {
     return name;
   }
-  
+
   // apply the rule: old style '_' postfix or more modern '&' prefix?
   // underscore always on non-keywords or when explicitly asked via arg
   if( (!b_keyword) || old_names_ || b_force_underscore) {
@@ -707,25 +705,25 @@
   }
 
   unitname = normalize_name(unitname,false,false,true/*force underscore*/);
-  
+
   std::string f_name = get_out_dir() + "/" + unitname + ".pas";
   ofstream_with_content_based_conditional_update f_all;
 
   f_all.open(f_name);
 
-  f_all << autogen_comment() << endl;
+  f_all << autogen_comment() << '\n';
   generate_delphi_doc(f_all, program_);
-  f_all << "unit " << unitname << ";" << endl << endl;
-  f_all << "{$WARN SYMBOL_DEPRECATED OFF}" << endl;
+  f_all << "unit " << unitname << ";" << '\n' << '\n';
+  f_all << "{$WARN SYMBOL_DEPRECATED OFF}" << '\n';
   if(com_types_) {
-    f_all << "{$MINENUMSIZE 4}" << endl;
+    f_all << "{$MINENUMSIZE 4}" << '\n';
   }
   if(rtti_) {
-    f_all << "{$IFOPT M+} {$DEFINE TYPEINFO_WAS_ON} {$ELSE} {$UNDEF TYPEINFO_WAS_ON} {$ENDIF}" << endl;
+    f_all << "{$IFOPT M+} {$DEFINE TYPEINFO_WAS_ON} {$ELSE} {$UNDEF TYPEINFO_WAS_ON} {$ENDIF}" << '\n';
   }
-  f_all << endl;
-  f_all << "interface" << endl << endl;
-  f_all << "uses" << endl;
+  f_all << '\n';
+  f_all << "interface" << '\n' << '\n';
+  f_all << "uses" << '\n';
 
   indent_up();
 
@@ -733,12 +731,12 @@
   for (s_iter = uses_list.begin(); s_iter != uses_list.end(); ++s_iter) {
     if (s_iter != uses_list.begin()) {
       f_all << ",";
-      f_all << endl;
+      f_all << '\n';
     }
     indent(f_all) << *s_iter;
   }
 
-  f_all << ";" << endl << endl;
+  f_all << ";" << '\n' << '\n';
 
   indent_down();
 
@@ -749,70 +747,70 @@
     }
   }
 
-  f_all << "const" << endl;
+  f_all << "const" << '\n';
   indent_up();
-  indent(f_all) << "c" << tmp_unit << "_Option_Register_Types = " << (register_types_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_ConstPrefix    = " << (constprefix_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_Events         = " << (events_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_XmlDoc         = " << (xmldoc_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_Async          = " << (async_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_COM_types      = " << (com_types_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_Old_Names      = " << (old_names_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_RTTI           = " << (rtti_ ? "True" : "False") << ";" << endl;
+  indent(f_all) << "c" << tmp_unit << "_Option_Register_Types = " << (register_types_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_ConstPrefix    = " << (constprefix_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_Events         = " << (events_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_XmlDoc         = " << (xmldoc_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_Async          = " << (async_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_COM_types      = " << (com_types_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_Old_Names      = " << (old_names_ ? "True" : "False") << ";" << '\n';
+  indent(f_all) << "c" << tmp_unit << "_Option_RTTI           = " << (rtti_ ? "True" : "False") << ";" << '\n';
   indent_down();
 
-  f_all << endl;
-  f_all << "type" << endl;
+  f_all << '\n';
+  f_all << "type" << '\n';
   if (has_forward) {
-    f_all << s_forward_decr.str() << endl;
+    f_all << s_forward_decr.str() << '\n';
   }
   if (has_enum) {
-    indent(f_all) << endl;
-    indent(f_all) << "{$SCOPEDENUMS ON}" << endl << endl;
+    indent(f_all) << '\n';
+    indent(f_all) << "{$SCOPEDENUMS ON}" << '\n' << '\n';
     f_all << s_enum.str();
-    indent(f_all) << "{$SCOPEDENUMS OFF}" << endl << endl;
+    indent(f_all) << "{$SCOPEDENUMS OFF}" << '\n' << '\n';
   }
   f_all << s_struct.str();
   f_all << s_service.str();
   f_all << s_const.str();
-  f_all << "implementation" << endl << endl;
+  f_all << "implementation" << '\n' << '\n';
   f_all << s_struct_impl.str();
   f_all << s_service_impl.str();
   f_all << s_const_impl.str();
 
   if (register_types_) {
-    f_all << endl;
-    f_all << "// Type factory methods and registration" << endl;
+    f_all << '\n';
+    f_all << "// Type factory methods and registration" << '\n';
     f_all << s_type_factory_funcs.str();
-    f_all << "procedure RegisterTypeFactories;" << endl;
-    f_all << "begin" << endl;
+    f_all << "procedure RegisterTypeFactories;" << '\n';
+    f_all << "begin" << '\n';
     f_all << s_type_factory_registration.str();
-    f_all << "end;" << endl;
+    f_all << "end;" << '\n';
   }
-  f_all << endl;
+  f_all << '\n';
 
   string constants_class = make_constants_classname();
 
-  f_all << "initialization" << endl;
+  f_all << "initialization" << '\n';
   if (has_const) {
-    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
-    f_all << "  " << constants_class.c_str() << "_Initialize;" << endl;
-    f_all << "{$IFEND}" << endl;
+    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << '\n';
+    f_all << "  " << constants_class.c_str() << "_Initialize;" << '\n';
+    f_all << "{$IFEND}" << '\n';
   }
   if (register_types_) {
-    f_all << "  RegisterTypeFactories;" << endl;
+    f_all << "  RegisterTypeFactories;" << '\n';
   }
-  f_all << endl;
+  f_all << '\n';
 
-  f_all << "finalization" << endl;
+  f_all << "finalization" << '\n';
   if (has_const) {
-    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
-    f_all << "  " << constants_class.c_str() << "_Finalize;" << endl;
-    f_all << "{$IFEND}" << endl;
+    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << '\n';
+    f_all << "  " << constants_class.c_str() << "_Finalize;" << '\n';
+    f_all << "{$IFEND}" << '\n';
   }
-  f_all << endl << endl;
+  f_all << '\n' << '\n';
 
-  f_all << "end." << endl;
+  f_all << "end." << '\n';
   f_all.close();
 
   if (!typedefs_pending.empty()) {
@@ -828,8 +826,8 @@
 void t_delphi_generator::delphi_type_usings(ostream& out) {
   indent_up();
   indent(out) << "Classes, SysUtils, Generics.Collections, Thrift.Collections, Thrift.Protocol,"
-              << endl;
-  indent(out) << "Thrift.Transport;" << endl << endl;
+              << '\n';
+  indent(out) << "Thrift.Transport;" << '\n' << '\n';
   indent_down();
 }
 
@@ -842,7 +840,7 @@
 
   indent_up();
   indent(s_forward_decr) << type_name(tstruct, tstruct->is_xception(), true) << " = " << what << ";"
-                         << endl;
+                         << '\n';
   indent_down();
 
   add_defined_type(tstruct);
@@ -867,7 +865,7 @@
   // if( ! container)
   //  s_struct << "type ";  //the "type A = type B" syntax leads to E2574 with generics
 
-  s_struct << type_name(ttypedef->get_type()) << ";" << endl << endl;
+  s_struct << type_name(ttypedef->get_type()) << ";" << '\n' << '\n';
   indent_down();
 
   add_defined_type(ttypedef);
@@ -948,7 +946,7 @@
   indent_up();
   generate_delphi_doc(s_enum, tenum);
   indent(s_enum) << type_name(tenum, true, true) << " = "
-                 << "(" << endl;
+                 << "(" << '\n';
   indent_up();
   vector<t_enum_value*> constants = tenum->get_constants();
   if (constants.empty()) {
@@ -959,15 +957,15 @@
       int value = (*c_iter)->get_value();
       if (c_iter != constants.begin()) {
         s_enum << ",";
-        s_enum << endl;
+        s_enum << '\n';
       }
       generate_delphi_doc(s_enum, *c_iter);
       indent(s_enum) << normalize_name((*c_iter)->get_name()) << " = " << value;
     }
   }
-  s_enum << endl;
+  s_enum << '\n';
   indent_down();
-  indent(s_enum) << ");" << endl << endl;
+  indent(s_enum) << ");" << '\n' << '\n';
   indent_down();
 }
 
@@ -981,7 +979,7 @@
   result << "'";
   for (signed char const c: value) {
     if( (c >= 0) && (c < 32)) {  // convert ctrl chars, but leave UTF-8 alone
-      result << "#" << (int)c;  
+      result << "#" << (int)c;
     } else if (c == '\'') {
       result << "''";   // duplicate any single quotes we find
     } else {
@@ -989,7 +987,7 @@
     }
   }
   result << "'";
-  
+
   return result.str();
 }
 
@@ -1037,8 +1035,8 @@
   string constants_class = make_constants_classname();
 
   indent_up();
-  indent(s_const) << constants_class.c_str() << " = class" << endl;
-  indent(s_const) << "private" << endl;
+  indent(s_const) << constants_class.c_str() << " = class" << '\n';
+  indent(s_const) << "private" << '\n';
   indent_up();
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
@@ -1050,7 +1048,7 @@
     }
   }
   indent_down();
-  indent(s_const) << "public" << endl;
+  indent(s_const) << "public" << '\n';
   indent_up();
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     generate_delphi_doc(s_const, *c_iter);
@@ -1059,12 +1057,12 @@
                      (*c_iter)->get_type(),
                      (*c_iter)->get_value());
   }
-  indent(s_const) << "{$IF CompilerVersion >= 21.0}" << endl;
-  indent(s_const) << "class constructor Create;" << endl;
-  indent(s_const) << "class destructor Destroy;" << endl;
-  indent(s_const) << "{$IFEND}" << endl;
+  indent(s_const) << "{$IF CompilerVersion >= 21.0}" << '\n';
+  indent(s_const) << "class constructor Create;" << '\n';
+  indent(s_const) << "class destructor Destroy;" << '\n';
+  indent(s_const) << "{$IFEND}" << '\n';
   indent_down();
-  indent(s_const) << "end;" << endl << endl;
+  indent(s_const) << "end;" << '\n' << '\n';
   indent_down();
 
   std::ostringstream vars, code;
@@ -1079,22 +1077,22 @@
   }
   indent_down_impl();
 
-  indent_impl(s_const_impl) << "{$IF CompilerVersion >= 21.0}" << endl;
+  indent_impl(s_const_impl) << "{$IF CompilerVersion >= 21.0}" << '\n';
   indent_impl(s_const_impl) << "class constructor " << constants_class.c_str() << ".Create;"
-                            << endl;
+                            << '\n';
 
   if (!vars.str().empty()) {
-    indent_impl(s_const_impl) << "var" << endl;
+    indent_impl(s_const_impl) << "var" << '\n';
     s_const_impl << vars.str();
   }
-  indent_impl(s_const_impl) << "begin" << endl;
+  indent_impl(s_const_impl) << "begin" << '\n';
   if (!code.str().empty()) {
     s_const_impl << code.str();
   }
-  indent_impl(s_const_impl) << "end;" << endl << endl;
+  indent_impl(s_const_impl) << "end;" << '\n' << '\n';
   indent_impl(s_const_impl) << "class destructor " << constants_class.c_str() << ".Destroy;"
-                            << endl;
-  indent_impl(s_const_impl) << "begin" << endl;
+                            << '\n';
+  indent_impl(s_const_impl) << "begin" << '\n';
   indent_up_impl();
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     if (const_needs_var((*c_iter)->get_type())) {
@@ -1104,10 +1102,10 @@
                      (*c_iter)->get_value());
     }
   }
-  indent_impl(s_const_impl) << "inherited;" << endl;
+  indent_impl(s_const_impl) << "inherited;" << '\n';
   indent_down_impl();
-  indent_impl(s_const_impl) << "end;" << endl;
-  indent_impl(s_const_impl) << "{$ELSE}" << endl;
+  indent_impl(s_const_impl) << "end;" << '\n';
+  indent_impl(s_const_impl) << "{$ELSE}" << '\n';
 
   vars.str("");
   code.str("");
@@ -1124,19 +1122,19 @@
   }
   indent_down_impl();
 
-  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Initialize;" << endl;
+  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Initialize;" << '\n';
   if (!vars.str().empty()) {
-    indent_impl(s_const_impl) << "var" << endl;
+    indent_impl(s_const_impl) << "var" << '\n';
     s_const_impl << vars.str();
   }
-  indent_impl(s_const_impl) << "begin" << endl;
+  indent_impl(s_const_impl) << "begin" << '\n';
   if (!code.str().empty()) {
     s_const_impl << code.str();
   }
-  indent_impl(s_const_impl) << "end;" << endl << endl;
+  indent_impl(s_const_impl) << "end;" << '\n' << '\n';
 
-  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Finalize;" << endl;
-  indent_impl(s_const_impl) << "begin" << endl;
+  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Finalize;" << '\n';
+  indent_impl(s_const_impl) << "begin" << '\n';
   indent_up_impl();
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     finalize_field(s_const_impl,
@@ -1146,8 +1144,8 @@
                    constants_class);
   }
   indent_down_impl();
-  indent_impl(s_const_impl) << "end;" << endl;
-  indent_impl(s_const_impl) << "{$IFEND}" << endl << endl;
+  indent_impl(s_const_impl) << "end;" << '\n';
+  indent_impl(s_const_impl) << "{$IFEND}" << '\n' << '\n';
 }
 
 void t_delphi_generator::print_const_def_value(std::ostream& vars,
@@ -1183,7 +1181,7 @@
       string val = render_const_value(vars, out, name, field_type, v_iter->second);
       indent_impl(out) << cls_prefix << normalize_name(name) << "."
                        << prop_name(v_iter->first->get_string(), type->is_xception())
-                       << " := " << val << ";" << endl;
+                       << " := " << val << ";" << '\n';
     }
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
@@ -1194,7 +1192,7 @@
       string key = render_const_value(vars, out, name, ktype, v_iter->first);
       string val = render_const_value(vars, out, name, vtype, v_iter->second);
       indent_impl(out) << cls_prefix << normalize_name(name) << "[" << key << "]"
-                       << " := " << val << ";" << endl;
+                       << " := " << val << ";" << '\n';
     }
   } else if (type->is_list() || type->is_set()) {
     t_type* etype;
@@ -1208,7 +1206,7 @@
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(vars, out, name, etype, *v_iter);
-      indent_impl(out) << cls_prefix << normalize_name(name) << ".Add(" << val << ");" << endl;
+      indent_impl(out) << cls_prefix << normalize_name(name) << ".Add(" << val << ");" << '\n';
     }
   }
 }
@@ -1218,7 +1216,7 @@
                                              t_type* type,
                                              t_const_value* value) {
   (void)value;
-  indent(out) << "class var F" << name << ": " << type_name(type) << ";" << endl;
+  indent(out) << "class var F" << name << ": " << type_name(type) << ";" << '\n';
 }
 
 bool t_delphi_generator::const_needs_var(t_type* type) {
@@ -1236,11 +1234,11 @@
   (void)value;
   if (const_needs_var(type)) {
     indent(out) << "class property " << name << ": " << type_name(type) << " read F" << name << ";"
-                << endl;
+                << '\n';
   } else {
     std::ostringstream vars; // dummy
     string v2 = render_const_value(vars, out, name, type, value);
-    indent(out) << "const " << name << " = " << v2 << ";" << endl;
+    indent(out) << "const " << name << " = " << v2 << ";" << '\n';
   }
 }
 
@@ -1257,14 +1255,14 @@
   if (truetype->is_base_type()) {
     // already done
     // string v2 = render_const_value( vars, out, name, type, value);
-    // indent_impl(out) << name << " := " << v2 << ";" << endl;
+    // indent_impl(out) << name << " := " << v2 << ";" << '\n';
   } else if (truetype->is_enum()) {
     indent_impl(out) << name << " := " << type_name(type) << "." << value->get_identifier_name()
-                     << ";" << endl;
+                     << ";" << '\n';
   } else {
     string typname;
     typname = type_name(truetype, true, false, type->is_xception(), type->is_xception());
-    indent_impl(out) << name << " := " << typname << ".Create;" << endl;
+    indent_impl(out) << name << " := " << typname << ".Create;" << '\n';
     print_const_def_value(vars, out, name, truetype, value);
   }
 }
@@ -1341,7 +1339,7 @@
     render << type_name(type, false) << "." << value->get_identifier_name();
   } else {
     string t = tmp("tmp");
-    vars << "  " << t << " : " << type_name(type) << ";" << endl;
+    vars << "  " << t << " : " << type_name(type) << ";" << '\n';
     print_const_value(vars, out, t, type, value);
     render << t;
   }
@@ -1418,26 +1416,26 @@
                        (*m_iter)->get_value());
       if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
         indent_impl(code) << prop_name((*m_iter), is_exception, "F__isset_") << " := True;"
-                          << endl;
+                          << '\n';
       }
     }
   }
   indent_down_impl();
 
   indent_impl(out) << "constructor " << cls_prefix << cls_nm << "."
-                   << "Create;" << endl;
+                   << "Create;" << '\n';
 
   if (!vars.str().empty()) {
-    out << "var" << endl;
+    out << "var" << '\n';
     out << vars.str();
   }
 
-  indent_impl(out) << "begin" << endl;
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
   if (is_exception && (!is_x_factory)) {
-    indent_impl(out) << "inherited Create('');" << endl;
+    indent_impl(out) << "inherited Create('');" << '\n';
   } else {
-    indent_impl(out) << "inherited;" << endl;
+    indent_impl(out) << "inherited;" << '\n';
   }
 
   if (!code.str().empty()) {
@@ -1445,28 +1443,28 @@
   }
 
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 
   if ((members.size() > 0) && is_exception && (!is_x_factory)) {
     indent_impl(out) << "constructor " << cls_prefix << cls_nm << "."
                      << "Create(" << constructor_argument_list(tstruct, indent_impl()) << ");"
-                     << endl;
-    indent_impl(out) << "begin" << endl;
+                     << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
-    indent_impl(out) << "Create;" << endl;
+    indent_impl(out) << "Create;" << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       string propname = prop_name((*m_iter)->get_name(), is_exception);
       string param_name = constructor_param_name((*m_iter)->get_name());
-      indent_impl(out) << propname << " := " << param_name << ";" << endl;
+      indent_impl(out) << propname << " := " << param_name << ";" << '\n';
     }
-    indent_impl(out) << "UpdateMessageProperty;" << endl;
+    indent_impl(out) << "UpdateMessageProperty;" << '\n';
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
   }
 
   indent_impl(out) << "destructor " << cls_prefix << cls_nm << "."
-                   << "Destroy;" << endl;
-  indent_impl(out) << "begin" << endl;
+                   << "Destroy;" << '\n';
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1477,46 +1475,46 @@
     finalize_field(out, prop_name(*m_iter, is_exception), t, (*m_iter)->get_value());
   }
 
-  indent_impl(out) << "inherited;" << endl;
+  indent_impl(out) << "inherited;" << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 
   if (is_exception && (!is_x_factory)) {
     indent_impl(out) << "function " << cls_prefix << cls_nm << "." << exception_factory_name
-                     << ": I" << exception_factory_name << ";" << endl;
-    indent_impl(out) << "begin" << endl;
+                     << ": I" << exception_factory_name << ";" << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
-    indent_impl(out) << "if F" << exception_factory_name << " = nil" << endl;
-    indent_impl(out) << "then F" << exception_factory_name << " := T" << exception_factory_name << "Impl.Create;" << endl << endl;
-    indent_impl(out) << "result := F" << exception_factory_name << ";" << endl;
+    indent_impl(out) << "if F" << exception_factory_name << " = nil" << '\n';
+    indent_impl(out) << "then F" << exception_factory_name << " := T" << exception_factory_name << "Impl.Create;" << '\n' << '\n';
+    indent_impl(out) << "result := F" << exception_factory_name << ";" << '\n';
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
-    indent_impl(out) << "function " << cls_prefix << cls_nm << ".QueryInterface(const IID: TGUID; out Obj): HRESULT;" << endl;
-    indent_impl(out) << "begin" << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
+    indent_impl(out) << "function " << cls_prefix << cls_nm << ".QueryInterface(const IID: TGUID; out Obj): HRESULT;" << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
-    indent_impl(out) << "if GetInterface(IID, Obj)" << endl;
-    indent_impl(out) << "then result := S_OK" << endl;
-    indent_impl(out) << "else result := E_NOINTERFACE;" << endl;
+    indent_impl(out) << "if GetInterface(IID, Obj)" << '\n';
+    indent_impl(out) << "then result := S_OK" << '\n';
+    indent_impl(out) << "else result := E_NOINTERFACE;" << '\n';
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
-    indent_impl(out) << "function " << cls_prefix << cls_nm << "._AddRef: Integer;" << endl;
-    indent_impl(out) << "begin" << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
+    indent_impl(out) << "function " << cls_prefix << cls_nm << "._AddRef: Integer;" << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
-    indent_impl(out) << "result := -1;    // not refcounted" << endl;
+    indent_impl(out) << "result := -1;    // not refcounted" << '\n';
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
-    indent_impl(out) << "function " << cls_prefix << cls_nm << "._Release: Integer;" << endl;
-    indent_impl(out) << "begin" << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
+    indent_impl(out) << "function " << cls_prefix << cls_nm << "._Release: Integer;" << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
-    indent_impl(out) << "result := -1;    // not refcounted" << endl;
+    indent_impl(out) << "result := -1;    // not refcounted" << '\n';
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
   }
 
   if (tstruct->is_union()) {
     indent_impl(out) << "procedure " << cls_prefix << cls_nm << "."
-                     << "ClearUnionValues;" << endl;
-    indent_impl(out) << "begin" << endl;
+                     << "ClearUnionValues;" << '\n';
+    indent_impl(out) << "begin" << '\n';
     indent_up_impl();
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       t_type* t = (*m_iter)->get_type();
@@ -1536,7 +1534,7 @@
                                         exception_factory_name);
     }
     indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
+    indent_impl(out) << "end;" << '\n' << '\n';
   }
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1601,12 +1599,12 @@
   print_delphi_struct_type_factory_func(out, tstruct);
   out << ": ";
   out << struct_intf_name;
-  out << ";" << endl;
-  out << "begin" << endl;
+  out << ";" << '\n';
+  out << "begin" << '\n';
   indent_up();
-  indent(out) << "Result := " << cls_nm << ".Create;" << endl;
+  indent(out) << "Result := " << cls_nm << ".Create;" << '\n';
   indent_down();
-  out << "end;" << endl << endl;
+  out << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_delphi_struct_type_factory_registration(ostream& out,
@@ -1628,7 +1626,7 @@
   indent(out) << "  TypeRegistry.RegisterTypeFactory<" << struct_intf_name << ">(";
   print_delphi_struct_type_factory_func(out, tstruct);
   out << ");";
-  out << endl;
+  out << '\n';
 }
 
 void t_delphi_generator::generate_delphi_struct_definition(ostream& out,
@@ -1662,11 +1660,11 @@
 
     generate_delphi_doc(out, tstruct);
     if(rtti_) {
-      indent(out) << "{$TYPEINFO ON}" << endl;
-      indent(out) << "{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished])}" << endl;
-      indent(out) << struct_intf_name << " = interface(IBaseWithTypeInfo)" << endl;
+      indent(out) << "{$TYPEINFO ON}" << '\n';
+      indent(out) << "{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished])}" << '\n';
+      indent(out) << struct_intf_name << " = interface(IBaseWithTypeInfo)" << '\n';
     } else {
-      indent(out) << struct_intf_name << " = interface(IBase)" << endl;
+      indent(out) << struct_intf_name << " = interface(IBase)" << '\n';
     }
     indent_up();
 
@@ -1678,20 +1676,20 @@
     }
 
     if (is_x_factory) {
-      out << endl;
-      indent(out) << "// Create Exception Object" << endl;
-      indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << endl;
+      out << '\n';
+      indent(out) << "// Create Exception Object" << '\n';
+      indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << '\n';
     }
 
     if (members.size() > 0) {
-      out << endl;
+      out << '\n';
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         generate_property(out, *m_iter, true, is_exception);
       }
     }
 
     if (members.size() > 0) {
-      out << endl;
+      out << '\n';
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
           generate_delphi_isset_reader_writer_definition(out, *m_iter, is_exception);
@@ -1700,22 +1698,22 @@
     }
 
     if (members.size() > 0) {
-      out << endl;
+      out << '\n';
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
           isset_name = prop_name(*m_iter, is_exception, "__isset_");
           indent(out) << "property " << isset_name << ": System.Boolean read Get" << isset_name << " write Set" << isset_name << ";"
-                      << endl;
+                      << '\n';
         }
       }
     }
 
     indent_down();
-    indent(out) << "end;" << endl;
+    indent(out) << "end;" << '\n';
     if(rtti_) {
-      indent(out) << "{$IFNDEF TYPEINFO_WAS_ON} {$TYPEINFO OFF} {$ENDIF}" << endl;
+      indent(out) << "{$IFNDEF TYPEINFO_WAS_ON} {$TYPEINFO OFF} {$ENDIF}" << '\n';
     }
-    indent(out) << endl;
+    indent(out) << '\n';
   }
 
   generate_delphi_doc(out, tstruct);
@@ -1729,40 +1727,40 @@
   } else {
     out << "TInterfacedObject, IBase, ISupportsToString, " << struct_intf_name;
   }
-  out << ")" << endl;
+  out << ")" << '\n';
 
   if (is_exception && (!is_x_factory)) {
-    indent(out) << "public" << endl;
+    indent(out) << "public" << '\n';
     indent_up();
-    indent(out) << "type" << endl;
+    indent(out) << "type" << '\n';
     indent_up();
     generate_delphi_struct_definition(out, tstruct, is_exception, in_class, is_result, true);
     indent_down();
     indent_down();
   }
 
-  indent(out) << "private" << endl;
+  indent(out) << "private" << '\n';
   indent_up();
 
   if (is_exception && (!is_x_factory)) {
-    indent(out) << "F" << exception_factory_name << " :" << struct_intf_name << ";" << endl << endl;
+    indent(out) << "F" << exception_factory_name << " :" << struct_intf_name << ";" << '\n' << '\n';
   }
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << declare_field(*m_iter, false, "F", is_exception) << endl;
+    indent(out) << declare_field(*m_iter, false, "F", is_exception) << '\n';
   }
 
   if (members.size() > 0) {
-    indent(out) << endl;
+    indent(out) << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
         isset_name = prop_name(*m_iter, is_exception, "F__isset_");
-        indent(out) << isset_name << ": System.Boolean;" << endl;
+        indent(out) << isset_name << ": System.Boolean;" << '\n';
       }
     }
   }
 
-  indent(out) << endl;
+  indent(out) << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     generate_delphi_property_reader_definition(out, *m_iter, is_exception);
@@ -1770,106 +1768,106 @@
   }
 
   if (tstruct->is_union()) {
-    out << endl;
-    indent(out) << "// Clear values(for union's property setter)" << endl;
-    indent(out) << "procedure ClearUnionValues;" << endl;
+    out << '\n';
+    indent(out) << "// Clear values(for union's property setter)" << '\n';
+    indent(out) << "procedure ClearUnionValues;" << '\n';
   }
 
   if (members.size() > 0) {
-    out << endl;
+    out << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
         isset_name = prop_name(*m_iter, is_exception, "__isset_");
-        indent(out) << "function Get" << isset_name << ": System.Boolean;" << endl;
-        indent(out) << "procedure Set" << isset_name << "( const value : System.Boolean);" << endl;
+        indent(out) << "function Get" << isset_name << ": System.Boolean;" << '\n';
+        indent(out) << "procedure Set" << isset_name << "( const value : System.Boolean);" << '\n';
       }
     }
   }
 
   if (is_exception && (!is_x_factory)) {
-    out << endl;
+    out << '\n';
     indent_down();
-    indent(out) << "strict protected" << endl;
-    indent_up();  
-    indent(out) << "function QueryInterface(const IID: TGUID; out Obj): HRESULT; stdcall;" << endl;
-    indent(out) << "function _AddRef: Integer; stdcall;" << endl;
-    indent(out) << "function _Release: Integer; stdcall;" << endl;
-    out << endl;
+    indent(out) << "strict protected" << '\n';
+    indent_up();
+    indent(out) << "function QueryInterface(const IID: TGUID; out Obj): HRESULT; stdcall;" << '\n';
+    indent(out) << "function _AddRef: Integer; stdcall;" << '\n';
+    indent(out) << "function _Release: Integer; stdcall;" << '\n';
+    out << '\n';
   }
 
   indent_down();
-  indent(out) << "public" << endl;
+  indent(out) << "public" << '\n';
   indent_up();
 
   if ((members.size() > 0) && is_exception && (!is_x_factory)) {
-    indent(out) << "constructor Create; overload;" << endl;
+    indent(out) << "constructor Create; overload;" << '\n';
     indent(out) << "constructor Create(" << constructor_argument_list(tstruct, indent())
-                << "); overload;" << endl;
+                << "); overload;" << '\n';
   } else {
-    indent(out) << "constructor Create;" << endl;
+    indent(out) << "constructor Create;" << '\n';
   }
 
-  indent(out) << "destructor Destroy; override;" << endl;
+  indent(out) << "destructor Destroy; override;" << '\n';
 
-  out << endl;
-  indent(out) << "function ToString: string; override;" << endl;
+  out << '\n';
+  indent(out) << "function ToString: string; override;" << '\n';
 
   if (is_exception && (!is_x_factory)) {
-    out << endl;
-    indent(out) << "// Exception Factory" << endl;
-    indent(out) << "function " << exception_factory_name << ": " << struct_intf_name << ";" << endl;
+    out << '\n';
+    indent(out) << "// Exception Factory" << '\n';
+    indent(out) << "function " << exception_factory_name << ": " << struct_intf_name << ";" << '\n';
   }
 
-  out << endl;
-  indent(out) << "// IBase" << endl;
-  indent(out) << "procedure Read( const iprot: IProtocol);" << endl;
-  indent(out) << "procedure Write( const oprot: IProtocol);" << endl;
+  out << '\n';
+  indent(out) << "// IBase" << '\n';
+  indent(out) << "procedure Read( const iprot: IProtocol);" << '\n';
+  indent(out) << "procedure Write( const oprot: IProtocol);" << '\n';
 
   if (is_exception && is_x_factory) {
-    out << endl;
-    indent(out) << "// Create Exception Object" << endl;
-    indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << endl;
+    out << '\n';
+    indent(out) << "// Create Exception Object" << '\n';
+    indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << '\n';
   }
 
   if (members.size() > 0) {
-    out << endl;
-    indent(out) << "// Properties" << endl;
+    out << '\n';
+    indent(out) << "// Properties" << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       generate_property(out, *m_iter, true, is_exception);
     }
   }
 
   if (members.size() > 0) {
-    out << endl;
-    indent(out) << "// isset" << endl;
+    out << '\n';
+    indent(out) << "// isset" << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
         isset_name = prop_name(*m_iter, is_exception, "__isset_");
         indent(out) << "property " << isset_name << ": System.Boolean read Get" << isset_name << " write Set" << isset_name << ";"
-                    << endl;
+                    << '\n';
       }
     }
   }
 
   indent_down();
-  indent(out) << "end;" << endl << endl;
+  indent(out) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_service(t_service* tservice) {
   indent_up();
   generate_delphi_doc(s_service, tservice);
-  indent(s_service) << normalize_clsnm(service_name_, "T") << " = class" << endl;
-  indent(s_service) << "public" << endl;
+  indent(s_service) << normalize_clsnm(service_name_, "T") << " = class" << '\n';
+  indent(s_service) << "public" << '\n';
   indent_up();
-  indent(s_service) << "type" << endl;
+  indent(s_service) << "type" << '\n';
   generate_service_interface(tservice);
   generate_service_client(tservice);
   generate_service_server(tservice);
   generate_service_helpers(tservice);
   indent_down();
   indent_down();
-  indent(s_service) << "end;" << endl;
-  indent(s_service) << endl;
+  indent(s_service) << "end;" << '\n';
+  indent(s_service) << '\n';
   indent_down();
 }
 
@@ -1893,9 +1891,9 @@
     extends = type_name(tservice->get_extends(), true, true);
     extends_iface = extends + "." + iface_name;
     generate_delphi_doc(s_service, tservice);
-    indent(s_service) << iface_name << " = interface(" << extends_iface << ")" << endl;
+    indent(s_service) << iface_name << " = interface(" << extends_iface << ")" << '\n';
   } else {
-    indent(s_service) << iface_name << " = interface" << endl;
+    indent(s_service) << iface_name << " = interface" << '\n';
   }
 
   indent_up();
@@ -1904,10 +1902,10 @@
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_delphi_doc(s_service, *f_iter);
-    indent(s_service) << function_signature(*f_iter, for_async) << endl;
+    indent(s_service) << function_signature(*f_iter, for_async) << '\n';
   }
   indent_down();
-  indent(s_service) << "end;" << endl << endl;
+  indent(s_service) << "end;" << '\n' << '\n';
 
   indent_down();
 }
@@ -1921,7 +1919,7 @@
       std::wstring guid_wstr(guid_chars);
       std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> convert;
       std::string guid_str = convert.to_bytes(guid_wstr);
-      indent(out) << "['" << guid_str << "']" << endl;
+      indent(out) << "['" << guid_str << "']" << '\n';
     }
   }
 #else
@@ -1955,78 +1953,78 @@
     extends = type_name(tservice->get_extends(), true, true);
     extends_client = extends + ".TClient";
   }
-  indent(s_service) << "TClient = class( " << extends_client << ", " << implements << ")" << endl;
+  indent(s_service) << "TClient = class( " << extends_client << ", " << implements << ")" << '\n';
 
-  indent(s_service) << "public" << endl;
+  indent(s_service) << "public" << '\n';
   indent_up();
 
-  indent(s_service) << "constructor Create( prot: IProtocol); overload;" << endl;
+  indent(s_service) << "constructor Create( prot: IProtocol); overload;" << '\n';
 
   indent_impl(s_service_impl) << "constructor " << normalize_clsnm(service_name_, "T")
-                              << ".TClient.Create( prot: IProtocol);" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
+                              << ".TClient.Create( prot: IProtocol);" << '\n';
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "Create( prot, prot );" << endl;
+  indent_impl(s_service_impl) << "Create( prot, prot );" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
   indent(s_service)
-      << "constructor Create( const iprot: IProtocol; const oprot: IProtocol); overload;" << endl;
+      << "constructor Create( const iprot: IProtocol; const oprot: IProtocol); overload;" << '\n';
 
   indent_impl(s_service_impl) << "constructor " << normalize_clsnm(service_name_, "T")
                               << ".TClient.Create( const iprot: IProtocol; const oprot: IProtocol);"
-                              << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
+                              << '\n';
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "inherited Create;" << endl;
-  indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;
-  indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;
+  indent_impl(s_service_impl) << "inherited Create;" << '\n';
+  indent_impl(s_service_impl) << "iprot_ := iprot;" << '\n';
+  indent_impl(s_service_impl) << "oprot_ := oprot;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
   indent_down();
 
   if (extends.empty()) {
-    indent(s_service) << "protected" << endl;
+    indent(s_service) << "protected" << '\n';
     indent_up();
-    indent(s_service) << "iprot_: IProtocol;" << endl;
-    indent(s_service) << "oprot_: IProtocol;" << endl;
-    indent(s_service) << "seqid_: System.Integer;" << endl;
+    indent(s_service) << "iprot_: IProtocol;" << '\n';
+    indent(s_service) << "oprot_: IProtocol;" << '\n';
+    indent(s_service) << "seqid_: System.Integer;" << '\n';
     indent_down();
 
-    indent(s_service) << "public" << endl;
+    indent(s_service) << "public" << '\n';
     indent_up();
-    indent(s_service) << "property InputProtocol: IProtocol read iprot_;" << endl;
-    indent(s_service) << "property OutputProtocol: IProtocol read oprot_;" << endl;
+    indent(s_service) << "property InputProtocol: IProtocol read iprot_;" << '\n';
+    indent(s_service) << "property OutputProtocol: IProtocol read oprot_;" << '\n';
     indent_down();
   }
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::const_iterator f_iter;
 
-  indent(s_service) << "protected" << endl;
+  indent(s_service) << "protected" << '\n';
   indent_up();
 
-  indent(s_service) << "// Iface" << endl;
+  indent(s_service) << "// Iface" << '\n';
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     string funname = (*f_iter)->get_name();
     generate_delphi_doc(s_service, *f_iter);
-    indent(s_service) << function_signature(*f_iter, false) << endl;
+    indent(s_service) << function_signature(*f_iter, false) << '\n';
   }
 
   if( async_) {
-    indent(s_service) << endl;
-    indent(s_service) << "// IAsync" << endl;
+    indent(s_service) << '\n';
+    indent(s_service) << "// IAsync" << '\n';
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       string funname = (*f_iter)->get_name();
       generate_delphi_doc(s_service, *f_iter);
-      indent(s_service) << function_signature(*f_iter, true) << endl;
+      indent(s_service) << function_signature(*f_iter, true) << '\n';
     }
   }
 
   indent_down();
 
-  indent(s_service) << "public" << endl;
+  indent(s_service) << "public" << '\n';
   indent_up();
 
   string full_cls = normalize_clsnm(service_name_, "T") + ".TClient";
@@ -2044,20 +2042,20 @@
       bool for_async = (mode != 0);
       mode--;
 
-      indent_impl(s_service_impl) << function_signature(*f_iter, for_async, full_cls) << endl;
-      indent_impl(s_service_impl) << "begin" << endl;
+      indent_impl(s_service_impl) << function_signature(*f_iter, for_async, full_cls) << '\n';
+      indent_impl(s_service_impl) << "begin" << '\n';
       indent_up_impl();
 
       t_type* ttype = (*f_iter)->get_returntype();
       if( for_async) {
         if (is_void(ttype)) {
            // Delphi forces us to specify a type with IFuture<T>, so we use Integer=0 for void methods
-          indent_impl(s_service_impl) << "result := TTask.Future<System.Integer>(function: System.Integer" << endl;
+          indent_impl(s_service_impl) << "result := TTask.Future<System.Integer>(function: System.Integer" << '\n';
         } else {
           string rettype = type_name(ttype, false, true, false, true);
-          indent_impl(s_service_impl) << "result := TTask.Future<" << rettype << ">(function: " << rettype << endl;
+          indent_impl(s_service_impl) << "result := TTask.Future<" << rettype << ">(function: " << rettype << '\n';
         }
-        indent_impl(s_service_impl) << "begin" << endl;
+        indent_impl(s_service_impl) << "begin" << '\n';
         indent_up_impl();
       }
 
@@ -2072,26 +2070,26 @@
         }
         s_service_impl << normalize_name((*fld_iter)->get_name());
       }
-      s_service_impl << ");" << endl;
+      s_service_impl << ");" << '\n';
 
       if (!(*f_iter)->is_oneway()) {
         s_service_impl << indent_impl();
         if (!(*f_iter)->get_returntype()->is_void()) {
           s_service_impl << "Result := ";
         }
-        s_service_impl << "recv_" << funname << "();" << endl;
+        s_service_impl << "recv_" << funname << "();" << '\n';
       }
 
       if( for_async) {
         if (is_void(ttype)) {
-          indent_impl(s_service_impl) << "Result := 0;" << endl;  // no IFuture<void> in Delphi
+          indent_impl(s_service_impl) << "Result := 0;" << '\n';  // no IFuture<void> in Delphi
         }
         indent_down_impl();
-        indent_impl(s_service_impl) << "end);" << endl;
+        indent_impl(s_service_impl) << "end);" << '\n';
       }
 
       indent_down_impl();
-      indent_impl(s_service_impl) << "end;" << endl << endl;
+      indent_impl(s_service_impl) << "end;" << '\n' << '\n';
     }
 
     t_function send_function(g_type_void,
@@ -2105,41 +2103,41 @@
     string argsvar = tmp("_args");
     string msgvar = tmp("_msg");
 
-    indent(s_service) << function_signature(&send_function, false) << endl;
-    indent_impl(s_service_impl) << function_signature(&send_function, false, full_cls) << endl;
-    indent_impl(s_service_impl) << "var" << endl;
+    indent(s_service) << function_signature(&send_function, false) << '\n';
+    indent_impl(s_service_impl) << function_signature(&send_function, false, full_cls) << '\n';
+    indent_impl(s_service_impl) << "var" << '\n';
     indent_up_impl();
-    indent_impl(s_service_impl) << argsvar << " : " << args_intfnm << ";" << endl;
-    indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << endl;
+    indent_impl(s_service_impl) << argsvar << " : " << args_intfnm << ";" << '\n';
+    indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "begin" << endl;
+    indent_impl(s_service_impl) << "begin" << '\n';
     indent_up_impl();
 
-    indent_impl(s_service_impl) << "seqid_ := seqid_ + 1;" << endl;
+    indent_impl(s_service_impl) << "seqid_ := seqid_ + 1;" << '\n';
     indent_impl(s_service_impl) << "Thrift.Protocol.Init( " << msgvar << ", '" << funname
                                 << "', " << ((*f_iter)->is_oneway() ? "TMessageType.Oneway"
                                                                     : "TMessageType.Call")
-                                << ", seqid_);" << endl;
+                                << ", seqid_);" << '\n';
 
-    indent_impl(s_service_impl) << "oprot_.WriteMessageBegin( " << msgvar << " );" << endl;
-    indent_impl(s_service_impl) << argsvar << " := " << args_clsnm << "Impl.Create();" << endl;
+    indent_impl(s_service_impl) << "oprot_.WriteMessageBegin( " << msgvar << " );" << '\n';
+    indent_impl(s_service_impl) << argsvar << " := " << args_clsnm << "Impl.Create();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent_impl(s_service_impl) << argsvar << "." << prop_name(*fld_iter)
                                   << " := " << normalize_name((*fld_iter)->get_name()) << ";"
-                                  << endl;
+                                  << '\n';
     }
-    indent_impl(s_service_impl) << argsvar << ".Write(oprot_);" << endl;
+    indent_impl(s_service_impl) << argsvar << ".Write(oprot_);" << '\n';
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent_impl(s_service_impl) << argsvar << "." << prop_name(*fld_iter)
-                                  << " := " << empty_value((*fld_iter)->get_type()) << ";" << endl;
+                                  << " := " << empty_value((*fld_iter)->get_type()) << ";" << '\n';
     }
 
-    indent_impl(s_service_impl) << "oprot_.WriteMessageEnd();" << endl;
-    indent_impl(s_service_impl) << "oprot_.Transport.Flush();" << endl;
+    indent_impl(s_service_impl) << "oprot_.WriteMessageEnd();" << '\n';
+    indent_impl(s_service_impl) << "oprot_.Transport.Flush();" << '\n';
 
     indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl << endl;
+    indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       string org_resultname = (*f_iter)->get_name() + "_result";
@@ -2159,72 +2157,72 @@
       string appexvar = tmp("_ax");
       string retvar = tmp("_ret");
 
-      indent(s_service) << function_signature(&recv_function, false) << endl;
-      indent_impl(s_service_impl) << function_signature(&recv_function, false, full_cls) << endl;
-      indent_impl(s_service_impl) << "var" << endl;
+      indent(s_service) << function_signature(&recv_function, false) << '\n';
+      indent_impl(s_service_impl) << function_signature(&recv_function, false, full_cls) << '\n';
+      indent_impl(s_service_impl) << "var" << '\n';
       indent_up_impl();
-      indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << endl;
+      indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << '\n';
       if (xceptions.size() > 0) {
-        indent_impl(s_service_impl) << exceptvar << " : Exception;" << endl;
+        indent_impl(s_service_impl) << exceptvar << " : Exception;" << '\n';
       }
-      indent_impl(s_service_impl) << appexvar << " : TApplicationException;" << endl;
-      indent_impl(s_service_impl) << retvar << " : " << result_intfnm << ";" << endl;
+      indent_impl(s_service_impl) << appexvar << " : TApplicationException;" << '\n';
+      indent_impl(s_service_impl) << retvar << " : " << result_intfnm << ";" << '\n';
 
       indent_down_impl();
-      indent_impl(s_service_impl) << "begin" << endl;
+      indent_impl(s_service_impl) << "begin" << '\n';
       indent_up_impl();
-      indent_impl(s_service_impl) << msgvar << " := iprot_.ReadMessageBegin();" << endl;
-      indent_impl(s_service_impl) << "if (" << msgvar << ".Type_ = TMessageType.Exception) then begin" << endl;
+      indent_impl(s_service_impl) << msgvar << " := iprot_.ReadMessageBegin();" << '\n';
+      indent_impl(s_service_impl) << "if (" << msgvar << ".Type_ = TMessageType.Exception) then begin" << '\n';
       indent_up_impl();
-      indent_impl(s_service_impl) << appexvar << " := TApplicationException.Read(iprot_);" << endl;
-      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << endl;
-      indent_impl(s_service_impl) << "raise " << appexvar << ";" << endl;
+      indent_impl(s_service_impl) << appexvar << " := TApplicationException.Read(iprot_);" << '\n';
+      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << '\n';
+      indent_impl(s_service_impl) << "raise " << appexvar << ";" << '\n';
       indent_down_impl();
-      indent_impl(s_service_impl) << "end;" << endl;
+      indent_impl(s_service_impl) << "end;" << '\n';
 
-      indent_impl(s_service_impl) << retvar << " := " << result_clsnm << "Impl.Create();" << endl;
-      indent_impl(s_service_impl) << retvar << ".Read(iprot_);" << endl;
-      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << endl;
+      indent_impl(s_service_impl) << retvar << " := " << result_clsnm << "Impl.Create();" << '\n';
+      indent_impl(s_service_impl) << retvar << ".Read(iprot_);" << '\n';
+      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << '\n';
 
       if (!(*f_iter)->get_returntype()->is_void()) {
-        indent_impl(s_service_impl) << "if (" << retvar << ".__isset_success) then begin" << endl;
+        indent_impl(s_service_impl) << "if (" << retvar << ".__isset_success) then begin" << '\n';
         indent_up_impl();
-        indent_impl(s_service_impl) << "Result := " << retvar << ".Success;" << endl;
+        indent_impl(s_service_impl) << "Result := " << retvar << ".Success;" << '\n';
         t_type* type = (*f_iter)->get_returntype();
         if (type->is_struct() || type->is_xception() || type->is_map() || type->is_list()
             || type->is_set()) {
-          indent_impl(s_service_impl) << retvar << ".Success := nil;" << endl;
+          indent_impl(s_service_impl) << retvar << ".Success := nil;" << '\n';
         }
-        indent_impl(s_service_impl) << "Exit;" << endl;
+        indent_impl(s_service_impl) << "Exit;" << '\n';
         indent_down_impl();
-        indent_impl(s_service_impl) << "end;" << endl;
+        indent_impl(s_service_impl) << "end;" << '\n';
       }
 
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         indent_impl(s_service_impl) << "if (" << retvar << "." << prop_name(*x_iter, false, "__isset_")
-                                    << ") then begin" << endl;
+                                    << ") then begin" << '\n';
         indent_up_impl();
         indent_impl(s_service_impl) << exceptvar << " := " << retvar << "." << prop_name(*x_iter)
-                                    << ".CreateException;" << endl;
-        indent_impl(s_service_impl) << "raise " << exceptvar << ";" << endl;
+                                    << ".CreateException;" << '\n';
+        indent_impl(s_service_impl) << "raise " << exceptvar << ";" << '\n';
         indent_down_impl();
-        indent_impl(s_service_impl) << "end;" << endl;
+        indent_impl(s_service_impl) << "end;" << '\n';
       }
 
       if (!(*f_iter)->get_returntype()->is_void()) {
         indent_impl(s_service_impl)
             << "raise TApplicationExceptionMissingResult.Create('"
-            << (*f_iter)->get_name() << " failed: unknown result');" << endl;
+            << (*f_iter)->get_name() << " failed: unknown result');" << '\n';
       }
 
       indent_down_impl();
-      indent_impl(s_service_impl) << "end;" << endl << endl;
+      indent_impl(s_service_impl) << "end;" << '\n' << '\n';
     }
   }
 
   indent_down();
-  indent(s_service) << "end;" << endl << endl;
+  indent(s_service) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_service_server(t_service* tservice) {
@@ -2239,164 +2237,164 @@
   if (tservice->get_extends() != nullptr) {
     extends = type_name(tservice->get_extends(), true, true);
     extends_processor = extends + ".TProcessorImpl";
-    indent(s_service) << "TProcessorImpl = class(" << extends_processor << ", IProcessor)" << endl;
+    indent(s_service) << "TProcessorImpl = class(" << extends_processor << ", IProcessor)" << '\n';
   } else {
-    indent(s_service) << "TProcessorImpl = class( TInterfacedObject, IProcessor)" << endl;
+    indent(s_service) << "TProcessorImpl = class( TInterfacedObject, IProcessor)" << '\n';
   }
 
-  indent(s_service) << "public" << endl;
+  indent(s_service) << "public" << '\n';
   indent_up();
-  indent(s_service) << "constructor Create( iface_: Iface );" << endl;
-  indent(s_service) << "destructor Destroy; override;" << endl;
+  indent(s_service) << "constructor Create( iface_: Iface );" << '\n';
+  indent(s_service) << "destructor Destroy; override;" << '\n';
   indent_down();
 
-  indent_impl(s_service_impl) << "constructor " << full_cls << ".Create( iface_: Iface );" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
+  indent_impl(s_service_impl) << "constructor " << full_cls << ".Create( iface_: Iface );" << '\n';
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
   if (tservice->get_extends() != nullptr) {
-    indent_impl(s_service_impl) << "inherited Create( iface_);" << endl;
+    indent_impl(s_service_impl) << "inherited Create( iface_);" << '\n';
   } else {
-    indent_impl(s_service_impl) << "inherited Create;" << endl;
+    indent_impl(s_service_impl) << "inherited Create;" << '\n';
   }
-  indent_impl(s_service_impl) << "Self.iface_ := iface_;" << endl;
+  indent_impl(s_service_impl) << "Self.iface_ := iface_;" << '\n';
   if (tservice->get_extends() != nullptr) {
-    indent_impl(s_service_impl) << "ASSERT( processMap_ <> nil);  // inherited" << endl;
+    indent_impl(s_service_impl) << "ASSERT( processMap_ <> nil);  // inherited" << '\n';
   } else {
     indent_impl(s_service_impl)
-        << "processMap_ := TThriftDictionaryImpl<string, TProcessFunction>.Create;" << endl;
+        << "processMap_ := TThriftDictionaryImpl<string, TProcessFunction>.Create;" << '\n';
   }
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent_impl(s_service_impl) << "processMap_.AddOrSetValue( '" << (*f_iter)->get_name() << "', "
-                                << (*f_iter)->get_name() << "_Process);" << endl;
+                                << (*f_iter)->get_name() << "_Process);" << '\n';
   }
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
-  indent_impl(s_service_impl) << "destructor " << full_cls << ".Destroy;" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
+  indent_impl(s_service_impl) << "destructor " << full_cls << ".Destroy;" << '\n';
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "inherited;" << endl;
+  indent_impl(s_service_impl) << "inherited;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
-  indent(s_service) << "private" << endl;
+  indent(s_service) << "private" << '\n';
   indent_up();
-  indent(s_service) << "iface_: Iface;" << endl;
+  indent(s_service) << "iface_: Iface;" << '\n';
   indent_down();
 
   if (tservice->get_extends() == nullptr) {
-    indent(s_service) << "protected" << endl;
+    indent(s_service) << "protected" << '\n';
     indent_up();
-    indent(s_service) << "type" << endl;
+    indent(s_service) << "type" << '\n';
     indent_up();
     indent(s_service) << "TProcessFunction = reference to procedure( seqid: System.Integer; const iprot: "
                          "IProtocol; const oprot: IProtocol"
-                      << (events_ ? "; const events : IRequestEvents" : "") << ");" << endl;
+                      << (events_ ? "; const events : IRequestEvents" : "") << ");" << '\n';
     indent_down();
     indent_down();
-    indent(s_service) << "protected" << endl;
+    indent(s_service) << "protected" << '\n';
     indent_up();
-    indent(s_service) << "processMap_: IThriftDictionary<string, TProcessFunction>;" << endl;
+    indent(s_service) << "processMap_: IThriftDictionary<string, TProcessFunction>;" << '\n';
     indent_down();
   }
 
-  indent(s_service) << "public" << endl;
+  indent(s_service) << "public" << '\n';
   indent_up();
   if (extends.empty()) {
     indent(s_service) << "function Process( const iprot: IProtocol; const oprot: IProtocol; const "
-                         "events : IProcessorEvents): System.Boolean;" << endl;
+                         "events : IProcessorEvents): System.Boolean;" << '\n';
   } else {
     indent(s_service) << "function Process( const iprot: IProtocol; const oprot: IProtocol; const "
-                         "events : IProcessorEvents): System.Boolean; reintroduce;" << endl;
+                         "events : IProcessorEvents): System.Boolean; reintroduce;" << '\n';
   }
 
   indent_impl(s_service_impl) << "function " << full_cls << ".Process( const iprot: IProtocol; "
                                                             "const oprot: IProtocol; const events "
-                                                            ": IProcessorEvents): System.Boolean;" << endl;
+                                                            ": IProcessorEvents): System.Boolean;" << '\n';
   ;
-  indent_impl(s_service_impl) << "var" << endl;
+  indent_impl(s_service_impl) << "var" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "msg : Thrift.Protocol.TThriftMessage;" << endl;
-  indent_impl(s_service_impl) << "fn : TProcessFunction;" << endl;
-  indent_impl(s_service_impl) << "x : TApplicationException;" << endl;
+  indent_impl(s_service_impl) << "msg : Thrift.Protocol.TThriftMessage;" << '\n';
+  indent_impl(s_service_impl) << "fn : TProcessFunction;" << '\n';
+  indent_impl(s_service_impl) << "x : TApplicationException;" << '\n';
   if (events_) {
-    indent_impl(s_service_impl) << "context : IRequestEvents;" << endl;
+    indent_impl(s_service_impl) << "context : IRequestEvents;" << '\n';
   }
   indent_down_impl();
-  indent_impl(s_service_impl) << "begin" << endl;
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "try" << endl;
+  indent_impl(s_service_impl) << "try" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "msg := iprot.ReadMessageBegin();" << endl;
-  indent_impl(s_service_impl) << "fn := nil;" << endl;
-  indent_impl(s_service_impl) << "if not processMap_.TryGetValue(msg.Name, fn)" << endl;
-  indent_impl(s_service_impl) << "or not Assigned(fn) then begin" << endl;
+  indent_impl(s_service_impl) << "msg := iprot.ReadMessageBegin();" << '\n';
+  indent_impl(s_service_impl) << "fn := nil;" << '\n';
+  indent_impl(s_service_impl) << "if not processMap_.TryGetValue(msg.Name, fn)" << '\n';
+  indent_impl(s_service_impl) << "or not Assigned(fn) then begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "TProtocolUtil.Skip(iprot, TType.Struct);" << endl;
-  indent_impl(s_service_impl) << "iprot.ReadMessageEnd();" << endl;
+  indent_impl(s_service_impl) << "TProtocolUtil.Skip(iprot, TType.Struct);" << '\n';
+  indent_impl(s_service_impl) << "iprot.ReadMessageEnd();" << '\n';
   indent_impl(s_service_impl) << "x := "
                                  "TApplicationExceptionUnknownMethod.Create("
-                                 "'Invalid method name: ''' + msg.Name + '''');" << endl;
+                                 "'Invalid method name: ''' + msg.Name + '''');" << '\n';
   indent_impl(s_service_impl)
       << "Thrift.Protocol.Init( msg, msg.Name, TMessageType.Exception, msg.SeqID);"
-      << endl;
-  indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << endl;
-  indent_impl(s_service_impl) << "x.Write(oprot);" << endl;
-  indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << endl;
-  indent_impl(s_service_impl) << "oprot.Transport.Flush();" << endl;
-  indent_impl(s_service_impl) << "Result := True;" << endl;
-  indent_impl(s_service_impl) << "Exit;" << endl;
+      << '\n';
+  indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << '\n';
+  indent_impl(s_service_impl) << "x.Write(oprot);" << '\n';
+  indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << '\n';
+  indent_impl(s_service_impl) << "oprot.Transport.Flush();" << '\n';
+  indent_impl(s_service_impl) << "Result := True;" << '\n';
+  indent_impl(s_service_impl) << "Exit;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
   if (events_) {
-    indent_impl(s_service_impl) << "if events <> nil" << endl;
-    indent_impl(s_service_impl) << "then context := events.CreateRequestContext(msg.Name)" << endl;
-    indent_impl(s_service_impl) << "else context := nil;" << endl;
-    indent_impl(s_service_impl) << "try" << endl;
+    indent_impl(s_service_impl) << "if events <> nil" << '\n';
+    indent_impl(s_service_impl) << "then context := events.CreateRequestContext(msg.Name)" << '\n';
+    indent_impl(s_service_impl) << "else context := nil;" << '\n';
+    indent_impl(s_service_impl) << "try" << '\n';
     indent_up_impl();
-    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot, context);" << endl;
+    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot, context);" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "finally" << endl;
+    indent_impl(s_service_impl) << "finally" << '\n';
     indent_up_impl();
-    indent_impl(s_service_impl) << "if context <> nil then begin" << endl;
+    indent_impl(s_service_impl) << "if context <> nil then begin" << '\n';
     indent_up_impl();
-    indent_impl(s_service_impl) << "context.CleanupContext;" << endl;
-    indent_impl(s_service_impl) << "context := nil;" << endl;
+    indent_impl(s_service_impl) << "context.CleanupContext;" << '\n';
+    indent_impl(s_service_impl) << "context := nil;" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
+    indent_impl(s_service_impl) << "end;" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
+    indent_impl(s_service_impl) << "end;" << '\n';
   } else {
-    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot);" << endl;
+    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot);" << '\n';
   }
   indent_down_impl();
-  indent_impl(s_service_impl) << "except" << endl;
+  indent_impl(s_service_impl) << "except" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "on TTransportExceptionTimedOut do begin" << endl;
+  indent_impl(s_service_impl) << "on TTransportExceptionTimedOut do begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "Result := True;" << endl;
-  indent_impl(s_service_impl) << "Exit;" << endl;
+  indent_impl(s_service_impl) << "Result := True;" << '\n';
+  indent_impl(s_service_impl) << "Exit;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
-  indent_impl(s_service_impl) << "else begin" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
+  indent_impl(s_service_impl) << "else begin" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "Result := False;" << endl;
-  indent_impl(s_service_impl) << "Exit;" << endl;
+  indent_impl(s_service_impl) << "Result := False;" << '\n';
+  indent_impl(s_service_impl) << "Exit;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
-  indent_impl(s_service_impl) << "Result := True;" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
+  indent_impl(s_service_impl) << "Result := True;" << '\n';
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_process_function(tservice, *f_iter);
   }
 
   indent_down();
-  indent(s_service) << "end;" << endl << endl;
+  indent(s_service) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_function_helpers(t_function* tfunction) {
@@ -2439,46 +2437,46 @@
 
   indent(s_service) << "procedure " << funcname
                     << "_Process( seqid: System.Integer; const iprot: IProtocol; const oprot: IProtocol"
-                    << (events_ ? "; const events : IRequestEvents" : "") << ");" << endl;
+                    << (events_ ? "; const events : IRequestEvents" : "") << ");" << '\n';
 
   if (tfunction->is_oneway()) {
-    indent_impl(s_service_impl) << "// one way processor" << endl;
+    indent_impl(s_service_impl) << "// one way processor" << '\n';
   } else {
-    indent_impl(s_service_impl) << "// both way processor" << endl;
+    indent_impl(s_service_impl) << "// both way processor" << '\n';
   }
 
   indent_impl(s_service_impl)
       << "procedure " << full_cls << "." << funcname
       << "_Process( seqid: System.Integer; const iprot: IProtocol; const oprot: IProtocol"
-      << (events_ ? "; const events : IRequestEvents" : "") << ");" << endl;
-  indent_impl(s_service_impl) << "var" << endl;
+      << (events_ ? "; const events : IRequestEvents" : "") << ");" << '\n';
+  indent_impl(s_service_impl) << "var" << '\n';
   indent_up_impl();
-  indent_impl(s_service_impl) << "args: " << args_intfnm << ";" << endl;
+  indent_impl(s_service_impl) << "args: " << args_intfnm << ";" << '\n';
   if (!tfunction->is_oneway()) {
-    indent_impl(s_service_impl) << "msg: Thrift.Protocol.TThriftMessage;" << endl;
-    indent_impl(s_service_impl) << "ret: " << result_intfnm << ";" << endl;
-    indent_impl(s_service_impl) << "appx : TApplicationException;" << endl;
+    indent_impl(s_service_impl) << "msg: Thrift.Protocol.TThriftMessage;" << '\n';
+    indent_impl(s_service_impl) << "ret: " << result_intfnm << ";" << '\n';
+    indent_impl(s_service_impl) << "appx : TApplicationException;" << '\n';
   }
 
   indent_down_impl();
-  indent_impl(s_service_impl) << "begin" << endl;
+  indent_impl(s_service_impl) << "begin" << '\n';
   indent_up_impl();
 
   if (!tfunction->is_oneway()) {
-    indent_impl(s_service_impl) << "ret := " << result_clsnm << "Impl.Create;" << endl;
+    indent_impl(s_service_impl) << "ret := " << result_clsnm << "Impl.Create;" << '\n';
   }
 
-  indent_impl(s_service_impl) << "try" << endl;
+  indent_impl(s_service_impl) << "try" << '\n';
   indent_up_impl();
 
   if (events_) {
-    indent_impl(s_service_impl) << "if events <> nil then events.PreRead;" << endl;
+    indent_impl(s_service_impl) << "if events <> nil then events.PreRead;" << '\n';
   }
-  indent_impl(s_service_impl) << "args := " << args_clsnm << "Impl.Create;" << endl;
-  indent_impl(s_service_impl) << "args.Read(iprot);" << endl;
-  indent_impl(s_service_impl) << "iprot.ReadMessageEnd();" << endl;
+  indent_impl(s_service_impl) << "args := " << args_clsnm << "Impl.Create;" << '\n';
+  indent_impl(s_service_impl) << "args.Read(iprot);" << '\n';
+  indent_impl(s_service_impl) << "iprot.ReadMessageEnd();" << '\n';
   if (events_) {
-    indent_impl(s_service_impl) << "if events <> nil then events.PostRead;" << endl;
+    indent_impl(s_service_impl) << "if events <> nil then events.PostRead;" << '\n';
   }
 
   t_struct* xs = tfunction->get_xceptions();
@@ -2503,88 +2501,88 @@
     }
     s_service_impl << "args." << prop_name(*f_iter);
   }
-  s_service_impl << ");" << endl;
+  s_service_impl << ");" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     indent_impl(s_service_impl) << "args." << prop_name(*f_iter)
-                                << " := " << empty_value((*f_iter)->get_type()) << ";" << endl;
+                                << " := " << empty_value((*f_iter)->get_type()) << ";" << '\n';
   }
 
   indent_down_impl();
-  indent_impl(s_service_impl) << "except" << endl;
+  indent_impl(s_service_impl) << "except" << '\n';
   indent_up_impl();
 
   for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
     indent_impl(s_service_impl) << "on E: " << type_name((*x_iter)->get_type(), true, true)
-                                << " do begin" << endl;
+                                << " do begin" << '\n';
     indent_up_impl();
     if (!tfunction->is_oneway()) {
       string factory_name = normalize_clsnm((*x_iter)->get_type()->get_name(), "", true)
                             + "Factory";
       indent_impl(s_service_impl) << "ret." << prop_name(*x_iter) << " := E." << factory_name << ";"
-                                  << endl;
+                                  << '\n';
     }
     indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
+    indent_impl(s_service_impl) << "end;" << '\n';
   }
 
-  indent_impl(s_service_impl) << "on E: Exception do begin" << endl;
+  indent_impl(s_service_impl) << "on E: Exception do begin" << '\n';
   indent_up_impl();
   if(events_) {
-    indent_impl(s_service_impl) << "if events <> nil then events.UnhandledError(E);" << endl;
+    indent_impl(s_service_impl) << "if events <> nil then events.UnhandledError(E);" << '\n';
   }
   if (!tfunction->is_oneway()) {
     indent_impl(s_service_impl) << "appx := TApplicationExceptionInternalError.Create(E.Message);"
-                                << endl;
-    indent_impl(s_service_impl) << "try" << endl;
+                                << '\n';
+    indent_impl(s_service_impl) << "try" << '\n';
     indent_up_impl();
     if(events_) {
-      indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
+      indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << '\n';
     }
     indent_impl(s_service_impl) << "Thrift.Protocol.Init( msg, '"
                                 << tfunction->get_name() << "', TMessageType.Exception, seqid);"
-                                << endl;
-    indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << endl;
-    indent_impl(s_service_impl) << "appx.Write(oprot);" << endl;
-    indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << endl;
-    indent_impl(s_service_impl) << "oprot.Transport.Flush();" << endl;
+                                << '\n';
+    indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << '\n';
+    indent_impl(s_service_impl) << "appx.Write(oprot);" << '\n';
+    indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << '\n';
+    indent_impl(s_service_impl) << "oprot.Transport.Flush();" << '\n';
     if(events_) {
-      indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << endl;
+      indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << '\n';
     }
-    indent_impl(s_service_impl) << "Exit;" << endl;
+    indent_impl(s_service_impl) << "Exit;" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "finally" << endl;
+    indent_impl(s_service_impl) << "finally" << '\n';
     indent_up_impl();
-    indent_impl(s_service_impl) << "appx.Free;" << endl;
+    indent_impl(s_service_impl) << "appx.Free;" << '\n';
     indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
+    indent_impl(s_service_impl) << "end;" << '\n';
   }
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
 
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
+  indent_impl(s_service_impl) << "end;" << '\n';
 
   if (!tfunction->is_oneway()) {
     if (events_) {
-      indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
+      indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << '\n';
     }
     indent_impl(s_service_impl) << "Thrift.Protocol.Init( msg, '"
                                 << tfunction->get_name() << "', TMessageType.Reply, seqid); "
-                                << endl;
-    indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg); " << endl;
-    indent_impl(s_service_impl) << "ret.Write(oprot);" << endl;
-    indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << endl;
-    indent_impl(s_service_impl) << "oprot.Transport.Flush();" << endl;
+                                << '\n';
+    indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg); " << '\n';
+    indent_impl(s_service_impl) << "ret.Write(oprot);" << '\n';
+    indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << '\n';
+    indent_impl(s_service_impl) << "oprot.Transport.Flush();" << '\n';
     if (events_) {
-      indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << endl;
+      indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << '\n';
     }
   } else if (events_) {
-    indent_impl(s_service_impl) << "if events <> nil then events.OnewayComplete;" << endl;
+    indent_impl(s_service_impl) << "if events <> nil then events.OnewayComplete;" << '\n';
   }
 
   indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
+  indent_impl(s_service_impl) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_deserialize_field(ostream& out,
@@ -2657,7 +2655,7 @@
       out << "ReadI32()";
       out << ");";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -2677,8 +2675,8 @@
     typ_name = type_name(tstruct, true, false);
   }
 
-  indent_impl(out) << prefix << name << " := " << typ_name << ".Create;" << endl;
-  indent_impl(out) << prefix << name << ".Read(iprot);" << endl;
+  indent_impl(out) << prefix << name << " := " << typ_name << ".Create;" << '\n';
+  indent_impl(out) << prefix << name << ".Read(iprot);" << '\n';
 }
 
 void t_delphi_generator::generate_deserialize_container(ostream& out,
@@ -2706,22 +2704,22 @@
   } else if (ttype->is_list()) {
     local_var = obj + ": TThriftList;";
   }
-  local_vars << "  " << local_var << endl;
+  local_vars << "  " << local_var << '\n';
   counter = tmp("_i");
   local_var = counter + ": System.Integer;";
-  local_vars << "  " << local_var << endl;
+  local_vars << "  " << local_var << '\n';
 
-  indent_impl(out) << name << " := " << type_name(ttype, true) << ".Create;" << endl;
+  indent_impl(out) << name << " := " << type_name(ttype, true) << ".Create;" << '\n';
 
   if (ttype->is_map()) {
-    indent_impl(out) << obj << " := iprot.ReadMapBegin();" << endl;
+    indent_impl(out) << obj << " := iprot.ReadMapBegin();" << '\n';
   } else if (ttype->is_set()) {
-    indent_impl(out) << obj << " := iprot.ReadSetBegin();" << endl;
+    indent_impl(out) << obj << " := iprot.ReadSetBegin();" << '\n';
   } else if (ttype->is_list()) {
-    indent_impl(out) << obj << " := iprot.ReadListBegin();" << endl;
+    indent_impl(out) << obj << " := iprot.ReadListBegin();" << '\n';
   }
 
-  indent_impl(out) << "for " << counter << " := 0 to " << obj << ".Count - 1 do begin" << endl;
+  indent_impl(out) << "for " << counter << " := 0 to " << obj << ".Count - 1 do begin" << '\n';
   indent_up_impl();
   if (ttype->is_map()) {
     generate_deserialize_map_element(out, is_xception, (t_map*)ttype, name, local_vars);
@@ -2731,14 +2729,14 @@
     generate_deserialize_list_element(out, is_xception, (t_list*)ttype, name, local_vars);
   }
   indent_down_impl();
-  indent_impl(out) << "end;" << endl;
+  indent_impl(out) << "end;" << '\n';
 
   if (ttype->is_map()) {
-    indent_impl(out) << "iprot.ReadMapEnd();" << endl;
+    indent_impl(out) << "iprot.ReadMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent_impl(out) << "iprot.ReadSetEnd();" << endl;
+    indent_impl(out) << "iprot.ReadSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent_impl(out) << "iprot.ReadListEnd();" << endl;
+    indent_impl(out) << "iprot.ReadListEnd();" << '\n';
   }
 }
 
@@ -2755,13 +2753,13 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  local_vars << "  " << declare_field(&fkey) << endl;
-  local_vars << "  " << declare_field(&fval) << endl;
+  local_vars << "  " << declare_field(&fkey) << '\n';
+  local_vars << "  " << declare_field(&fval) << '\n';
 
   generate_deserialize_field(out, is_xception, &fkey, "", local_vars);
   generate_deserialize_field(out, is_xception, &fval, "", local_vars);
 
-  indent_impl(out) << prefix << ".AddOrSetValue( " << key << ", " << val << ");" << endl;
+  indent_impl(out) << prefix << ".AddOrSetValue( " << key << ", " << val << ");" << '\n';
 }
 
 void t_delphi_generator::generate_deserialize_set_element(ostream& out,
@@ -2771,9 +2769,9 @@
                                                           ostream& local_vars) {
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
-  local_vars << "  " << declare_field(&felem) << endl;
+  local_vars << "  " << declare_field(&felem) << '\n';
   generate_deserialize_field(out, is_xception, &felem, "", local_vars);
-  indent_impl(out) << prefix << ".Add(" << elem << ");" << endl;
+  indent_impl(out) << prefix << ".Add(" << elem << ");" << '\n';
 }
 
 void t_delphi_generator::generate_deserialize_list_element(ostream& out,
@@ -2783,9 +2781,9 @@
                                                            ostream& local_vars) {
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
-  local_vars << "  " << declare_field(&felem) << endl;
+  local_vars << "  " << declare_field(&felem) << '\n';
   generate_deserialize_field(out, is_xception, &felem, "", local_vars);
-  indent_impl(out) << prefix << ".Add(" << elem << ");" << endl;
+  indent_impl(out) << prefix << ".Add(" << elem << ");" << '\n';
 }
 
 void t_delphi_generator::generate_serialize_field(ostream& out,
@@ -2856,7 +2854,7 @@
     } else if (type->is_enum()) {
       out << "WriteI32(System.Integer(" << name << "));";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -2871,7 +2869,7 @@
                                                    ostream& local_vars) {
   (void)local_vars;
   (void)tstruct;
-  out << indent_impl() << prefix << ".Write(oprot);" << endl;
+  out << indent_impl() << prefix << ".Write(oprot);" << '\n';
 }
 
 void t_delphi_generator::generate_serialize_container(ostream& out,
@@ -2882,42 +2880,42 @@
   string obj;
   if (ttype->is_map()) {
     obj = tmp("map");
-    local_vars << "  " << obj << " : TThriftMap;" << endl;
+    local_vars << "  " << obj << " : TThriftMap;" << '\n';
     indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
                      << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                      << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix
-                     << ".Count);" << endl;
-    indent_impl(out) << "oprot.WriteMapBegin( " << obj << ");" << endl;
+                     << ".Count);" << '\n';
+    indent_impl(out) << "oprot.WriteMapBegin( " << obj << ");" << '\n';
   } else if (ttype->is_set()) {
     obj = tmp("set_");
-    local_vars << "  " << obj << " : TThriftSet;" << endl;
+    local_vars << "  " << obj << " : TThriftSet;" << '\n';
     indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
                      << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " << prefix
-                     << ".Count);" << endl;
-    indent_impl(out) << "oprot.WriteSetBegin( " << obj << ");" << endl;
+                     << ".Count);" << '\n';
+    indent_impl(out) << "oprot.WriteSetBegin( " << obj << ");" << '\n';
   } else if (ttype->is_list()) {
     obj = tmp("list_");
-    local_vars << "  " << obj << " : TThriftList;" << endl;
+    local_vars << "  " << obj << " : TThriftList;" << '\n';
     indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
                      << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix
-                     << ".Count);" << endl;
-    indent_impl(out) << "oprot.WriteListBegin( " << obj << ");" << endl;
+                     << ".Count);" << '\n';
+    indent_impl(out) << "oprot.WriteListBegin( " << obj << ");" << '\n';
   }
 
   string iter = tmp("_iter");
   if (ttype->is_map()) {
-    local_vars << "  " << iter << ": " << type_name(((t_map*)ttype)->get_key_type()) << ";" << endl;
-    indent_impl(out) << "for " << iter << " in " << prefix << ".Keys do begin" << endl;
+    local_vars << "  " << iter << ": " << type_name(((t_map*)ttype)->get_key_type()) << ";" << '\n';
+    indent_impl(out) << "for " << iter << " in " << prefix << ".Keys do begin" << '\n';
     indent_up_impl();
   } else if (ttype->is_set()) {
     local_vars << "  " << iter << ": " << type_name(((t_set*)ttype)->get_elem_type()) << ";"
-               << endl;
-    indent_impl(out) << "for " << iter << " in " << prefix << " do begin" << endl;
+               << '\n';
+    indent_impl(out) << "for " << iter << " in " << prefix << " do begin" << '\n';
     indent_up_impl();
   } else if (ttype->is_list()) {
     local_vars << "  " << iter << ": " << type_name(((t_list*)ttype)->get_elem_type()) << ";"
-               << endl;
-    indent_impl(out) << "for " << iter << " in " << prefix << " do begin" << endl;
+               << '\n';
+    indent_impl(out) << "for " << iter << " in " << prefix << " do begin" << '\n';
     indent_up_impl();
   }
 
@@ -2930,14 +2928,14 @@
   }
 
   indent_down_impl();
-  indent_impl(out) << "end;" << endl;
+  indent_impl(out) << "end;" << '\n';
 
   if (ttype->is_map()) {
-    indent_impl(out) << "oprot.WriteMapEnd();" << endl;
+    indent_impl(out) << "oprot.WriteMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent_impl(out) << "oprot.WriteSetEnd();" << endl;
+    indent_impl(out) << "oprot.WriteSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent_impl(out) << "oprot.WriteListEnd();" << endl;
+    indent_impl(out) << "oprot.WriteListEnd();" << '\n';
   }
 }
 
@@ -2989,10 +2987,10 @@
   bool is_xception = ftype->is_xception();
   generate_delphi_doc(out, tfield);
   indent(out) << "property " << prop_name(tfield, struct_is_xception) << ": "
-              << type_name(ftype, false, true, is_xception, true) 
-              << " read " << prop_name(tfield, struct_is_xception, fieldPrefix) 
-              << " write " << prop_name(tfield, struct_is_xception, "Set") 
-              << ";" << endl;
+              << type_name(ftype, false, true, is_xception, true)
+              << " read " << prop_name(tfield, struct_is_xception, fieldPrefix)
+              << " write " << prop_name(tfield, struct_is_xception, "Set")
+              << ";" << '\n';
 }
 
 std::string t_delphi_generator::prop_name(t_field* tfield, bool is_xception, std::string prefix) {
@@ -3217,7 +3215,7 @@
   }
 
   string signature = "";
-  
+
   if( for_async) {
     if (is_void(ttype)) {
       signature = "function " + prefix + normalize_name(tfunction->get_name(), true, is_xception) + "Async("
@@ -3296,10 +3294,10 @@
 
     if (line.size() > 80) {
       if (firstline) {
-        result << endl << newline_indent;
+        result << '\n' << newline_indent;
         firstline = false;
       }
-      result << line << endl;
+      result << line << '\n';
       line = newline_indent;
     } else if (line.size() > 0) {
       line += " ";
@@ -3419,7 +3417,7 @@
 
   indent(out) << "procedure " << prop_name(tfield, is_xception_class, "Set")
               << "( const Value: " << type_name(ftype, false, true, is_xception, true) << ");"
-              << endl;
+              << '\n';
 }
 
 void t_delphi_generator::generate_delphi_property_reader_definition(ostream& out,
@@ -3429,14 +3427,14 @@
   bool is_xception = ftype->is_xception();
 
   indent(out) << "function " << prop_name(tfield, is_xception_class, "Get") << ": "
-              << type_name(ftype, false, true, is_xception, true) << ";" << endl;
+              << type_name(ftype, false, true, is_xception, true) << ";" << '\n';
 }
 
 void t_delphi_generator::generate_delphi_isset_reader_writer_definition(ostream& out,
                                                                  t_field* tfield,
                                                                  bool is_xception) {
-  indent(out) << "function " << prop_name(tfield, is_xception,"Get__isset_") << ": System.Boolean;" << endl;
-  indent(out) << "procedure " << prop_name(tfield, is_xception, "Set__isset_") << "( const value : System.Boolean);" << endl;
+  indent(out) << "function " << prop_name(tfield, is_xception,"Get__isset_") << ": System.Boolean;" << '\n';
+  indent(out) << "procedure " << prop_name(tfield, is_xception, "Set__isset_") << "( const value : System.Boolean);" << '\n';
 }
 
 void t_delphi_generator::generate_delphi_clear_union_value(ostream& out,
@@ -3460,14 +3458,14 @@
   bool is_xception = ftype->is_xception();
 
   indent_impl(out) << "if " << prop_name(tfield, is_xception_class,"F__isset_") << " then begin"
-                   << endl;
+                   << '\n';
   indent_up_impl();
-  indent_impl(out) << prop_name(tfield, is_xception_class,"F__isset_") << " := False;" << endl;
+  indent_impl(out) << prop_name(tfield, is_xception_class,"F__isset_") << " := False;" << '\n';
   indent_impl(out) << prop_name(tfield, is_xception_class,fieldPrefix) << " := "
                    << "Default( " << type_name(ftype, false, true, is_xception, true) << ");"
-                   << endl;
+                   << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl;
+  indent_impl(out) << "end;" << '\n';
 }
 
 void t_delphi_generator::generate_delphi_property_writer_impl(ostream& out,
@@ -3488,24 +3486,24 @@
   indent_impl(out) << "procedure " << cls_prefix << name << "."
                    << prop_name(tfield, is_xception_class,"Set")
                    << "( const Value: " << type_name(ftype, false, true, is_xception, true) << ");"
-                   << endl;
-  indent_impl(out) << "begin" << endl;
+                   << '\n';
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
   if (is_union) {
-    indent_impl(out) << "ClearUnionValues;" << endl;
+    indent_impl(out) << "ClearUnionValues;" << '\n';
   }
   if (tfield->get_req() != t_field::T_REQUIRED) {
-    indent_impl(out) << prop_name(tfield, is_xception_class,"F__isset_") << " := True;" << endl;
+    indent_impl(out) << prop_name(tfield, is_xception_class,"F__isset_") << " := True;" << '\n';
   }
-  indent_impl(out) << prop_name(tfield, is_xception_class,fieldPrefix) << " := Value;" << endl;
+  indent_impl(out) << prop_name(tfield, is_xception_class,fieldPrefix) << " := Value;" << '\n';
 
   if (is_xception_class && (!is_xception_factory)) {
     indent_impl(out) << xception_factory_name << "." << prop_name(tfield, is_xception_class)
-                     << " := Value;" << endl;
+                     << " := Value;" << '\n';
   }
 
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_delphi_property_reader_impl(ostream& out,
@@ -3522,13 +3520,13 @@
 
   indent_impl(out) << "function " << cls_prefix << name << "."
                    << prop_name(tfield, is_xception_class,"Get") << ": "
-                   << type_name(ftype, false, true, is_xception, true) << ";" << endl;
-  indent_impl(out) << "begin" << endl;
+                   << type_name(ftype, false, true, is_xception, true) << ";" << '\n';
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
   indent_impl(out) << "Result := " << prop_name(tfield, is_xception_class,fieldPrefix) << ";"
-                   << endl;
+                   << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_delphi_isset_reader_writer_impl(ostream& out,
@@ -3541,22 +3539,22 @@
   (void)type;
 
   string isset_name = prop_name(tfield, is_xception, "__isset_");
-  
+
   indent_impl(out) << "function " << cls_prefix << name << "."
-                   << "Get" << isset_name << ": System.Boolean;" << endl;
-  indent_impl(out) << "begin" << endl;
+                   << "Get" << isset_name << ": System.Boolean;" << '\n';
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(out) << "Result := " << fieldPrefix << isset_name << ";" << endl;
+  indent_impl(out) << "Result := " << fieldPrefix << isset_name << ";" << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
-  
+  indent_impl(out) << "end;" << '\n' << '\n';
+
   indent_impl(out) << "procedure " << cls_prefix << name << "."
-                   << "Set" << isset_name << "( const value: System.Boolean);" << endl;
-  indent_impl(out) << "begin" << endl;
+                   << "Set" << isset_name << "( const value: System.Boolean);" << '\n';
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
-  indent_impl(out) << fieldPrefix << isset_name << " := value;" << endl;
+  indent_impl(out) << fieldPrefix << isset_name << " := value;" << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_delphi_create_exception_impl(ostream& out,
@@ -3569,14 +3567,14 @@
   string cls_nm = type_name(tstruct, true, false, is_exception, is_exception);
 
   indent_impl(out) << "function " << cls_nm << ".CreateException: " << exception_cls_nm << ";"
-                   << endl;
+                   << '\n';
 
-  indent_impl(out) << "begin" << endl;
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
 
-  indent_impl(out) << "Result := " << exception_cls_nm << ".Create;" << endl;
+  indent_impl(out) << "Result := " << exception_cls_nm << ".Create;" << '\n';
   string factory_name = normalize_clsnm(tstruct->get_name(), "", true) + "Factory";
-  indent_impl(out) << "Result.F" << factory_name << " := Self;" << endl;
+  indent_impl(out) << "Result.F" << factory_name << " := Self;" << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -3586,20 +3584,20 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     propname = prop_name(*f_iter, is_exception);
     if ((*f_iter)->get_req() != t_field::T_REQUIRED) {
-      indent_impl(out) << "if " << prop_name(*f_iter, is_exception,"__isset_") << " then begin" << endl;
+      indent_impl(out) << "if " << prop_name(*f_iter, is_exception,"__isset_") << " then begin" << '\n';
       indent_up_impl();
     }
-    indent_impl(out) << "Result." << propname << " := " << propname << ";" << endl;
+    indent_impl(out) << "Result." << propname << " := " << propname << ";" << '\n';
     if ((*f_iter)->get_req() != t_field::T_REQUIRED) {
       indent_down_impl();
-      indent_impl(out) << "end;" << endl;
+      indent_impl(out) << "end;" << '\n';
     }
   }
 
-  indent_impl(out) << "Result.UpdateMessageProperty;" << endl;
+  indent_impl(out) << "Result.UpdateMessageProperty;" << '\n';
 
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 }
 
 void t_delphi_generator::generate_delphi_struct_reader_impl(ostream& out,
@@ -3614,53 +3612,53 @@
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent_impl(code_block) << "begin" << endl;
+  indent_impl(code_block) << "begin" << '\n';
   indent_up_impl();
 
-  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << endl;
-  indent_impl(code_block) << "tracker := iprot.NextRecursionLevel;" << endl;
+  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << '\n';
+  indent_impl(code_block) << "tracker := iprot.NextRecursionLevel;" << '\n';
 
   // local bools for required fields
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       indent_impl(local_vars) << prop_name(*f_iter, is_exception,"_req_isset_") << " : System.Boolean;"
-                              << endl;
+                              << '\n';
       indent_impl(code_block) << prop_name(*f_iter, is_exception,"_req_isset_") << " := FALSE;"
-                              << endl;
+                              << '\n';
     }
   }
 
-  indent_impl(code_block) << "struc := iprot.ReadStructBegin;" << endl;
+  indent_impl(code_block) << "struc := iprot.ReadStructBegin;" << '\n';
 
-  indent_impl(code_block) << "try" << endl;
+  indent_impl(code_block) << "try" << '\n';
   indent_up_impl();
 
-  indent_impl(code_block) << "while (true) do begin" << endl;
+  indent_impl(code_block) << "while (true) do begin" << '\n';
   indent_up_impl();
 
-  indent_impl(code_block) << "field_ := iprot.ReadFieldBegin();" << endl;
+  indent_impl(code_block) << "field_ := iprot.ReadFieldBegin();" << '\n';
 
-  indent_impl(code_block) << "if (field_.Type_ = TType.Stop) then Break;" << endl;
+  indent_impl(code_block) << "if (field_.Type_ = TType.Stop) then Break;" << '\n';
 
   bool first = true;
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
 
     if (first) {
-      code_block << endl;
-      indent_impl(code_block) << "case field_.ID of" << endl;
+      code_block << '\n';
+      indent_impl(code_block) << "case field_.ID of" << '\n';
       indent_up_impl();
     }
 
     first = false;
     if (f_iter != fields.begin()) {
-      code_block << endl;
+      code_block << '\n';
     }
 
-    indent_impl(code_block) << (*f_iter)->get_key() << ": begin" << endl;
+    indent_impl(code_block) << (*f_iter)->get_key() << ": begin" << '\n';
     indent_up_impl();
     indent_impl(code_block) << "if (field_.Type_ = " << type_to_enum((*f_iter)->get_type())
-                            << ") then begin" << endl;
+                            << ") then begin" << '\n';
     indent_up_impl();
 
     generate_deserialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
@@ -3668,82 +3666,82 @@
     // required field?
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       indent_impl(code_block) << prop_name(*f_iter, is_exception,"_req_isset_") << " := TRUE;"
-                              << endl;
+                              << '\n';
     }
 
     indent_down_impl();
 
-    indent_impl(code_block) << "end else begin" << endl;
+    indent_impl(code_block) << "end else begin" << '\n';
     indent_up_impl();
-    indent_impl(code_block) << "TProtocolUtil.Skip(iprot, field_.Type_);" << endl;
+    indent_impl(code_block) << "TProtocolUtil.Skip(iprot, field_.Type_);" << '\n';
     indent_down_impl();
-    indent_impl(code_block) << "end;" << endl;
+    indent_impl(code_block) << "end;" << '\n';
     indent_down_impl();
     indent_impl(code_block) << "end;";
   }
 
   if (!first) {
-    code_block << endl;
+    code_block << '\n';
     indent_down_impl();
-    indent_impl(code_block) << "else" << endl;
+    indent_impl(code_block) << "else" << '\n';
     indent_up_impl();
   }
 
-  indent_impl(code_block) << "TProtocolUtil.Skip(iprot, field_.Type_);" << endl;
+  indent_impl(code_block) << "TProtocolUtil.Skip(iprot, field_.Type_);" << '\n';
 
   if (!first) {
     indent_down_impl();
-    indent_impl(code_block) << "end;" << endl;
+    indent_impl(code_block) << "end;" << '\n';
   }
 
-  indent_impl(code_block) << "iprot.ReadFieldEnd;" << endl;
+  indent_impl(code_block) << "iprot.ReadFieldEnd;" << '\n';
 
   indent_down_impl();
 
-  indent_impl(code_block) << "end;" << endl;
+  indent_impl(code_block) << "end;" << '\n';
   indent_down_impl();
 
-  indent_impl(code_block) << "finally" << endl;
+  indent_impl(code_block) << "finally" << '\n';
   indent_up_impl();
-  indent_impl(code_block) << "iprot.ReadStructEnd;" << endl;
+  indent_impl(code_block) << "iprot.ReadStructEnd;" << '\n';
   indent_down_impl();
-  indent_impl(code_block) << "end;" << endl;
+  indent_impl(code_block) << "end;" << '\n';
 
   // all required fields have been read?
   first = true;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       if(first) {
-        code_block << endl;
+        code_block << '\n';
         first = false;
       }
-      indent_impl(code_block) << "if not " << prop_name(*f_iter, is_exception,"_req_isset_") << endl;
+      indent_impl(code_block) << "if not " << prop_name(*f_iter, is_exception,"_req_isset_") << '\n';
       indent_impl(code_block)
           << "then raise TProtocolExceptionInvalidData.Create("
           << "'required field " << prop_name(*f_iter, is_exception) << " not set');"
-          << endl;
+          << '\n';
     }
   }
-  
+
   if( is_exception && (!is_x_factory)) {
-    code_block << endl;
-    indent_impl(code_block) << "UpdateMessageProperty;" << endl;
+    code_block << '\n';
+    indent_impl(code_block) << "UpdateMessageProperty;" << '\n';
   }
   indent_down_impl();
-  indent_impl(code_block) << "end;" << endl << endl;
+  indent_impl(code_block) << "end;" << '\n' << '\n';
 
   string cls_nm;
 
   cls_nm = type_name(tstruct, true, is_exception && (!is_x_factory), is_x_factory, is_x_factory);
 
   indent_impl(out) << "procedure " << cls_prefix << cls_nm << ".Read( const iprot: IProtocol);"
-                   << endl;
-  indent_impl(out) << "var" << endl;
+                   << '\n';
+  indent_impl(out) << "var" << '\n';
   indent_up_impl();
-  indent_impl(out) << "field_ : TThriftField;" << endl;
-  indent_impl(out) << "struc : TThriftStruct;" << endl;
+  indent_impl(out) << "field_ : TThriftField;" << '\n';
+  indent_impl(out) << "struc : TThriftStruct;" << '\n';
   indent_down_impl();
-  out << local_vars.str() << endl;
+  out << local_vars.str() << '\n';
   out << code_block.str();
 }
 
@@ -3760,51 +3758,51 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent_impl(code_block) << "begin" << endl;
+  indent_impl(code_block) << "begin" << '\n';
   indent_up_impl();
 
-  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << endl;
-  indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << endl;
+  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << '\n';
+  indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << '\n';
 
-  indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << endl;
-  indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << endl;
+  indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << '\n';
+  indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << '\n';
 
   if (fields.size() > 0) {
-    indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << endl;
+    indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << '\n';
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       indent_impl(code_block) << "if (" << prop_name(*f_iter, is_exception,"__isset_") << ") then"
-                              << endl;
-      indent_impl(code_block) << "begin" << endl;
+                              << '\n';
+      indent_impl(code_block) << "begin" << '\n';
       indent_up_impl();
-      indent_impl(code_block) << "field_.Name := '" << (*f_iter)->get_name() << "';" << endl;
+      indent_impl(code_block) << "field_.Name := '" << (*f_iter)->get_name() << "';" << '\n';
       indent_impl(code_block) << "field_.Type_  := " << type_to_enum((*f_iter)->get_type()) << ";"
-                              << endl;
-      indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << endl;
-      indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << endl;
+                              << '\n';
+      indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << '\n';
+      indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << '\n';
       generate_serialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
-      indent_impl(code_block) << "oprot.WriteFieldEnd();" << endl;
+      indent_impl(code_block) << "oprot.WriteFieldEnd();" << '\n';
       indent_down_impl();
     }
   }
 
-  indent_impl(code_block) << "oprot.WriteFieldStop();" << endl;
-  indent_impl(code_block) << "oprot.WriteStructEnd();" << endl;
+  indent_impl(code_block) << "oprot.WriteFieldStop();" << '\n';
+  indent_impl(code_block) << "oprot.WriteStructEnd();" << '\n';
 
   indent_down_impl();
-  indent_impl(code_block) << "end;" << endl << endl;
+  indent_impl(code_block) << "end;" << '\n' << '\n';
 
   string cls_nm;
 
   cls_nm = type_name(tstruct, true, is_exception && (!is_x_factory), is_x_factory, is_x_factory);
 
   indent_impl(out) << "procedure " << cls_prefix << cls_nm << ".Write( const oprot: IProtocol);"
-                   << endl;
-  indent_impl(out) << "var" << endl;
+                   << '\n';
+  indent_impl(out) << "var" << '\n';
   indent_up_impl();
-  indent_impl(out) << "struc : TThriftStruct;" << endl;
+  indent_impl(out) << "struc : TThriftStruct;" << '\n';
 
   if (fields.size() > 0) {
-    indent_impl(out) << "field_ : TThriftField;" << endl;
+    indent_impl(out) << "field_ : TThriftField;" << '\n';
   }
 
   out << local_vars.str();
@@ -3825,17 +3823,17 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent_impl(code_block) << "begin" << endl;
+  indent_impl(code_block) << "begin" << '\n';
   indent_up_impl();
 
-  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << endl;
-  indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << endl;
+  indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << '\n';
+  indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << '\n';
 
-  indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << endl;
-  indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << endl;
+  indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << '\n';
+  indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << '\n';
 
   if (fields.size() > 0) {
-    indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << endl;
+    indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << '\n';
   }
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -3846,54 +3844,54 @@
     bool has_isset = (!is_required);
     if (is_required && null_allowed) {
       null_allowed = false;
-      indent_impl(code_block) << "if (Self." << fieldname << " = nil)" << endl;
+      indent_impl(code_block) << "if (Self." << fieldname << " = nil)" << '\n';
       indent_impl(code_block) << "then raise TProtocolExceptionInvalidData.Create("
                               << "'required field " << fieldname << " not set');"
-                              << endl;
+                              << '\n';
     }
     if (null_allowed) {
       indent_impl(code_block) << "if (Self." << fieldname << " <> nil)";
       if (has_isset) {
         code_block << " and " << isset_name;
       }
-      code_block << " then begin" << endl;
+      code_block << " then begin" << '\n';
       indent_up_impl();
     } else {
       if (has_isset) {
-        indent_impl(code_block) << "if (" << isset_name << ") then begin" << endl;
+        indent_impl(code_block) << "if (" << isset_name << ") then begin" << '\n';
         indent_up_impl();
       }
     }
-    indent_impl(code_block) << "field_.Name := '" << (*f_iter)->get_name() << "';" << endl;
+    indent_impl(code_block) << "field_.Name := '" << (*f_iter)->get_name() << "';" << '\n';
     indent_impl(code_block) << "field_.Type_  := " << type_to_enum((*f_iter)->get_type()) << ";"
-                            << endl;
-    indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << endl;
-    indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << endl;
+                            << '\n';
+    indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << '\n';
+    indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << '\n';
     generate_serialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
-    indent_impl(code_block) << "oprot.WriteFieldEnd();" << endl;
+    indent_impl(code_block) << "oprot.WriteFieldEnd();" << '\n';
     if (null_allowed || has_isset) {
       indent_down_impl();
-      indent_impl(code_block) << "end;" << endl;
+      indent_impl(code_block) << "end;" << '\n';
     }
   }
 
-  indent_impl(code_block) << "oprot.WriteFieldStop();" << endl;
-  indent_impl(code_block) << "oprot.WriteStructEnd();" << endl;
+  indent_impl(code_block) << "oprot.WriteFieldStop();" << '\n';
+  indent_impl(code_block) << "oprot.WriteStructEnd();" << '\n';
 
   indent_down_impl();
-  indent_impl(code_block) << "end;" << endl << endl;
+  indent_impl(code_block) << "end;" << '\n' << '\n';
 
   string cls_nm;
 
   cls_nm = type_name(tstruct, true, is_exception && (!is_x_factory), is_x_factory, is_x_factory);
 
   indent_impl(out) << "procedure " << cls_prefix << cls_nm << ".Write( const oprot: IProtocol);"
-                   << endl;
-  indent_impl(out) << "var" << endl;
+                   << '\n';
+  indent_impl(out) << "var" << '\n';
   indent_up_impl();
-  indent_impl(out) << "struc : TThriftStruct;" << endl;
+  indent_impl(out) << "struc : TThriftStruct;" << '\n';
   if (fields.size() > 0) {
-    indent_impl(out) << "field_ : TThriftField;" << endl;
+    indent_impl(out) << "field_ : TThriftField;" << '\n';
   }
   out << local_vars.str();
   indent_down_impl();
@@ -3921,28 +3919,28 @@
   string tmp_first = tmp("_first");
   bool useFirstFlag = false;
 
-  indent_impl(out) << "function " << cls_prefix << cls_nm << ".ToString: string;" << endl;
-  indent_impl(out) << "var" << endl;
+  indent_impl(out) << "function " << cls_prefix << cls_nm << ".ToString: string;" << '\n';
+  indent_impl(out) << "var" << '\n';
   indent_up_impl();
-  indent_impl(out) << tmp_sb << " : TThriftStringBuilder;" << endl;
+  indent_impl(out) << tmp_sb << " : TThriftStringBuilder;" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool is_optional = ((*f_iter)->get_req() != t_field::T_REQUIRED);
     if (is_optional) {
-      indent_impl(out) << tmp_first << " : System.Boolean;" << endl;
+      indent_impl(out) << tmp_first << " : System.Boolean;" << '\n';
       useFirstFlag = true;
     }
     break;
   }
   indent_down_impl();
-  indent_impl(out) << "begin" << endl;
+  indent_impl(out) << "begin" << '\n';
   indent_up_impl();
 
-  indent_impl(out) << tmp_sb << " := TThriftStringBuilder.Create('(');" << endl;
-  indent_impl(out) << "try" << endl;
+  indent_impl(out) << tmp_sb << " := TThriftStringBuilder.Create('(');" << '\n';
+  indent_impl(out) << "try" << '\n';
   indent_up_impl();
 
   if (useFirstFlag) {
-    indent_impl(out) << tmp_first << " := TRUE;" << endl;
+    indent_impl(out) << tmp_first << " := TRUE;" << '\n';
   }
 
   bool had_required = false; // set to true after first required field has been processed
@@ -3955,26 +3953,26 @@
       if (is_optional) {
         out << " and " << prop_name(*f_iter, is_exception,"__isset_");
       }
-      out << " then begin" << endl;
+      out << " then begin" << '\n';
       indent_up_impl();
     } else {
       if (is_optional) {
         indent_impl(out) << "if (" << prop_name(*f_iter, is_exception, "__isset_") << ") then begin"
-                         << endl;
+                         << '\n';
         indent_up_impl();
       }
     }
 
     if (useFirstFlag && (!had_required)) {
-      indent_impl(out) << "if not " << tmp_first << " then " << tmp_sb << ".Append(',');" << endl;
+      indent_impl(out) << "if not " << tmp_first << " then " << tmp_sb << ".Append(',');" << '\n';
       if (is_optional) {
-        indent_impl(out) << tmp_first << " := FALSE;" << endl;
+        indent_impl(out) << tmp_first << " := FALSE;" << '\n';
       }
       indent_impl(out) << tmp_sb << ".Append('" << prop_name((*f_iter), is_exception) << ": ');"
-                       << endl;
+                       << '\n';
     } else {
       indent_impl(out) << tmp_sb << ".Append(', " << prop_name((*f_iter), is_exception) << ": ');"
-                       << endl;
+                       << '\n';
     }
 
     t_type* ttype = (*f_iter)->get_type();
@@ -3985,23 +3983,23 @@
     if (ttype->is_xception() || ttype->is_struct()) {
       indent_impl(out) << "if (Self." << prop_name((*f_iter), is_exception) << " = nil) then " << tmp_sb
                        << ".Append('<null>') else " << tmp_sb << ".Append( Self."
-                       << prop_name((*f_iter), is_exception) << ".ToString());" << endl;
+                       << prop_name((*f_iter), is_exception) << ".ToString());" << '\n';
     } else if (ttype->is_enum()) {
-      indent_impl(out) << tmp_sb << ".Append(EnumUtils<" 
-                       << type_name(ttype, false, true, false, false) 
-                       << ">.ToString( System.Ord( Self." 
-                       << prop_name((*f_iter), is_exception) << ")));" << endl;
+      indent_impl(out) << tmp_sb << ".Append(EnumUtils<"
+                       << type_name(ttype, false, true, false, false)
+                       << ">.ToString( System.Ord( Self."
+                       << prop_name((*f_iter), is_exception) << ")));" << '\n';
     } else if (ttype->is_uuid()) {
       indent_impl(out) << tmp_sb << ".Append( GUIDToString(Self." << prop_name((*f_iter), is_exception) << "));"
-                       << endl;
+                       << '\n';
     } else {
       indent_impl(out) << tmp_sb << ".Append( Self." << prop_name((*f_iter), is_exception) << ");"
-                       << endl;
+                       << '\n';
     }
 
     if (null_allowed || is_optional) {
       indent_down_impl();
-      indent_impl(out) << "end;" << endl;
+      indent_impl(out) << "end;" << '\n';
     }
 
     if (!is_optional) {
@@ -4009,21 +4007,21 @@
     }
   }
 
-  indent_impl(out) << tmp_sb << ".Append(')');" << endl;
-  indent_impl(out) << "Result := " << tmp_sb << ".ToString;" << endl;
+  indent_impl(out) << tmp_sb << ".Append(')');" << '\n';
+  indent_impl(out) << "Result := " << tmp_sb << ".ToString;" << '\n';
   if (useFirstFlag) {
-    indent_impl(out) << "if " << tmp_first << " then {prevent warning};" << endl;
+    indent_impl(out) << "if " << tmp_first << " then {prevent warning};" << '\n';
   }
 
   indent_down_impl();
-  indent_impl(out) << "finally" << endl;
+  indent_impl(out) << "finally" << '\n';
   indent_up_impl();
-  indent_impl(out) << tmp_sb << ".Free;" << endl;
+  indent_impl(out) << tmp_sb << ".Free;" << '\n';
   indent_down_impl();
-  indent_impl(out) << "end;" << endl;
+  indent_impl(out) << "end;" << '\n';
 
   indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
+  indent_impl(out) << "end;" << '\n' << '\n';
 }
 
 bool t_delphi_generator::is_void(t_type* type) {
diff --git a/compiler/cpp/src/thrift/generate/t_erl_generator.cc b/compiler/cpp/src/thrift/generate/t_erl_generator.cc
index 7293972..f28c7fd 100644
--- a/compiler/cpp/src/thrift/generate/t_erl_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_erl_generator.cc
@@ -39,8 +39,6 @@
 using std::stringstream;
 using std::vector;
 
-static const std::string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Erlang code generator.
  *
@@ -268,14 +266,14 @@
 
   hrl_header(f_types_hrl_file_, program_module_name + "_types");
 
-  f_types_file_ << erl_autogen_comment() << endl
-                << "-module(" << program_module_name << "_types)." << endl
-                << erl_imports() << endl;
+  f_types_file_ << erl_autogen_comment() << '\n'
+                << "-module(" << program_module_name << "_types)." << '\n'
+                << erl_imports() << '\n';
 
-  f_types_file_ << "-include(\"" << program_module_name << "_types.hrl\")." << endl
-                  << endl;
+  f_types_file_ << "-include(\"" << program_module_name << "_types.hrl\")." << '\n'
+                  << '\n';
 
-  f_types_hrl_file_ << render_includes() << endl;
+  f_types_hrl_file_ << render_includes() << '\n';
 
   // consts files
   string f_consts_name = get_out_dir() + program_module_name + "_constants.erl";
@@ -284,28 +282,28 @@
   f_consts_file_.open(f_consts_name.c_str());
   f_consts_hrl_file_.open(f_consts_hrl_name.c_str());
 
-  f_consts_file_ << erl_autogen_comment() << endl
-                 << "-module(" << program_module_name << "_constants)." << endl
-                 << erl_imports() << endl
-                 << "-include(\"" << program_module_name << "_types.hrl\")." << endl
-                 << endl;
+  f_consts_file_ << erl_autogen_comment() << '\n'
+                 << "-module(" << program_module_name << "_constants)." << '\n'
+                 << erl_imports() << '\n'
+                 << "-include(\"" << program_module_name << "_types.hrl\")." << '\n'
+                 << '\n';
 
-  f_consts_hrl_file_ << erl_autogen_comment() << endl << erl_imports() << endl
-                     << "-include(\"" << program_module_name << "_types.hrl\")." << endl << endl;
+  f_consts_hrl_file_ << erl_autogen_comment() << '\n' << erl_imports() << '\n'
+                     << "-include(\"" << program_module_name << "_types.hrl\")." << '\n' << '\n';
 }
 
 /**
  * Boilerplate at beginning and end of header files
  */
 void t_erl_generator::hrl_header(ostream& out, string name) {
-  out << erl_autogen_comment() << endl
-      << "-ifndef(_" << name << "_included)." << endl << "-define(_" << name << "_included, yeah)."
-      << endl;
+  out << erl_autogen_comment() << '\n'
+      << "-ifndef(_" << name << "_included)." << '\n' << "-define(_" << name << "_included, yeah)."
+      << '\n';
 }
 
 void t_erl_generator::hrl_footer(ostream& out, string name) {
   (void)name;
-  out << "-endif." << endl;
+  out << "-endif." << '\n';
 }
 
 /**
@@ -365,13 +363,13 @@
   export_types_string("struct_names", 0);
   export_types_string("exception_names", 0);
 
-  f_types_file_ << "-export([" << export_types_lines_.str() << "])." << endl << endl;
+  f_types_file_ << "-export([" << export_types_lines_.str() << "])." << '\n' << '\n';
 
   f_types_file_ << f_info_.str();
-  f_types_file_ << "struct_info(_) -> erlang:error(function_clause)." << endl << endl;
+  f_types_file_ << "struct_info(_) -> erlang:error(function_clause)." << '\n' << '\n';
 
   f_types_file_ << f_info_ext_.str();
-  f_types_file_ << "struct_info_ext(_) -> erlang:error(function_clause)." << endl << endl;
+  f_types_file_ << "struct_info_ext(_) -> erlang:error(function_clause)." << '\n' << '\n';
 
   generate_const_functions();
 
@@ -527,10 +525,10 @@
     string name = (*c_iter)->get_name();
     indent(f_types_hrl_file_) << "-define(" << constify(make_safe_for_module_name(program_name_))
                               << "_" << constify(tenum->get_name()) << "_" << constify(name) << ", "
-                              << value << ")." << endl;
+                              << value << ")." << '\n';
   }
 
-  f_types_hrl_file_ << endl;
+  f_types_hrl_file_ << '\n';
 }
 
 void t_erl_generator::generate_enum_info(t_enum* tenum){
@@ -551,7 +549,7 @@
     }
     indent_down();
   }
-  f_types_file_ << "\n";
+  f_types_file_ << '\n';
   indent(f_types_file_) << "];\n\n";
   indent_down();
 }
@@ -579,7 +577,7 @@
   v_consts_.push_back(tconst);
 
   f_consts_hrl_file_ << "-define(" << constify(make_safe_for_module_name(program_name_)) << "_"
-                     << constify(name) << ", " << render_const_value(type, value) << ")." << endl << endl;
+                     << constify(name) << ", " << render_const_value(type, value) << ")." << '\n' << '\n';
 }
 
 /**
@@ -809,7 +807,7 @@
  * @param tstruct The struct definition
  */
 void t_erl_generator::generate_erl_struct_definition(ostream& out, t_struct* tstruct) {
-  indent(out) << "%% struct " << type_name(tstruct) << endl << endl;
+  indent(out) << "%% struct " << type_name(tstruct) << '\n' << '\n';
 
   std::stringstream buf;
   buf << indent() << "-record(" << type_name(tstruct) << ", {";
@@ -819,13 +817,13 @@
   for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();) {
     generate_erl_struct_member(buf, *m_iter);
     if (++m_iter != members.end()) {
-      buf << "," << endl << field_indent;
+      buf << "," << '\n' << field_indent;
     }
   }
   buf << "}).";
 
-  out << buf.str() << endl;
-  out << "-type " + type_name(tstruct) << "() :: #" + type_name(tstruct) + "{}." << endl << endl;
+  out << buf.str() << '\n';
+  out << "-type " + type_name(tstruct) << "() :: #" + type_name(tstruct) + "{}." << '\n' << '\n';
 }
 
 /**
@@ -871,19 +869,19 @@
  * Generates the read method for a struct
  */
 void t_erl_generator::generate_erl_struct_info(ostream& out, t_struct* tstruct) {
-  indent(out) << "struct_info(" << type_name(tstruct) << ") ->" << endl;
+  indent(out) << "struct_info(" << type_name(tstruct) << ") ->" << '\n';
   indent_up();
-  out << indent() << render_type_term(tstruct, true) << ";" << endl;
+  out << indent() << render_type_term(tstruct, true) << ";" << '\n';
   indent_down();
-  out << endl;
+  out << '\n';
 }
 
 void t_erl_generator::generate_erl_extended_struct_info(ostream& out, t_struct* tstruct) {
-  indent(out) << "struct_info_ext(" << type_name(tstruct) << ") ->" << endl;
+  indent(out) << "struct_info_ext(" << type_name(tstruct) << ") ->" << '\n';
   indent_up();
-  out << indent() << render_type_term(tstruct, true, true) << ";" << endl;
+  out << indent() << render_type_term(tstruct, true, true) << ";" << '\n';
   indent_down();
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -909,11 +907,11 @@
   if (tservice->get_extends() != nullptr) {
     f_service_hrl_ << "-include(\""
                    << make_safe_for_module_name(tservice->get_extends()->get_name())
-                   << "_thrift.hrl\"). % inherit " << endl;
+                   << "_thrift.hrl\"). % inherit " << '\n';
   }
 
   f_service_hrl_ << "-include(\"" << make_safe_for_module_name(program_name_) << "_types.hrl\")."
-                 << endl << endl;
+                 << '\n' << '\n';
 
   // Generate the three main parts of the service (well, two for now in PHP)
   generate_service_helpers(tservice); // cpiro: New Erlang Order
@@ -924,13 +922,13 @@
 
   // indent_down();
 
-  f_service_file_ << erl_autogen_comment() << endl << "-module(" << service_name_ << "_thrift)."
-                  << endl << "-behaviour(thrift_service)." << endl << endl << erl_imports() << endl;
+  f_service_file_ << erl_autogen_comment() << '\n' << "-module(" << service_name_ << "_thrift)."
+                  << '\n' << "-behaviour(thrift_service)." << '\n' << '\n' << erl_imports() << '\n';
 
   f_service_file_ << "-include(\"" << make_safe_for_module_name(tservice->get_name())
-                  << "_thrift.hrl\")." << endl << endl;
+                  << "_thrift.hrl\")." << '\n' << '\n';
 
-  f_service_file_ << "-export([" << export_lines_.str() << "])." << endl << endl;
+  f_service_file_ << "-export([" << export_lines_.str() << "])." << '\n' << '\n';
 
   f_service_file_ << f_service_.str();
 
@@ -946,7 +944,7 @@
   vector<t_function*> functions = tservice->get_functions();
   size_t num_functions = functions.size();
 
-  indent(f_service_) << "function_names() -> " << endl;
+  indent(f_service_) << "function_names() -> " << '\n';
   indent_up();
   indent(f_service_) << "[";
 
@@ -972,14 +970,14 @@
   vector<t_function*>::iterator f_iter;
 
   //  indent(f_service_) <<
-  //  "% HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+  //  "% HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
 
   export_string("struct_info", 1);
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_erl_function_helpers(*f_iter);
   }
-  f_service_ << "struct_info(_) -> erlang:error(function_clause)." << endl;
+  f_service_ << "struct_info(_) -> erlang:error(function_clause)." << '\n';
 }
 
 /**
@@ -1002,26 +1000,26 @@
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
-  f_service_ << "%%% interface" << endl;
+  f_service_ << "%%% interface" << '\n';
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "% " << function_signature(*f_iter) << endl;
+    f_service_ << indent() << "% " << function_signature(*f_iter) << '\n';
 
     generate_function_info(tservice, *f_iter);
   }
 
   // Inheritance - pass unknown functions to base class
   if (tservice->get_extends() != nullptr) {
-    indent(f_service_) << "function_info(Function, InfoType) ->" << endl;
+    indent(f_service_) << "function_info(Function, InfoType) ->" << '\n';
     indent_up();
     indent(f_service_) << make_safe_for_module_name(tservice->get_extends()->get_name())
-                       << "_thrift:function_info(Function, InfoType)." << endl;
+                       << "_thrift:function_info(Function, InfoType)." << '\n';
     indent_down();
   } else {
     // return function_clause error for non-existent functions
-    indent(f_service_) << "function_info(_Func, _Info) -> erlang:error(function_clause)." << endl;
+    indent(f_service_) << "function_info(_Func, _Info) -> erlang:error(function_clause)." << '\n';
   }
 
-  indent(f_service_) << endl;
+  indent(f_service_) << '\n';
 }
 
 /**
@@ -1036,30 +1034,30 @@
   t_struct* arg_struct = tfunction->get_arglist();
 
   // function_info(Function, params_type):
-  indent(f_service_) << "function_info(" << name_atom << ", params_type) ->" << endl;
+  indent(f_service_) << "function_info(" << name_atom << ", params_type) ->" << '\n';
   indent_up();
 
-  indent(f_service_) << render_type_term(arg_struct, true) << ";" << endl;
+  indent(f_service_) << render_type_term(arg_struct, true) << ";" << '\n';
 
   indent_down();
 
   // function_info(Function, reply_type):
-  indent(f_service_) << "function_info(" << name_atom << ", reply_type) ->" << endl;
+  indent(f_service_) << "function_info(" << name_atom << ", reply_type) ->" << '\n';
   indent_up();
 
   if (!tfunction->get_returntype()->is_void())
-    indent(f_service_) << render_type_term(tfunction->get_returntype(), false) << ";" << endl;
+    indent(f_service_) << render_type_term(tfunction->get_returntype(), false) << ";" << '\n';
   else if (tfunction->is_oneway())
-    indent(f_service_) << "oneway_void;" << endl;
+    indent(f_service_) << "oneway_void;" << '\n';
   else
     indent(f_service_) << "{struct, []}"
-                       << ";" << endl;
+                       << ";" << '\n';
   indent_down();
 
   // function_info(Function, exceptions):
-  indent(f_service_) << "function_info(" << name_atom << ", exceptions) ->" << endl;
+  indent(f_service_) << "function_info(" << name_atom << ", exceptions) ->" << '\n';
   indent_up();
-  indent(f_service_) << render_type_term(xs, true) << ";" << endl;
+  indent(f_service_) << render_type_term(xs, true) << ";" << '\n';
   indent_down();
 }
 
@@ -1246,11 +1244,11 @@
         }
 
         if (++i != end) {
-          buf << "," << endl << field_indent;
+          buf << "," << '\n' << field_indent;
         }
       }
 
-      buf << "]}" << endl;
+      buf << "]}" << '\n';
       return buf.str();
     } else {
       return "{struct, {" + atomify(type_module(type)) + ", " + type_name(type) + "}}";
diff --git a/compiler/cpp/src/thrift/generate/t_generator.cc b/compiler/cpp/src/thrift/generate/t_generator.cc
index 970281e..6860237 100644
--- a/compiler/cpp/src/thrift/generate/t_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_generator.cc
@@ -77,8 +77,8 @@
 }
 
 std::set<std::string> t_generator::lang_keywords_for_validation() const {
-  // Nothing by default. It makes no sense to restrict the whole world to use non-PHP keywords only. 
-  // Override on a per-generator(!) basis if you cannot live without it, e.g. that particular language has no 
+  // Nothing by default. It makes no sense to restrict the whole world to use non-PHP keywords only.
+  // Override on a per-generator(!) basis if you cannot live without it, e.g. that particular language has no
   // mechanism or way to deal with it properly, so we absolutely need to fail on it as the last possible resort.
   return {};
 }
@@ -172,11 +172,11 @@
     docs.getline(line, 1024);
 
     if (strlen(line) > 0) {
-      indent(out) << line_prefix << line << std::endl;
+      indent(out) << line_prefix << line << '\n';
     } else if (line_prefix.empty()){
-      out << std::endl;
+      out << '\n';
     } else if(!docs.eof()) {
-      indent(out) << line_prefix << std::endl;
+      indent(out) << line_prefix << '\n';
     }
   }
   if (!comment_end.empty())
diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.cc b/compiler/cpp/src/thrift/generate/t_go_generator.cc
index db30c8b..72a9f06 100644
--- a/compiler/cpp/src/thrift/generate/t_go_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_go_generator.cc
@@ -518,7 +518,7 @@
 
   f_consts_ << go_autogen_comment() << go_package() << render_includes(true);
 
-  f_const_values_ << endl << "func init() {" << endl;
+  f_const_values_ << '\n' << "func init() {" << '\n';
 
   // Create file for the GoUnusedProtection__ variable
   string f_unused_prot_name_ = package_dir_ + "/" + "GoUnusedProtection__.go";
@@ -744,7 +744,7 @@
  * Closes the type files
  */
 void t_go_generator::close_generator() {
-  f_const_values_ << "}" << endl << endl;
+  f_const_values_ << "}" << '\n' << '\n';
   f_consts_ << f_const_values_.str();
 
   // Close types and constants files
@@ -768,11 +768,11 @@
     return;
   }
 
-  f_types_ << "type " << new_type_name << " " << base_type << endl << endl;
+  f_types_ << "type " << new_type_name << " " << base_type << '\n' << '\n';
   // Generate a convenience function that converts an instance of a type
   // (which may be a constant) into a pointer to an instance of a type.
   f_types_ << "func " << new_type_name << "Ptr(v " << new_type_name << ") *" << new_type_name
-           << " { return &v }" << endl << endl;
+           << " { return &v }" << '\n' << '\n';
 }
 
 /**
@@ -785,14 +785,14 @@
   std::ostringstream to_string_mapping, from_string_mapping;
   std::string tenum_name(publicize(tenum->get_name()));
   generate_go_docstring(f_types_, tenum);
-  f_types_ << "type " << tenum_name << " int64" << endl << "const (" << endl;
+  f_types_ << "type " << tenum_name << " int64" << '\n' << "const (" << '\n';
 
-  to_string_mapping << indent() << "func (p " << tenum_name << ") String() string {" << endl;
-  to_string_mapping << indent() << "  switch p {" << endl;
+  to_string_mapping << indent() << "func (p " << tenum_name << ") String() string {" << '\n';
+  to_string_mapping << indent() << "  switch p {" << '\n';
 
   from_string_mapping << indent() << "func " << tenum_name << "FromString(s string) (" << tenum_name
-                      << ", error) {" << endl;
-  from_string_mapping << indent() << "  switch s {" << endl;
+                      << ", error) {" << '\n';
+  from_string_mapping << indent() << "  switch s {" << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
@@ -804,68 +804,68 @@
     string iter_std_name(escape_string((*c_iter)->get_name()));
     string iter_name((*c_iter)->get_name());
     f_types_ << indent() << "  " << tenum_name << "_" << iter_name << ' ' << tenum_name << " = "
-             << value << endl;
+             << value << '\n';
     // Dictionaries to/from string names of enums
     to_string_mapping << indent() << "  case " << tenum_name << "_" << iter_name << ": return \""
-                      << iter_std_name << "\"" << endl;
+                      << iter_std_name << "\"" << '\n';
 
     if (iter_std_name != escape_string(iter_name)) {
       from_string_mapping << indent() << "  case \"" << iter_std_name << "\", \""
                           << escape_string(iter_name) << "\": return " << tenum_name << "_"
-                          << iter_name << ", nil " << endl;
+                          << iter_name << ", nil " << '\n';
     } else {
       from_string_mapping << indent() << "  case \"" << iter_std_name << "\": return " << tenum_name
-                          << "_" << iter_name << ", nil " << endl;
+                          << "_" << iter_name << ", nil " << '\n';
     }
   }
 
-  to_string_mapping << indent() << "  }" << endl;
-  to_string_mapping << indent() << "  return \"<UNSET>\"" << endl;
-  to_string_mapping << indent() << "}" << endl;
-  from_string_mapping << indent() << "  }" << endl;
+  to_string_mapping << indent() << "  }" << '\n';
+  to_string_mapping << indent() << "  return \"<UNSET>\"" << '\n';
+  to_string_mapping << indent() << "}" << '\n';
+  from_string_mapping << indent() << "  }" << '\n';
   from_string_mapping << indent() << "  return " << tenum_name << "(0),"
-                      << " fmt.Errorf(\"not a valid " << tenum_name << " string\")" << endl;
-  from_string_mapping << indent() << "}" << endl;
+                      << " fmt.Errorf(\"not a valid " << tenum_name << " string\")" << '\n';
+  from_string_mapping << indent() << "}" << '\n';
 
-  f_types_ << ")" << endl << endl << to_string_mapping.str() << endl << from_string_mapping.str()
-           << endl << endl;
+  f_types_ << ")" << '\n' << '\n' << to_string_mapping.str() << '\n' << from_string_mapping.str()
+           << '\n' << '\n';
 
   // Generate a convenience function that converts an instance of an enum
   // (which may be a constant) into a pointer to an instance of that enum
   // type.
   f_types_ << "func " << tenum_name << "Ptr(v " << tenum_name << ") *" << tenum_name
-           << " { return &v }" << endl << endl;
+           << " { return &v }" << '\n' << '\n';
 
   // Generate MarshalText
-  f_types_ << "func (p " << tenum_name << ") MarshalText() ([]byte, error) {" << endl;
-  f_types_ << "return []byte(p.String()), nil" << endl;
-  f_types_ << "}" << endl << endl;
+  f_types_ << "func (p " << tenum_name << ") MarshalText() ([]byte, error) {" << '\n';
+  f_types_ << "return []byte(p.String()), nil" << '\n';
+  f_types_ << "}" << '\n' << '\n';
 
   // Generate UnmarshalText
-  f_types_ << "func (p *" << tenum_name << ") UnmarshalText(text []byte) error {" << endl;
-  f_types_ << "q, err := " << tenum_name << "FromString(string(text))" << endl;
-  f_types_ << "if (err != nil) {" << endl << "return err" << endl << "}" << endl;
-  f_types_ << "*p = q" << endl;
-  f_types_ << "return nil" << endl;
-  f_types_ << "}" << endl << endl;
+  f_types_ << "func (p *" << tenum_name << ") UnmarshalText(text []byte) error {" << '\n';
+  f_types_ << "q, err := " << tenum_name << "FromString(string(text))" << '\n';
+  f_types_ << "if (err != nil) {" << '\n' << "return err" << '\n' << "}" << '\n';
+  f_types_ << "*p = q" << '\n';
+  f_types_ << "return nil" << '\n';
+  f_types_ << "}" << '\n' << '\n';
 
   // Generate Scan for sql.Scanner interface
-  f_types_ << "func (p *" << tenum_name << ") Scan(value interface{}) error {" <<endl;
-  f_types_ << "v, ok := value.(int64)" <<endl;
-  f_types_ << "if !ok {" <<endl;
-  f_types_ << "return errors.New(\"Scan value is not int64\")" <<endl;
-  f_types_ << "}" <<endl;
-  f_types_ << "*p = " << tenum_name << "(v)" << endl;
-  f_types_ << "return nil" << endl;
-  f_types_ << "}" << endl << endl;
+  f_types_ << "func (p *" << tenum_name << ") Scan(value interface{}) error {" << '\n';
+  f_types_ << "v, ok := value.(int64)" << '\n';
+  f_types_ << "if !ok {" << '\n';
+  f_types_ << "return errors.New(\"Scan value is not int64\")" << '\n';
+  f_types_ << "}" << '\n';
+  f_types_ << "*p = " << tenum_name << "(v)" << '\n';
+  f_types_ << "return nil" << '\n';
+  f_types_ << "}" << '\n' << '\n';
 
   // Generate Value for driver.Valuer interface
-  f_types_ << "func (p * " << tenum_name << ") Value() (driver.Value, error) {" <<endl;
-  f_types_ << "  if p == nil {" << endl;
-  f_types_ << "    return nil, nil" << endl;
-  f_types_ << "  }" << endl;
-  f_types_ << "return int64(*p), nil" << endl;
-  f_types_ << "}" << endl;
+  f_types_ << "func (p * " << tenum_name << ") Value() (driver.Value, error) {" << '\n';
+  f_types_ << "  if p == nil {" << '\n';
+  f_types_ << "    return nil, nil" << '\n';
+  f_types_ << "  }" << '\n';
+  f_types_ << "return int64(*p), nil" << '\n';
+  f_types_ << "}" << '\n';
 
 }
 
@@ -877,12 +877,12 @@
   string name = publicize(tconst->get_name());
   t_const_value* value = tconst->get_value();
   if (type->is_enum() || (type->is_base_type() && ((t_base_type*)type)->get_base() != t_base_type::TYPE_UUID)) {
-    indent(f_consts_) << "const " << name << " = " << render_const_value(type, value, name) << endl;
+    indent(f_consts_) << "const " << name << " = " << render_const_value(type, value, name) << '\n';
   } else {
-    f_const_values_ << indent() << name << " = " << render_const_value(type, value, name) << endl
-                    << endl;
+    f_const_values_ << indent() << name << " = " << render_const_value(type, value, name) << '\n'
+                    << '\n';
 
-    f_consts_ << indent() << "var " << name << " " << type_to_go_type(type) << endl;
+    f_consts_ << indent() << "var " << name << " " << type_to_go_type(type) << '\n';
   }
 }
 
@@ -1079,8 +1079,8 @@
       if (field_type == nullptr) {
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
-      out << endl << indent() << publicize(v_iter->first->get_string()) << ": "
-          << render_const_value(field_type, v_iter->second, name, is_optional) << "," << endl;
+      out << '\n' << indent() << publicize(v_iter->first->get_string()) << ": "
+          << render_const_value(field_type, v_iter->second, name, is_optional) << "," << '\n';
     }
 
     indent_down();
@@ -1090,13 +1090,13 @@
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
-    out << "map[" << type_to_go_key_type(ktype) << "]" << type_to_go_type(vtype) << "{" << endl;
+    out << "map[" << type_to_go_key_type(ktype) << "]" << type_to_go_type(vtype) << "{" << '\n';
     indent_up();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
 
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       out << indent() << render_const_value(ktype, v_iter->first, name) << ": "
-          << render_const_value(vtype, v_iter->second, name) << "," << endl;
+          << render_const_value(vtype, v_iter->second, name) << "," << '\n';
     }
 
     indent_down();
@@ -1104,7 +1104,7 @@
   } else if (type->is_list()) {
     t_type* etype = ((t_list*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
-    out << "[]" << type_to_go_type(etype) << "{" << endl;
+    out << "[]" << type_to_go_type(etype) << "{" << '\n';
     indent_up();
     vector<t_const_value*>::const_iterator v_iter;
 
@@ -1117,7 +1117,7 @@
   } else if (type->is_set()) {
     t_type* etype = ((t_set*)type)->get_elem_type();
     const vector<t_const_value*>& val = value->get_list();
-    out << "[]" << type_to_go_type(etype) << "{" << endl;
+    out << "[]" << type_to_go_type(etype) << "{" << '\n';
     indent_up();
     vector<t_const_value*>::const_iterator v_iter;
 
@@ -1158,12 +1158,12 @@
   generate_go_struct_definition(f_types_, tstruct, is_exception);
   // generate Validate function
   std::string tstruct_name(publicize(tstruct->get_name(), false));
-  f_types_ << "func (p *" << tstruct_name << ") Validate() error {" << endl;
+  f_types_ << "func (p *" << tstruct_name << ") Validate() error {" << '\n';
   indent_up();
   go_validator_generator(this).generate_struct_validator(f_types_, tstruct);
-  f_types_ << indent() << "return nil" << endl;
+  f_types_ << indent() << "return nil" << '\n';
   indent_down();
-  f_types_ << "}" << endl;
+  f_types_ << "}" << '\n';
 }
 
 void t_go_generator::get_publicized_name_and_def_value(t_field* tfield,
@@ -1186,13 +1186,13 @@
     t_const_value* def_value;
     get_publicized_name_and_def_value(member, &publicized_name, &def_value);
     if (!pointer_field && def_value != nullptr && !omit_initialization(member)) {
-      out << endl << indent() << publicized_name << ": "
+      out << '\n' << indent() << publicized_name << ": "
           << render_field_initial_value(member, member->get_name(), pointer_field) << ","
-          << endl;
+          << '\n';
     }
   }
 
-  out << "}" << endl;
+  out << "}" << '\n';
 }
 
 /**
@@ -1211,7 +1211,7 @@
 
   std::string tstruct_name(publicize(tstruct->get_name(), is_args || is_result));
   generate_go_docstring(out, tstruct);
-  out << indent() << "type " << tstruct_name << " struct {" << endl;
+  out << indent() << "type " << tstruct_name << " struct {" << '\n';
   /*
      Here we generate the structure specification for the fastbinary codec.
      These specifications have the following structure:
@@ -1253,9 +1253,9 @@
         }
         int last_unused = sorted_keys_pos - 1;
         if (first_unused < last_unused) {
-          indent(out) << "// unused fields # " << first_unused << " to " << last_unused << endl;
+          indent(out) << "// unused fields # " << first_unused << " to " << last_unused << '\n';
         } else if (first_unused == last_unused) {
-          indent(out) << "// unused field # " << first_unused << endl;
+          indent(out) << "// unused field # " << first_unused << '\n';
         }
       }
 
@@ -1296,25 +1296,25 @@
         out << ",required";
       }
 
-      out << "\" " << gotag << "`" << endl;
+      out << "\" " << gotag << "`" << '\n';
       sorted_keys_pos++;
     }
   } else {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       // This fills in default values, as opposed to nulls
       out << indent() << publicize((*m_iter)->get_name()) << " "
-          << type_to_go_type((*m_iter)->get_type()) << endl;
+          << type_to_go_type((*m_iter)->get_type()) << '\n';
     }
   }
 
   indent_down();
-  out << indent() << "}" << endl << endl;
-  out << indent() << "func New" << tstruct_name << "() *" << tstruct_name << " {" << endl;
+  out << indent() << "}" << '\n' << '\n';
+  out << indent() << "func New" << tstruct_name << "() *" << tstruct_name << " {" << '\n';
   indent_up();
   out << indent() << "return &";
   generate_go_struct_initializer(out, tstruct, is_result || is_args);
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
   // Default values for optional fields
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     string publicized_name;
@@ -1328,7 +1328,7 @@
       if (def_value != nullptr) {
         out << " = " << render_const_value(fieldType, def_value, (*m_iter)->get_name());
       }
-      out << endl;
+      out << '\n';
     }
 
     // num_setable is used for deciding if Count* methods will be generated for union fields.
@@ -1342,24 +1342,24 @@
       string goOptType = type_to_go_type_with_opt(fieldType, true);
       string maybepointer = goOptType != goType ? "*" : "";
       out << indent() << "func (p *" << tstruct_name << ") Get" << publicized_name << "() "
-          << goType << " {" << endl;
+          << goType << " {" << '\n';
       indent_up();
-      out << indent() << "if !p.IsSet" << publicized_name << "() {" << endl;
+      out << indent() << "if !p.IsSet" << publicized_name << "() {" << '\n';
       indent_up();
-      out << indent() << "return " << def_var_name << endl;
+      out << indent() << "return " << def_var_name << '\n';
       indent_down();
-      out << indent() << "}" << endl;
-      out << indent() << "return " << maybepointer << "p." << publicized_name << endl;
+      out << indent() << "}" << '\n';
+      out << indent() << "return " << maybepointer << "p." << publicized_name << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else {
-      out << endl;
+      out << '\n';
       out << indent() << "func (p *" << tstruct_name << ") Get" << publicized_name << "() "
-          << goType << " {" << endl;
+          << goType << " {" << '\n';
       indent_up();
-      out << indent() << "return p." << publicized_name << endl;
+      out << indent() << "return p." << publicized_name << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
   }
 
@@ -1374,57 +1374,57 @@
     generate_go_struct_equals(out, tstruct, tstruct_name);
   }
 
-  out << indent() << "func (p *" << tstruct_name << ") String() string {" << endl;
+  out << indent() << "func (p *" << tstruct_name << ") String() string {" << '\n';
   indent_up();
-  out << indent() << "if p == nil {" << endl;
+  out << indent() << "if p == nil {" << '\n';
   indent_up();
-  out << indent() << "return \"<nil>\"" << endl;
+  out << indent() << "return \"<nil>\"" << '\n';
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
   out << indent() << "return fmt.Sprintf(\"" << escape_string(tstruct_name) << "(%+v)\", *p)"
-      << endl;
+      << '\n';
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 
   if (is_exception) {
-    out << indent() << "func (p *" << tstruct_name << ") Error() string {" << endl;
+    out << indent() << "func (p *" << tstruct_name << ") Error() string {" << '\n';
     indent_up();
-    out << indent() << "return p.String()" << endl;
+    out << indent() << "return p.String()" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
-    out << indent() << "func (" << tstruct_name << ") TExceptionType() thrift.TExceptionType {" << endl;
+    out << indent() << "func (" << tstruct_name << ") TExceptionType() thrift.TExceptionType {" << '\n';
     indent_up();
-    out << indent() << "return thrift.TExceptionTypeCompiled" << endl;
+    out << indent() << "return thrift.TExceptionTypeCompiled" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     out << indent() << "var _ thrift.TException = (*" << tstruct_name << ")(nil)"
-        << endl << endl;
+        << '\n' << '\n';
   }
 
   if (!read_write_private_) {
     // Generate the implementation of slog.LogValuer,
     // see: https://issues.apache.org/jira/browse/THRIFT-5745
-    out << indent() << "func (p *" << tstruct_name << ") LogValue() slog.Value {" << endl;
+    out << indent() << "func (p *" << tstruct_name << ") LogValue() slog.Value {" << '\n';
     indent_up();
-    out << indent() << "if p == nil {" << endl;
+    out << indent() << "if p == nil {" << '\n';
     indent_up();
-    out << indent() << "return slog.AnyValue(nil)" << endl;
+    out << indent() << "return slog.AnyValue(nil)" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "v := thrift.SlogTStructWrapper{" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "v := thrift.SlogTStructWrapper{" << '\n';
     indent_up();
-    out << indent() << "Type: \"*" << package_name_ << "." << tstruct_name << "\"," << endl;
-    out << indent() << "Value: p," << endl;
+    out << indent() << "Type: \"*" << package_name_ << "." << tstruct_name << "\"," << '\n';
+    out << indent() << "Value: p," << '\n';
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "return slog.AnyValue(v)" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "return slog.AnyValue(v)" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     out << indent() << "var _ slog.LogValuer = (*" << tstruct_name << ")(nil)"
-        << endl << endl;
+        << '\n' << '\n';
   }
 }
 
@@ -1444,25 +1444,25 @@
     const string field_name(publicize(escape_string((*f_iter)->get_name())));
     if ((*f_iter)->get_req() == t_field::T_OPTIONAL || is_pointer_field(*f_iter)) {
       out << indent() << "func (p *" << tstruct_name << ") IsSet" << field_name << "() bool {"
-          << endl;
+          << '\n';
       indent_up();
       t_type* ttype = (*f_iter)->get_type()->get_true_type();
       bool is_byteslice = ttype->is_binary();
       bool compare_to_nil_only = ttype->is_set() || ttype->is_list() || ttype->is_map()
                                  || (is_byteslice && !(*f_iter)->get_value());
       if (is_pointer_field(*f_iter) || compare_to_nil_only) {
-        out << indent() << "return p." << field_name << " != nil" << endl;
+        out << indent() << "return p." << field_name << " != nil" << '\n';
       } else {
         string def_var_name = tstruct_name + "_" + field_name + "_DEFAULT";
         if (is_byteslice) {
           out << indent() << "return !bytes.Equal(p." << field_name << ", " << def_var_name << ")"
-              << endl;
+              << '\n';
         } else {
-          out << indent() << "return p." << field_name << " != " << def_var_name << endl;
+          out << indent() << "return p." << field_name << " != " << def_var_name << '\n';
         }
       }
       indent_down();
-      out << indent() << "}" << endl << endl;
+      out << indent() << "}" << '\n' << '\n';
     }
   }
 }
@@ -1480,9 +1480,9 @@
   const string escaped_tstruct_name(escape_string(tstruct->get_name()));
 
   out << indent() << "func (p *" << tstruct_name << ") CountSetFields" << tstruct_name << "() int {"
-      << endl;
+      << '\n';
   indent_up();
-  out << indent() << "count := 0" << endl;
+  out << indent() << "count := 0" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED)
       continue;
@@ -1494,16 +1494,16 @@
 
     const string field_name(publicize(escape_string((*f_iter)->get_name())));
 
-    out << indent() << "if (p.IsSet" << field_name << "()) {" << endl;
+    out << indent() << "if (p.IsSet" << field_name << "()) {" << '\n';
     indent_up();
-    out << indent() << "count++" << endl;
+    out << indent() << "count++" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
 
-  out << indent() << "return count" << endl << endl;
+  out << indent() << "return count" << '\n' << '\n';
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1518,33 +1518,33 @@
   vector<t_field*>::const_iterator f_iter;
   string escaped_tstruct_name(escape_string(tstruct->get_name()));
   out << indent() << "func (p *" << tstruct_name << ") " << read_method_name_ << "(ctx context.Context, iprot thrift.TProtocol) error {"
-      << endl;
+      << '\n';
   indent_up();
-  out << indent() << "if _, err := iprot.ReadStructBegin(ctx); err != nil {" << endl;
+  out << indent() << "if _, err := iprot.ReadStructBegin(ctx); err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T read error: \", p), err)"
-      << endl;
-  out << indent() << "}" << endl << endl;
+      << '\n';
+  out << indent() << "}" << '\n' << '\n';
 
   // Required variables does not have IsSet functions, so we need tmp vars to check them.
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      indent(out) << "var isset" << field_name << " bool = false;" << endl;
+      indent(out) << "var isset" << field_name << " bool = false;" << '\n';
     }
   }
-  out << endl;
+  out << '\n';
 
   // Loop over reading in fields
-  indent(out) << "for {" << endl;
+  indent(out) << "for {" << '\n';
   indent_up();
   // Read beginning field marker
-  out << indent() << "_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)" << endl;
-  out << indent() << "if err != nil {" << endl;
+  out << indent() << "_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)" << '\n';
+  out << indent() << "if err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T field %d read error: \", p, fieldId), err)" << endl;
-  out << indent() << "}" << endl;
+                     "\"%T field %d read error: \", p, fieldId), err)" << '\n';
+  out << indent() << "}" << '\n';
   // Check for field STOP marker and break
-  out << indent() << "if fieldTypeId == thrift.STOP { break; }" << endl;
+  out << indent() << "if fieldTypeId == thrift.STOP { break; }" << '\n';
 
   string thriftFieldTypeId;
   // Generate deserialization code for known cases
@@ -1553,7 +1553,7 @@
   // Switch statement on the field we are reading, false if no fields present
   bool have_switch = !fields.empty();
   if (have_switch) {
-    indent(out) << "switch fieldId {" << endl;
+    indent(out) << "switch fieldId {" << '\n';
   }
 
   // All the fields we know
@@ -1569,7 +1569,7 @@
       field_method_suffix *= -1;
     }
 
-    out << indent() << "case " << field_id << ":" << endl;
+    out << indent() << "case " << field_id << ":" << '\n';
     indent_up();
     thriftFieldTypeId = type_to_enum((*f_iter)->get_type());
 
@@ -1577,23 +1577,23 @@
       thriftFieldTypeId = "thrift.STRING";
     }
 
-    out << indent() << "if fieldTypeId == " << thriftFieldTypeId << " {" << endl;
+    out << indent() << "if fieldTypeId == " << thriftFieldTypeId << " {" << '\n';
     out << indent() << "  if err := p." << field_method_prefix << field_method_suffix << "(ctx, iprot); err != nil {"
-        << endl;
-    out << indent() << "    return err" << endl;
-    out << indent() << "  }" << endl;
+        << '\n';
+    out << indent() << "    return err" << '\n';
+    out << indent() << "  }" << '\n';
 
     // Mark required field as read
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      out << indent() << "  isset" << field_name << " = true" << endl;
+      out << indent() << "  isset" << field_name << " = true" << '\n';
     }
 
-    out << indent() << "} else {" << endl;
-    out << indent() << "  if err := iprot.Skip(ctx, fieldTypeId); err != nil {" << endl;
-    out << indent() << "    return err" << endl;
-    out << indent() << "  }" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "} else {" << '\n';
+    out << indent() << "  if err := iprot.Skip(ctx, fieldTypeId); err != nil {" << '\n';
+    out << indent() << "    return err" << '\n';
+    out << indent() << "  }" << '\n';
+    out << indent() << "}" << '\n';
 
 
     indent_down();
@@ -1601,46 +1601,46 @@
 
   // Begin switch default case
   if (have_switch) {
-    out << indent() << "default:" << endl;
+    out << indent() << "default:" << '\n';
     indent_up();
   }
 
   // Skip unknown fields in either case
-  out << indent() << "if err := iprot.Skip(ctx, fieldTypeId); err != nil {" << endl;
-  out << indent() << "  return err" << endl;
-  out << indent() << "}" << endl;
+  out << indent() << "if err := iprot.Skip(ctx, fieldTypeId); err != nil {" << '\n';
+  out << indent() << "  return err" << '\n';
+  out << indent() << "}" << '\n';
 
   // End switch default case
   if (have_switch) {
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
 
   // Read field end marker
-  out << indent() << "if err := iprot.ReadFieldEnd(ctx); err != nil {" << endl;
-  out << indent() << "  return err" << endl;
-  out << indent() << "}" << endl;
+  out << indent() << "if err := iprot.ReadFieldEnd(ctx); err != nil {" << '\n';
+  out << indent() << "  return err" << '\n';
+  out << indent() << "}" << '\n';
   indent_down();
-  out << indent() << "}" << endl;
-  out << indent() << "if err := iprot.ReadStructEnd(ctx); err != nil {" << endl;
+  out << indent() << "}" << '\n';
+  out << indent() << "if err := iprot.ReadStructEnd(ctx); err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T read struct end error: \", p), err)" << endl;
-  out << indent() << "}" << endl;
+                     "\"%T read struct end error: \", p), err)" << '\n';
+  out << indent() << "}" << '\n';
 
   // Return error if any required fields are missing.
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      out << indent() << "if !isset" << field_name << "{" << endl;
+      out << indent() << "if !isset" << field_name << "{" << '\n';
       out << indent() << "  return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, "
-                         "fmt.Errorf(\"Required field " << field_name << " is not set\"));" << endl;
-      out << indent() << "}" << endl;
+                         "fmt.Errorf(\"Required field " << field_name << " is not set\"));" << '\n';
+      out << indent() << "}" << '\n';
     }
   }
 
-  out << indent() << "return nil" << endl;
+  out << indent() << "return nil" << '\n';
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     string field_type_name(publicize((*f_iter)->get_type()->get_name()));
@@ -1655,12 +1655,12 @@
     }
 
     out << indent() << "func (p *" << tstruct_name << ")  " << field_method_prefix << field_method_suffix
-        << "(ctx context.Context, iprot thrift.TProtocol) error {" << endl;
+        << "(ctx context.Context, iprot thrift.TProtocol) error {" << '\n';
     indent_up();
     generate_deserialize_field(out, *f_iter, false, "p.");
     indent_down();
-    out << indent() << "  return nil" << endl;
-    out << indent() << "}" << endl << endl;
+    out << indent() << "  return nil" << '\n';
+    out << indent() << "}" << '\n' << '\n';
   }
 }
 
@@ -1673,18 +1673,18 @@
   string name(tstruct->get_name());
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
-  indent(out) << "func (p *" << tstruct_name << ") " << write_method_name_ << "(ctx context.Context, oprot thrift.TProtocol) error {" << endl;
+  indent(out) << "func (p *" << tstruct_name << ") " << write_method_name_ << "(ctx context.Context, oprot thrift.TProtocol) error {" << '\n';
   indent_up();
   if (tstruct->is_union() && uses_countsetfields) {
     std::string tstruct_name(publicize(tstruct->get_name()));
-    out << indent() << "if c := p.CountSetFields" << tstruct_name << "(); c != 1 {" << endl
+    out << indent() << "if c := p.CountSetFields" << tstruct_name << "(); c != 1 {" << '\n'
         << indent()
         << "  return fmt.Errorf(\"%T write union: exactly one field must be set (%d set)\", p, c)"
-        << endl << indent() << "}" << endl;
+        << '\n' << indent() << "}" << '\n';
   }
-  out << indent() << "if err := oprot.WriteStructBegin(ctx, \"" << name << "\"); err != nil {" << endl;
+  out << indent() << "if err := oprot.WriteStructBegin(ctx, \"" << name << "\"); err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T write struct begin error: \", p), err) }" << endl;
+                     "\"%T write struct begin error: \", p), err) }" << '\n';
 
   string field_name;
   string escape_field_name;
@@ -1692,7 +1692,7 @@
   t_field::e_req field_required;
   int32_t field_id = -1;
 
-  out << indent() << "if p != nil {" << endl;
+  out << indent() << "if p != nil {" << '\n';
   indent_up();
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1708,20 +1708,20 @@
     }
 
     out << indent() << "if err := p." << field_method_prefix << field_method_suffix
-        << "(ctx, oprot); err != nil { return err }" << endl;
+        << "(ctx, oprot); err != nil { return err }" << '\n';
   }
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 
   // Write the struct map
-  out << indent() << "if err := oprot.WriteFieldStop(ctx); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(\"write field stop error: \", err) }" << endl;
-  out << indent() << "if err := oprot.WriteStructEnd(ctx); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(\"write struct stop error: \", err) }" << endl;
-  out << indent() << "return nil" << endl;
+  out << indent() << "if err := oprot.WriteFieldStop(ctx); err != nil {" << '\n';
+  out << indent() << "  return thrift.PrependError(\"write field stop error: \", err) }" << '\n';
+  out << indent() << "if err := oprot.WriteStructEnd(ctx); err != nil {" << '\n';
+  out << indent() << "  return thrift.PrependError(\"write struct stop error: \", err) }" << '\n';
+  out << indent() << "return nil" << '\n';
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     string field_method_prefix("writeField");
@@ -1738,35 +1738,35 @@
     }
 
     out << indent() << "func (p *" << tstruct_name << ") " << field_method_prefix << field_method_suffix
-        << "(ctx context.Context, oprot thrift.TProtocol) (err error) {" << endl;
+        << "(ctx context.Context, oprot thrift.TProtocol) (err error) {" << '\n';
     indent_up();
 
     if (field_required == t_field::T_OPTIONAL) {
-      out << indent() << "if p.IsSet" << publicize(field_name) << "() {" << endl;
+      out << indent() << "if p.IsSet" << publicize(field_name) << "() {" << '\n';
       indent_up();
     }
 
     out << indent() << "if err := oprot.WriteFieldBegin(ctx, \"" << escape_field_name << "\", "
-        << type_to_enum((*f_iter)->get_type()) << ", " << field_id << "); err != nil {" << endl;
+        << type_to_enum((*f_iter)->get_type()) << ", " << field_id << "); err != nil {" << '\n';
     out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T write field begin error "
-        << field_id << ":" << escape_field_name << ": \", p), err) }" << endl;
+        << field_id << ":" << escape_field_name << ": \", p), err) }" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "p.");
 
     // Write field closer
-    out << indent() << "if err := oprot.WriteFieldEnd(ctx); err != nil {" << endl;
+    out << indent() << "if err := oprot.WriteFieldEnd(ctx); err != nil {" << '\n';
     out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T write field end error "
-        << field_id << ":" << escape_field_name << ": \", p), err) }" << endl;
+        << field_id << ":" << escape_field_name << ": \", p), err) }" << '\n';
 
     if (field_required == t_field::T_OPTIONAL) {
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     }
 
     indent_down();
-    out << indent() << "  return err" << endl;
-    out << indent() << "}" << endl << endl;
+    out << indent() << "  return err" << '\n';
+    out << indent() << "}" << '\n' << '\n';
   }
 }
 
@@ -1777,20 +1777,20 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
   indent(out) << "func (p *" << tstruct_name << ") " << equals_method_name_ << "(other *"
-              << tstruct_name << ") bool {" << endl;
+              << tstruct_name << ") bool {" << '\n';
   indent_up();
 
   string field_name;
   string publicize_field_name;
-  out << indent() << "if p == other {" << endl;
+  out << indent() << "if p == other {" << '\n';
   indent_up();
-  out << indent() << "return true" << endl;
+  out << indent() << "return true" << '\n';
   indent_down();
-  out << indent() << "} else if p == nil || other == nil {" << endl;
+  out << indent() << "} else if p == nil || other == nil {" << '\n';
   indent_up();
-  out << indent() << "return false" << endl;
+  out << indent() << "return false" << '\n';
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     field_name = (*f_iter)->get_name();
@@ -1806,23 +1806,23 @@
         && (ttype->is_base_type() || ttype->is_enum() || ttype->is_container())) {
       string tgtv = "(*" + tgt + ")";
       string srcv = "(*" + src + ")";
-      out << indent() << "if " << tgt << " != " << src << " {" << endl;
+      out << indent() << "if " << tgt << " != " << src << " {" << '\n';
       indent_up();
-      out << indent() << "if " << tgt << " == nil || " << src << " == nil {" << endl;
+      out << indent() << "if " << tgt << " == nil || " << src << " == nil {" << '\n';
       indent_up();
-      out << indent() << "return false" << endl;
+      out << indent() << "return false" << '\n';
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
       generate_go_equals(out, field_type, tgtv, srcv);
       indent_down();
-      out << indent() << "}" << endl;
+      out << indent() << "}" << '\n';
     } else {
       generate_go_equals(out, field_type, tgt, src);
     }
   }
-  out << indent() << "return true" << endl;
+  out << indent() << "return true" << '\n';
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1842,7 +1842,7 @@
   if(!skip_remote_) {
     generate_service_remote(tservice);
   }
-  f_types_ << endl;
+  f_types_ << '\n';
 }
 
 /**
@@ -1853,7 +1853,7 @@
 void t_go_generator::generate_service_helpers(t_service* tservice) {
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
-  f_types_ << "// HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+  f_types_ << "// HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -1920,17 +1920,17 @@
   vector<t_function*> functions = tservice->get_functions();
 
   if (!functions.empty()) {
-    f_types_ << endl;
+    f_types_ << '\n';
     vector<t_function*>::iterator f_iter;
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       generate_go_docstring(f_types_, (*f_iter));
-      f_types_ << indent() << function_signature_if(*f_iter, "", true) << endl;
+      f_types_ << indent() << function_signature_if(*f_iter, "", true) << '\n';
     }
   }
 
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1963,23 +1963,23 @@
   extends_field = extends_client.substr(extends_client.find(".") + 1);
 
   generate_go_docstring(f_types_, tservice);
-  f_types_ << indent() << "type " << serviceName << "Client struct {" << endl;
+  f_types_ << indent() << "type " << serviceName << "Client struct {" << '\n';
   indent_up();
 
   if (!extends_client.empty()) {
-    f_types_ << indent() << "*" << extends_client << endl;
+    f_types_ << indent() << "*" << extends_client << '\n';
   } else {
-    f_types_ << indent() << "c thrift.TClient" << endl;
-    f_types_ << indent() << "meta thrift.ResponseMeta" << endl;
+    f_types_ << indent() << "c thrift.TClient" << '\n';
+    f_types_ << indent() << "meta thrift.ResponseMeta" << '\n';
   }
 
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
 
   // Legacy constructor function
   f_types_ << indent() << "func New" << serviceName
              << "ClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *" << serviceName
-             << "Client {" << endl;
+             << "Client {" << '\n';
   indent_up();
   f_types_ << indent() << "return &" << serviceName << "Client";
 
@@ -1987,72 +1987,72 @@
     f_types_ << "{" << extends_field << ": " << extends_client_new << "Factory(t, f)}";
   } else {
     indent_up();
-    f_types_ << "{" << endl;
-    f_types_ << indent() << "c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t))," << endl;
+    f_types_ << "{" << '\n';
+    f_types_ << indent() << "c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t))," << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
   }
 
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
   // Legacy constructor function with custom input & output protocols
   f_types_
       << indent() << "func New" << serviceName
       << "ClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *"
-      << serviceName << "Client {" << endl;
+      << serviceName << "Client {" << '\n';
   indent_up();
   f_types_ << indent() << "return &" << serviceName << "Client";
 
   if (!extends.empty()) {
     f_types_ << "{" << extends_field << ": " << extends_client_new << "Protocol(t, iprot, oprot)}"
-               << endl;
+               << '\n';
   } else {
     indent_up();
-    f_types_ << "{" << endl;
-    f_types_ << indent() << "c: thrift.NewTStandardClient(iprot, oprot)," << endl;
+    f_types_ << "{" << '\n';
+    f_types_ << indent() << "c: thrift.NewTStandardClient(iprot, oprot)," << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
   }
 
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
 
   // Constructor function
   f_types_ << indent() << "func New" << serviceName
-    << "Client(c thrift.TClient) *" << serviceName << "Client {" << endl;
+    << "Client(c thrift.TClient) *" << serviceName << "Client {" << '\n';
   indent_up();
-  f_types_ << indent() << "return &" << serviceName << "Client{" << endl;
+  f_types_ << indent() << "return &" << serviceName << "Client{" << '\n';
 
   indent_up();
   if (!extends.empty()) {
-    f_types_ << indent() << extends_field << ": " << extends_client_new << "(c)," << endl;
+    f_types_ << indent() << extends_field << ": " << extends_client_new << "(c)," << '\n';
   } else {
-    f_types_ << indent() << "c: c," << endl;
+    f_types_ << indent() << "c: c," << '\n';
   }
   indent_down();
-  f_types_ << indent() << "}" << endl;
+  f_types_ << indent() << "}" << '\n';
 
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
 
   if (extends.empty()) {
-    f_types_ << indent() << "func (p *" << serviceName << "Client) Client_() thrift.TClient {" << endl;
+    f_types_ << indent() << "func (p *" << serviceName << "Client) Client_() thrift.TClient {" << '\n';
     indent_up();
-    f_types_ << indent() << "return p.c" << endl;
+    f_types_ << indent() << "return p.c" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "}" << '\n' << '\n';
 
-    f_types_ << indent() << "func (p *" << serviceName << "Client) LastResponseMeta_() thrift.ResponseMeta {" << endl;
+    f_types_ << indent() << "func (p *" << serviceName << "Client) LastResponseMeta_() thrift.ResponseMeta {" << '\n';
     indent_up();
-    f_types_ << indent() << "return p.meta" << endl;
+    f_types_ << indent() << "return p.meta" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "}" << '\n' << '\n';
 
-    f_types_ << indent() << "func (p *" << serviceName << "Client) SetLastResponseMeta_(meta thrift.ResponseMeta) {" << endl;
+    f_types_ << indent() << "func (p *" << serviceName << "Client) SetLastResponseMeta_(meta thrift.ResponseMeta) {" << '\n';
     indent_up();
-    f_types_ << indent() << "p.meta = meta" << endl;
+    f_types_ << indent() << "p.meta = meta" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "}" << '\n' << '\n';
   }
 
   // Generate client method implementations
@@ -2067,59 +2067,59 @@
     // Open function
     generate_go_docstring(f_types_, (*f_iter));
     f_types_ << indent() << "func (p *" << serviceName << "Client) "
-               << function_signature_if(*f_iter, "", true) << " {" << endl;
+               << function_signature_if(*f_iter, "", true) << " {" << '\n';
     indent_up();
 
     std::string method = (*f_iter)->get_name();
     std::string argsType = publicize(method + "_args", true);
     std::string argsName = tmp("_args");
-    f_types_ << indent() << "var " << argsName << " " << argsType << endl;
+    f_types_ << indent() << "var " << argsName << " " << argsType << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_types_ << indent() << argsName << "." << publicize((*fld_iter)->get_name())
-               << " = " << variable_name_to_go_name((*fld_iter)->get_name()) << endl;
+               << " = " << variable_name_to_go_name((*fld_iter)->get_name()) << '\n';
     }
 
     if (!(*f_iter)->is_oneway()) {
       std::string metaName = tmp("_meta");
       std::string resultName = tmp("_result");
       std::string resultType = publicize(method + "_result", true);
-      f_types_ << indent() << "var " << resultName << " " << resultType << endl;
-      f_types_ << indent() << "var " << metaName << " thrift.ResponseMeta" << endl;
+      f_types_ << indent() << "var " << resultName << " " << resultType << '\n';
+      f_types_ << indent() << "var " << metaName << " thrift.ResponseMeta" << '\n';
       f_types_ << indent() << metaName << ", _err = p.Client_().Call(ctx, \""
-        << method << "\", &" << argsName << ", &" << resultName << ")" << endl;
-      f_types_ << indent() << "p.SetLastResponseMeta_(" << metaName << ")" << endl;
-      f_types_ << indent() << "if _err != nil {" << endl;
+        << method << "\", &" << argsName << ", &" << resultName << ")" << '\n';
+      f_types_ << indent() << "p.SetLastResponseMeta_(" << metaName << ")" << '\n';
+      f_types_ << indent() << "if _err != nil {" << '\n';
 
       indent_up();
-      f_types_ << indent() << "return" << endl;
+      f_types_ << indent() << "return" << '\n';
       indent_down();
-      f_types_ << indent() << "}" << endl;
+      f_types_ << indent() << "}" << '\n';
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
 
       if (!xceptions.empty()) {
-        f_types_ << indent() << "switch {" << endl;
+        f_types_ << indent() << "switch {" << '\n';
 
         for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
           const std::string pubname = publicize((*x_iter)->get_name());
           const std::string field = resultName + "." + pubname;
 
-          f_types_ << indent() << "case " << field << "!= nil:" << endl;
+          f_types_ << indent() << "case " << field << "!= nil:" << '\n';
           indent_up();
 
           if (!(*f_iter)->get_returntype()->is_void()) {
-            f_types_ << indent() << "return _r, " << field << endl;
+            f_types_ << indent() << "return _r, " << field << '\n';
           } else {
-            f_types_ << indent() << "return "<< field << endl;
+            f_types_ << indent() << "return "<< field << '\n';
           }
 
           indent_down();
         }
 
-        f_types_ << indent() << "}" << endl << endl;
+        f_types_ << indent() << "}" << '\n' << '\n';
       }
 
       if ((*f_iter)->get_returntype()->is_struct()) {
@@ -2130,37 +2130,37 @@
         // struct in go.
         std::string retName = tmp("_ret");
         f_types_ << indent() << "if " << retName << " := " << resultName
-                 << ".GetSuccess(); " << retName << " != nil {" << endl;
+                 << ".GetSuccess(); " << retName << " != nil {" << '\n';
         indent_up();
-        f_types_ << indent() << "return " << retName << ", nil" << endl;
+        f_types_ << indent() << "return " << retName << ", nil" << '\n';
         indent_down();
-        f_types_ << indent() << "}" << endl;
+        f_types_ << indent() << "}" << '\n';
         f_types_ << indent() << "return nil, "
                  << "thrift.NewTApplicationException(thrift.MISSING_RESULT, \""
-                 << method << " failed: unknown result\")" << endl;
+                 << method << " failed: unknown result\")" << '\n';
       } else if (!(*f_iter)->get_returntype()->is_void()) {
-        f_types_ << indent() << "return " << resultName << ".GetSuccess(), nil" << endl;
+        f_types_ << indent() << "return " << resultName << ".GetSuccess(), nil" << '\n';
       } else {
-        f_types_ << indent() << "return nil" << endl;
+        f_types_ << indent() << "return nil" << '\n';
       }
     } else {
       // Since we don't have response meta for oneway calls, overwrite it with
       // an empty one to avoid users getting the meta from last call and
       // mistaken it as from the oneway call.
-      f_types_ << indent() << "p.SetLastResponseMeta_(thrift.ResponseMeta{})" << endl;
+      f_types_ << indent() << "p.SetLastResponseMeta_(thrift.ResponseMeta{})" << '\n';
       // TODO: would be nice to not to duplicate the call generation
       f_types_ << indent() << "if _, err := p.Client_().Call(ctx, \""
-        << method << "\", &" << argsName << ", nil); err != nil {" << endl;
+        << method << "\", &" << argsName << ", nil); err != nil {" << '\n';
 
       indent_up();
-      f_types_ << indent() << "return err" << endl;
+      f_types_ << indent() << "return err" << '\n';
       indent_down();
-      f_types_ << indent() << "}" << endl;
-      f_types_ << indent() << "return nil" << endl;
+      f_types_ << indent() << "}" << '\n';
+      f_types_ << indent() << "return nil" << '\n';
     }
 
     indent_down();
-    f_types_ << "}" << endl << endl;
+    f_types_ << "}" << '\n' << '\n';
   }
 }
 
@@ -2223,21 +2223,21 @@
   system_packages.push_back("thrift \"" + gen_thrift_import_ + "\"");
 
   f_remote << go_autogen_comment();
-  f_remote << indent() << "package main" << endl << endl;
-  f_remote << indent() << "import (" << endl;
+  f_remote << indent() << "package main" << '\n' << '\n';
+  f_remote << indent() << "import (" << '\n';
   f_remote << render_system_packages(system_packages);
   f_remote << indent() << render_included_programs(unused_protection);
   f_remote << render_program_import(program_, unused_protection);
-  f_remote << indent() << ")" << endl;
-  f_remote << indent() << endl;
+  f_remote << indent() << ")" << '\n';
+  f_remote << indent() << '\n';
   f_remote << indent() << unused_protection; // filled in render_included_programs()
-  f_remote << indent() << endl;
-  f_remote << indent() << "func Usage() {" << endl;
+  f_remote << indent() << '\n';
+  f_remote << indent() << "func Usage() {" << '\n';
   f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Usage of \", os.Args[0], \" "
                           "[-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:\")"
-           << endl;
-  f_remote << indent() << "  flag.PrintDefaults()" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"\\nFunctions:\")" << endl;
+           << '\n';
+  f_remote << indent() << "  flag.PrintDefaults()" << '\n';
+  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"\\nFunctions:\")" << '\n';
 
   string package_name_aliased = package_identifiers_[get_real_go_module(program_)];
 
@@ -2259,143 +2259,143 @@
       f_remote << args[i]->get_type()->get_name() << " " << args[i]->get_name();
     }
 
-    f_remote << ")\")" << endl;
+    f_remote << ")\")" << '\n';
   }
 
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr)" << endl;
-  f_remote << indent() << "  os.Exit(0)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
+  f_remote << indent() << "  fmt.Fprintln(os.Stderr)" << '\n';
+  f_remote << indent() << "  os.Exit(0)" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << '\n';
 
-  f_remote << indent() << "type httpHeaders map[string]string" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "func (h httpHeaders) String() string {" << endl;
-  f_remote << indent() << "  var m map[string]string = h" << endl;
-  f_remote << indent() << "  return fmt.Sprintf(\"%s\", m)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "func (h httpHeaders) Set(value string) error {" << endl;
-  f_remote << indent() << "  parts := strings.Split(value, \": \")" << endl;
-  f_remote << indent() << "  if len(parts) != 2 {" << endl;
-  f_remote << indent() << "    return fmt.Errorf(\"header should be of format 'Key: Value'\")" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  h[parts[0]] = parts[1]" << endl;
-  f_remote << indent() << "  return nil" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
+  f_remote << indent() << "type httpHeaders map[string]string" << '\n';
+  f_remote << indent() << '\n';
+  f_remote << indent() << "func (h httpHeaders) String() string {" << '\n';
+  f_remote << indent() << "  var m map[string]string = h" << '\n';
+  f_remote << indent() << "  return fmt.Sprintf(\"%s\", m)" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << '\n';
+  f_remote << indent() << "func (h httpHeaders) Set(value string) error {" << '\n';
+  f_remote << indent() << "  parts := strings.Split(value, \": \")" << '\n';
+  f_remote << indent() << "  if len(parts) != 2 {" << '\n';
+  f_remote << indent() << "    return fmt.Errorf(\"header should be of format 'Key: Value'\")" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "  h[parts[0]] = parts[1]" << '\n';
+  f_remote << indent() << "  return nil" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << '\n';
 
-  f_remote << indent() << "func main() {" << endl;
+  f_remote << indent() << "func main() {" << '\n';
   indent_up();
-  f_remote << indent() << "flag.Usage = Usage" << endl;
-  f_remote << indent() << "var host string" << endl;
-  f_remote << indent() << "var port int" << endl;
-  f_remote << indent() << "var protocol string" << endl;
-  f_remote << indent() << "var urlString string" << endl;
-  f_remote << indent() << "var framed bool" << endl;
-  f_remote << indent() << "var useHttp bool" << endl;
-  f_remote << indent() << "headers := make(httpHeaders)" << endl;
-  f_remote << indent() << "var parsedUrl *url.URL" << endl;
-  f_remote << indent() << "var trans thrift.TTransport" << endl;
-  f_remote << indent() << "_ = strconv.Atoi" << endl;
-  f_remote << indent() << "_ = math.Abs" << endl;
-  f_remote << indent() << "flag.Usage = Usage" << endl;
+  f_remote << indent() << "flag.Usage = Usage" << '\n';
+  f_remote << indent() << "var host string" << '\n';
+  f_remote << indent() << "var port int" << '\n';
+  f_remote << indent() << "var protocol string" << '\n';
+  f_remote << indent() << "var urlString string" << '\n';
+  f_remote << indent() << "var framed bool" << '\n';
+  f_remote << indent() << "var useHttp bool" << '\n';
+  f_remote << indent() << "headers := make(httpHeaders)" << '\n';
+  f_remote << indent() << "var parsedUrl *url.URL" << '\n';
+  f_remote << indent() << "var trans thrift.TTransport" << '\n';
+  f_remote << indent() << "_ = strconv.Atoi" << '\n';
+  f_remote << indent() << "_ = math.Abs" << '\n';
+  f_remote << indent() << "flag.Usage = Usage" << '\n';
   f_remote << indent() << "flag.StringVar(&host, \"h\", \"localhost\", \"Specify host and port\")"
-           << endl;
-  f_remote << indent() << "flag.IntVar(&port, \"p\", 9090, \"Specify port\")" << endl;
+           << '\n';
+  f_remote << indent() << "flag.IntVar(&port, \"p\", 9090, \"Specify port\")" << '\n';
   f_remote << indent() << "flag.StringVar(&protocol, \"P\", \"binary\", \""
-                          "Specify the protocol (binary, compact, simplejson, json)\")" << endl;
-  f_remote << indent() << "flag.StringVar(&urlString, \"u\", \"\", \"Specify the url\")" << endl;
+                          "Specify the protocol (binary, compact, simplejson, json)\")" << '\n';
+  f_remote << indent() << "flag.StringVar(&urlString, \"u\", \"\", \"Specify the url\")" << '\n';
   f_remote << indent() << "flag.BoolVar(&framed, \"framed\", false, \"Use framed transport\")"
-           << endl;
-  f_remote << indent() << "flag.BoolVar(&useHttp, \"http\", false, \"Use http\")" << endl;
-  f_remote << indent() << "flag.Var(headers, \"H\", \"Headers to set on the http(s) request (e.g. -H \\\"Key: Value\\\")\")" << endl;
-  f_remote << indent() << "flag.Parse()" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "if len(urlString) > 0 {" << endl;
-  f_remote << indent() << "  var err error" << endl;
-  f_remote << indent() << "  parsedUrl, err = url.Parse(urlString)" << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << endl;
-  f_remote << indent() << "    flag.Usage()" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  host = parsedUrl.Host" << endl;
+           << '\n';
+  f_remote << indent() << "flag.BoolVar(&useHttp, \"http\", false, \"Use http\")" << '\n';
+  f_remote << indent() << "flag.Var(headers, \"H\", \"Headers to set on the http(s) request (e.g. -H \\\"Key: Value\\\")\")" << '\n';
+  f_remote << indent() << "flag.Parse()" << '\n';
+  f_remote << indent() << '\n';
+  f_remote << indent() << "if len(urlString) > 0 {" << '\n';
+  f_remote << indent() << "  var err error" << '\n';
+  f_remote << indent() << "  parsedUrl, err = url.Parse(urlString)" << '\n';
+  f_remote << indent() << "  if err != nil {" << '\n';
+  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << '\n';
+  f_remote << indent() << "    flag.Usage()" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "  host = parsedUrl.Host" << '\n';
   f_remote << indent() << "  useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == \"http\" || parsedUrl.Scheme == \"https\""
-           << endl;
-  f_remote << indent() << "} else if useHttp {" << endl;
+           << '\n';
+  f_remote << indent() << "} else if useHttp {" << '\n';
   f_remote << indent() << "  _, err := url.Parse(fmt.Sprint(\"http://\", host, \":\", port))"
-           << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << endl;
-  f_remote << indent() << "    flag.Usage()" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "cmd := flag.Arg(0)" << endl;
-  f_remote << indent() << "var err error" << endl;
-  f_remote << indent() << "var cfg *thrift.TConfiguration = nil" << endl;
-  f_remote << indent() << "if useHttp {" << endl;
-  f_remote << indent() << "  trans, err = thrift.NewTHttpClient(parsedUrl.String())" << endl;
-  f_remote << indent() << "  if len(headers) > 0 {" << endl;
-  f_remote << indent() << "    httptrans := trans.(*thrift.THttpClient)" << endl;
-  f_remote << indent() << "    for key, value := range headers {" << endl;
-  f_remote << indent() << "      httptrans.SetHeader(key, value)" << endl;
-  f_remote << indent() << "    }" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "} else {" << endl;
-  f_remote << indent() << "  portStr := fmt.Sprint(port)" << endl;
-  f_remote << indent() << "  if strings.Contains(host, \":\") {" << endl;
-  f_remote << indent() << "         host, portStr, err = net.SplitHostPort(host)" << endl;
-  f_remote << indent() << "         if err != nil {" << endl;
+           << '\n';
+  f_remote << indent() << "  if err != nil {" << '\n';
+  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << '\n';
+  f_remote << indent() << "    flag.Usage()" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << '\n';
+  f_remote << indent() << "cmd := flag.Arg(0)" << '\n';
+  f_remote << indent() << "var err error" << '\n';
+  f_remote << indent() << "var cfg *thrift.TConfiguration = nil" << '\n';
+  f_remote << indent() << "if useHttp {" << '\n';
+  f_remote << indent() << "  trans, err = thrift.NewTHttpClient(parsedUrl.String())" << '\n';
+  f_remote << indent() << "  if len(headers) > 0 {" << '\n';
+  f_remote << indent() << "    httptrans := trans.(*thrift.THttpClient)" << '\n';
+  f_remote << indent() << "    for key, value := range headers {" << '\n';
+  f_remote << indent() << "      httptrans.SetHeader(key, value)" << '\n';
+  f_remote << indent() << "    }" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "} else {" << '\n';
+  f_remote << indent() << "  portStr := fmt.Sprint(port)" << '\n';
+  f_remote << indent() << "  if strings.Contains(host, \":\") {" << '\n';
+  f_remote << indent() << "         host, portStr, err = net.SplitHostPort(host)" << '\n';
+  f_remote << indent() << "         if err != nil {" << '\n';
   f_remote << indent() << "                 fmt.Fprintln(os.Stderr, \"error with host:\", err)"
-           << endl;
-  f_remote << indent() << "                 os.Exit(1)" << endl;
-  f_remote << indent() << "         }" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg)" << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"error resolving address:\", err)" << endl;
-  f_remote << indent() << "    os.Exit(1)" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  if framed {" << endl;
-  f_remote << indent() << "    trans = thrift.NewTFramedTransportConf(trans, cfg)" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "if err != nil {" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Error creating transport\", err)" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "defer trans.Close()" << endl;
-  f_remote << indent() << "var protocolFactory thrift.TProtocolFactory" << endl;
-  f_remote << indent() << "switch protocol {" << endl;
-  f_remote << indent() << "case \"compact\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg)" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"simplejson\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg)" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"json\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTJSONProtocolFactory()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"binary\", \"\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg)" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "default:" << endl;
+           << '\n';
+  f_remote << indent() << "                 os.Exit(1)" << '\n';
+  f_remote << indent() << "         }" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "  trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg)" << '\n';
+  f_remote << indent() << "  if err != nil {" << '\n';
+  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"error resolving address:\", err)" << '\n';
+  f_remote << indent() << "    os.Exit(1)" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "  if framed {" << '\n';
+  f_remote << indent() << "    trans = thrift.NewTFramedTransportConf(trans, cfg)" << '\n';
+  f_remote << indent() << "  }" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << "if err != nil {" << '\n';
+  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Error creating transport\", err)" << '\n';
+  f_remote << indent() << "  os.Exit(1)" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << "defer trans.Close()" << '\n';
+  f_remote << indent() << "var protocolFactory thrift.TProtocolFactory" << '\n';
+  f_remote << indent() << "switch protocol {" << '\n';
+  f_remote << indent() << "case \"compact\":" << '\n';
+  f_remote << indent() << "  protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg)" << '\n';
+  f_remote << indent() << "  break" << '\n';
+  f_remote << indent() << "case \"simplejson\":" << '\n';
+  f_remote << indent() << "  protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg)" << '\n';
+  f_remote << indent() << "  break" << '\n';
+  f_remote << indent() << "case \"json\":" << '\n';
+  f_remote << indent() << "  protocolFactory = thrift.NewTJSONProtocolFactory()" << '\n';
+  f_remote << indent() << "  break" << '\n';
+  f_remote << indent() << "case \"binary\", \"\":" << '\n';
+  f_remote << indent() << "  protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg)" << '\n';
+  f_remote << indent() << "  break" << '\n';
+  f_remote << indent() << "default:" << '\n';
   f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Invalid protocol specified: \", protocol)"
-           << endl;
-  f_remote << indent() << "  Usage()" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "iprot := protocolFactory.GetProtocol(trans)" << endl;
-  f_remote << indent() << "oprot := protocolFactory.GetProtocol(trans)" << endl;
+           << '\n';
+  f_remote << indent() << "  Usage()" << '\n';
+  f_remote << indent() << "  os.Exit(1)" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << "iprot := protocolFactory.GetProtocol(trans)" << '\n';
+  f_remote << indent() << "oprot := protocolFactory.GetProtocol(trans)" << '\n';
   f_remote << indent() << "client := " << package_name_aliased << ".New" << publicize(service_name_)
-           << "Client(thrift.NewTStandardClient(iprot, oprot))" << endl;
-  f_remote << indent() << "if err := trans.Open(); err != nil {" << endl;
+           << "Client(thrift.NewTStandardClient(iprot, oprot))" << '\n';
+  f_remote << indent() << "if err := trans.Open(); err != nil {" << '\n';
   f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Error opening socket to \", "
-                          "host, \":\", port, \" \", err)" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "switch cmd {" << endl;
+                          "host, \":\", port, \" \", err)" << '\n';
+  f_remote << indent() << "  os.Exit(1)" << '\n';
+  f_remote << indent() << "}" << '\n';
+  f_remote << indent() << '\n';
+  f_remote << indent() << "switch cmd {" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* arg_struct = (*f_iter)->get_arglist();
@@ -2404,13 +2404,13 @@
     string funcName((*f_iter)->get_name());
     string pubName(publicize(funcName));
     string argumentsName(publicize(funcName + "_args", true, func_to_service[funcName]));
-    f_remote << indent() << "case \"" << escape_string(funcName) << "\":" << endl;
+    f_remote << indent() << "case \"" << escape_string(funcName) << "\":" << '\n';
     indent_up();
-    f_remote << indent() << "if flag.NArg() - 1 != " << num_args << " {" << endl;
+    f_remote << indent() << "if flag.NArg() - 1 != " << num_args << " {" << '\n';
     f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"" << escape_string(pubName) << " requires "
-             << num_args << " args\")" << endl;
-    f_remote << indent() << "  flag.Usage()" << endl;
-    f_remote << indent() << "}" << endl;
+             << num_args << " args\")" << '\n';
+    f_remote << indent() << "  flag.Usage()" << '\n';
+    f_remote << indent() << "}" << '\n';
 
     for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) {
       std::vector<t_field*>::size_type flagArg = i + 1;
@@ -2419,13 +2419,13 @@
 
       if (the_type2->is_enum()) {
         f_remote << indent() << "tmp" << i << ", err := (strconv.Atoi(flag.Arg(" << flagArg << ")))"
-                 << endl;
-        f_remote << indent() << "if err != nil {" << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << " return" << endl;
-        f_remote << indent() << "}" << endl;
+                 << '\n';
+        f_remote << indent() << "if err != nil {" << '\n';
+        f_remote << indent() << "  Usage()" << '\n';
+        f_remote << indent() << " return" << '\n';
+        f_remote << indent() << "}" << '\n';
         f_remote << indent() << "argvalue" << i << " := " << package_name_aliased << "."
-                 << publicize(the_type->get_name()) << "(tmp" << i << ")" << endl;
+                 << publicize(the_type->get_name()) << "(tmp" << i << ")" << '\n';
       } else if (the_type2->is_base_type()) {
         t_base_type::t_base e = ((t_base_type*)the_type2)->get_base();
         string err(tmp("err"));
@@ -2437,72 +2437,72 @@
         case t_base_type::TYPE_STRING:
           if (the_type2->is_binary()) {
             f_remote << indent() << "argvalue" << i << " := []byte(flag.Arg(" << flagArg << "))"
-                     << endl;
+                     << '\n';
           } else {
-            f_remote << indent() << "argvalue" << i << " := flag.Arg(" << flagArg << ")" << endl;
+            f_remote << indent() << "argvalue" << i << " := flag.Arg(" << flagArg << ")" << '\n';
           }
           break;
 
         case t_base_type::TYPE_BOOL:
           f_remote << indent() << "argvalue" << i << " := flag.Arg(" << flagArg << ") == \"true\""
-                   << endl;
+                   << '\n';
           break;
 
         case t_base_type::TYPE_I8:
           f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := int8(tmp" << i << ")" << endl;
+                   << flagArg << ")))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
+          f_remote << indent() << "argvalue" << i << " := int8(tmp" << i << ")" << '\n';
           break;
 
         case t_base_type::TYPE_I16:
           f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := int16(tmp" << i << ")" << endl;
+                   << flagArg << ")))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
+          f_remote << indent() << "argvalue" << i << " := int16(tmp" << i << ")" << '\n';
           break;
 
         case t_base_type::TYPE_I32:
           f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := int32(tmp" << i << ")" << endl;
+                   << flagArg << ")))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
+          f_remote << indent() << "argvalue" << i << " := int32(tmp" << i << ")" << '\n';
           break;
 
         case t_base_type::TYPE_I64:
           f_remote << indent() << "argvalue" << i << ", " << err
-                   << " := (strconv.ParseInt(flag.Arg(" << flagArg << "), 10, 64))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
+                   << " := (strconv.ParseInt(flag.Arg(" << flagArg << "), 10, 64))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
           break;
 
         case t_base_type::TYPE_DOUBLE:
           f_remote << indent() << "argvalue" << i << ", " << err
-                   << " := (strconv.ParseFloat(flag.Arg(" << flagArg << "), 64))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
+                   << " := (strconv.ParseFloat(flag.Arg(" << flagArg << "), 64))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
           break;
 
         case t_base_type::TYPE_UUID:
           f_remote << indent() << "argvalue" << i << ", " << err
-                   << " := (thrift.ParseTuuid(flag.Arg(" << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
+                   << " := (thrift.ParseTuuid(flag.Arg(" << flagArg << ")))" << '\n';
+          f_remote << indent() << "if " << err << " != nil {" << '\n';
+          f_remote << indent() << "  Usage()" << '\n';
+          f_remote << indent() << "  return" << '\n';
+          f_remote << indent() << "}" << '\n';
           break;
 
         default:
@@ -2524,26 +2524,26 @@
           tstruct_module = package_name_aliased;
         }
 
-        f_remote << indent() << arg << " := flag.Arg(" << flagArg << ")" << endl;
+        f_remote << indent() << arg << " := flag.Arg(" << flagArg << ")" << '\n';
         f_remote << indent() << mbTrans << " := thrift.NewTMemoryBufferLen(len(" << arg << "))"
-                 << endl;
-        f_remote << indent() << "defer " << mbTrans << ".Close()" << endl;
+                 << '\n';
+        f_remote << indent() << "defer " << mbTrans << ".Close()" << '\n';
         f_remote << indent() << "_, " << err1 << " := " << mbTrans << ".WriteString(" << arg << ")"
-                 << endl;
-        f_remote << indent() << "if " << err1 << " != nil {" << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << "  return" << endl;
-        f_remote << indent() << "}" << endl;
-        f_remote << indent() << factory << " := thrift.NewTJSONProtocolFactory()" << endl;
+                 << '\n';
+        f_remote << indent() << "if " << err1 << " != nil {" << '\n';
+        f_remote << indent() << "  Usage()" << '\n';
+        f_remote << indent() << "  return" << '\n';
+        f_remote << indent() << "}" << '\n';
+        f_remote << indent() << factory << " := thrift.NewTJSONProtocolFactory()" << '\n';
         f_remote << indent() << jsProt << " := " << factory << ".GetProtocol(" << mbTrans << ")"
-                 << endl;
+                 << '\n';
         f_remote << indent() << "argvalue" << i << " := " << tstruct_module << ".New" << tstruct_name
-                 << "()" << endl;
-        f_remote << indent() << err2 << " := argvalue" << i << "." << read_method_name_ <<  "(context.Background(), " << jsProt << ")" << endl;
-        f_remote << indent() << "if " << err2 << " != nil {" << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << "  return" << endl;
-        f_remote << indent() << "}" << endl;
+                 << "()" << '\n';
+        f_remote << indent() << err2 << " := argvalue" << i << "." << read_method_name_ <<  "(context.Background(), " << jsProt << ")" << '\n';
+        f_remote << indent() << "if " << err2 << " != nil {" << '\n';
+        f_remote << indent() << "  Usage()" << '\n';
+        f_remote << indent() << "  return" << '\n';
+        f_remote << indent() << "}" << '\n';
       } else if (the_type2->is_container() || the_type2->is_xception()) {
         string arg(tmp("arg"));
         string mbTrans(tmp("mbTrans"));
@@ -2552,29 +2552,29 @@
         string jsProt(tmp("jsProt"));
         string err2(tmp("err"));
         std::string argName(publicize(args[i]->get_name()));
-        f_remote << indent() << arg << " := flag.Arg(" << flagArg << ")" << endl;
+        f_remote << indent() << arg << " := flag.Arg(" << flagArg << ")" << '\n';
         f_remote << indent() << mbTrans << " := thrift.NewTMemoryBufferLen(len(" << arg << "))"
-                 << endl;
-        f_remote << indent() << "defer " << mbTrans << ".Close()" << endl;
+                 << '\n';
+        f_remote << indent() << "defer " << mbTrans << ".Close()" << '\n';
         f_remote << indent() << "_, " << err1 << " := " << mbTrans << ".WriteString(" << arg << ")"
-                 << endl;
-        f_remote << indent() << "if " << err1 << " != nil { " << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << "  return" << endl;
-        f_remote << indent() << "}" << endl;
-        f_remote << indent() << factory << " := thrift.NewTJSONProtocolFactory()" << endl;
+                 << '\n';
+        f_remote << indent() << "if " << err1 << " != nil { " << '\n';
+        f_remote << indent() << "  Usage()" << '\n';
+        f_remote << indent() << "  return" << '\n';
+        f_remote << indent() << "}" << '\n';
+        f_remote << indent() << factory << " := thrift.NewTJSONProtocolFactory()" << '\n';
         f_remote << indent() << jsProt << " := " << factory << ".GetProtocol(" << mbTrans << ")"
-                 << endl;
+                 << '\n';
         f_remote << indent() << "containerStruct" << i << " := " << package_name_aliased << ".New"
-                 << argumentsName << "()" << endl;
+                 << argumentsName << "()" << '\n';
         f_remote << indent() << err2 << " := containerStruct" << i << ".ReadField" << (i + 1) << "(context.Background(), "
-                 << jsProt << ")" << endl;
-        f_remote << indent() << "if " << err2 << " != nil {" << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << "  return" << endl;
-        f_remote << indent() << "}" << endl;
+                 << jsProt << ")" << '\n';
+        f_remote << indent() << "if " << err2 << " != nil {" << '\n';
+        f_remote << indent() << "  Usage()" << '\n';
+        f_remote << indent() << "  return" << '\n';
+        f_remote << indent() << "}" << '\n';
         f_remote << indent() << "argvalue" << i << " := containerStruct" << i << "." << argName
-                 << endl;
+                 << '\n';
       } else {
         throw("Invalid argument type in generate_service_remote");
       }
@@ -2585,9 +2585,9 @@
           typedef_module = package_name_aliased;
         }
         f_remote << indent() << "value" << i << " := " << typedef_module << "."
-                 << publicize(the_type->get_name()) << "(argvalue" << i << ")" << endl;
+                 << publicize(the_type->get_name()) << "(argvalue" << i << ")" << '\n';
       } else {
-        f_remote << indent() << "value" << i << " := argvalue" << i << endl;
+        f_remote << indent() << "value" << i << " := argvalue" << i << '\n';
       }
     }
 
@@ -2634,20 +2634,20 @@
       }
     }
 
-    f_remote << "))" << endl;
-    f_remote << indent() << "fmt.Print(\"\\n\")" << endl;
-    f_remote << indent() << "break" << endl;
+    f_remote << "))" << '\n';
+    f_remote << indent() << "fmt.Print(\"\\n\")" << '\n';
+    f_remote << indent() << "break" << '\n';
     indent_down();
   }
 
-  f_remote << indent() << "case \"\":" << endl;
-  f_remote << indent() << "  Usage()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "default:" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Invalid function \", cmd)" << endl;
-  f_remote << indent() << "}" << endl;
+  f_remote << indent() << "case \"\":" << '\n';
+  f_remote << indent() << "  Usage()" << '\n';
+  f_remote << indent() << "  break" << '\n';
+  f_remote << indent() << "default:" << '\n';
+  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Invalid function \", cmd)" << '\n';
+  f_remote << indent() << "}" << '\n';
   indent_down();
-  f_remote << indent() << "}" << endl;
+  f_remote << indent() << "}" << '\n';
   // Close service file
   f_remote.close();
   format_go_output(f_remote_name);
@@ -2696,80 +2696,80 @@
   string self(tmp("self"));
 
   if (extends_processor.empty()) {
-    f_types_ << indent() << "type " << serviceName << "Processor struct {" << endl;
-    f_types_ << indent() << "  processorMap map[string]thrift.TProcessorFunction" << endl;
-    f_types_ << indent() << "  handler " << serviceName << endl;
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "type " << serviceName << "Processor struct {" << '\n';
+    f_types_ << indent() << "  processorMap map[string]thrift.TProcessorFunction" << '\n';
+    f_types_ << indent() << "  handler " << serviceName << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func (p *" << serviceName
                << "Processor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {"
-               << endl;
-    f_types_ << indent() << "  p.processorMap[key] = processor" << endl;
-    f_types_ << indent() << "}" << endl << endl;
+               << '\n';
+    f_types_ << indent() << "  p.processorMap[key] = processor" << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func (p *" << serviceName
                << "Processor) GetProcessorFunction(key string) "
-                  "(processor thrift.TProcessorFunction, ok bool) {" << endl;
-    f_types_ << indent() << "  processor, ok = p.processorMap[key]" << endl;
-    f_types_ << indent() << "  return processor, ok" << endl;
-    f_types_ << indent() << "}" << endl << endl;
+                  "(processor thrift.TProcessorFunction, ok bool) {" << '\n';
+    f_types_ << indent() << "  processor, ok = p.processorMap[key]" << '\n';
+    f_types_ << indent() << "  return processor, ok" << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func (p *" << serviceName
-               << "Processor) ProcessorMap() map[string]thrift.TProcessorFunction {" << endl;
-    f_types_ << indent() << "  return p.processorMap" << endl;
-    f_types_ << indent() << "}" << endl << endl;
+               << "Processor) ProcessorMap() map[string]thrift.TProcessorFunction {" << '\n';
+    f_types_ << indent() << "  return p.processorMap" << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func New" << serviceName << "Processor(handler " << serviceName
-               << ") *" << serviceName << "Processor {" << endl << endl;
+               << ") *" << serviceName << "Processor {" << '\n' << '\n';
     f_types_
         << indent() << "  " << self << " := &" << serviceName
         << "Processor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}"
-        << endl;
+        << '\n';
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       string escapedFuncName(escape_string((*f_iter)->get_name()));
       f_types_ << indent() << "  " << self << ".processorMap[\"" << escapedFuncName << "\"] = &"
                  << pServiceName << "Processor" << publicize((*f_iter)->get_name())
-                 << "{handler:handler}" << endl;
+                 << "{handler:handler}" << '\n';
     }
 
     string x(tmp("x"));
-    f_types_ << indent() << "return " << self << endl;
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "return " << self << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func (p *" << serviceName
                << "Processor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err "
-                  "thrift.TException) {" << endl;
-    f_types_ << indent() << "  name, _, seqId, err2 := iprot.ReadMessageBegin(ctx)" << endl;
-    f_types_ << indent() << "  if err2 != nil { return false, thrift.WrapTException(err2) }" << endl;
-    f_types_ << indent() << "  if processor, ok := p.GetProcessorFunction(name); ok {" << endl;
-    f_types_ << indent() << "    return processor.Process(ctx, seqId, iprot, oprot)" << endl;
-    f_types_ << indent() << "  }" << endl;
-    f_types_ << indent() << "  iprot.Skip(ctx, thrift.STRUCT)" << endl;
-    f_types_ << indent() << "  iprot.ReadMessageEnd(ctx)" << endl;
+                  "thrift.TException) {" << '\n';
+    f_types_ << indent() << "  name, _, seqId, err2 := iprot.ReadMessageBegin(ctx)" << '\n';
+    f_types_ << indent() << "  if err2 != nil { return false, thrift.WrapTException(err2) }" << '\n';
+    f_types_ << indent() << "  if processor, ok := p.GetProcessorFunction(name); ok {" << '\n';
+    f_types_ << indent() << "    return processor.Process(ctx, seqId, iprot, oprot)" << '\n';
+    f_types_ << indent() << "  }" << '\n';
+    f_types_ << indent() << "  iprot.Skip(ctx, thrift.STRUCT)" << '\n';
+    f_types_ << indent() << "  iprot.ReadMessageEnd(ctx)" << '\n';
     f_types_ << indent() << "  " << x
                << " := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, \"Unknown function "
-                  "\" + name)" << endl;
-    f_types_ << indent() << "  oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId)" << endl;
-    f_types_ << indent() << "  " << x << ".Write(ctx, oprot)" << endl;
-    f_types_ << indent() << "  oprot.WriteMessageEnd(ctx)" << endl;
-    f_types_ << indent() << "  oprot.Flush(ctx)" << endl;
-    f_types_ << indent() << "  return false, " << x << endl;
-    f_types_ << indent() << "" << endl;
-    f_types_ << indent() << "}" << endl << endl;
+                  "\" + name)" << '\n';
+    f_types_ << indent() << "  oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId)" << '\n';
+    f_types_ << indent() << "  " << x << ".Write(ctx, oprot)" << '\n';
+    f_types_ << indent() << "  oprot.WriteMessageEnd(ctx)" << '\n';
+    f_types_ << indent() << "  oprot.Flush(ctx)" << '\n';
+    f_types_ << indent() << "  return false, " << x << '\n';
+    f_types_ << indent() << "" << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
   } else {
-    f_types_ << indent() << "type " << serviceName << "Processor struct {" << endl;
-    f_types_ << indent() << "  *" << extends_processor << endl;
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "type " << serviceName << "Processor struct {" << '\n';
+    f_types_ << indent() << "  *" << extends_processor << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
     f_types_ << indent() << "func New" << serviceName << "Processor(handler " << serviceName
-               << ") *" << serviceName << "Processor {" << endl;
+               << ") *" << serviceName << "Processor {" << '\n';
     f_types_ << indent() << "  " << self << " := &" << serviceName << "Processor{"
-               << extends_processor_new << "(handler)}" << endl;
+               << extends_processor_new << "(handler)}" << '\n';
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       string escapedFuncName(escape_string((*f_iter)->get_name()));
       f_types_ << indent() << "  " << self << ".AddToProcessorMap(\"" << escapedFuncName
                  << "\", &" << pServiceName << "Processor" << publicize((*f_iter)->get_name())
-                 << "{handler:handler})" << endl;
+                 << "{handler:handler})" << '\n';
     }
 
-    f_types_ << indent() << "  return " << self << endl;
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "  return " << self << '\n';
+    f_types_ << indent() << "}" << '\n' << '\n';
   }
 
   // Generate the process subfunctions
@@ -2777,7 +2777,7 @@
     generate_process_function(tservice, *f_iter);
   }
 
-  f_types_ << endl;
+  f_types_ << '\n';
 }
 
 /**
@@ -2794,90 +2794,90 @@
 
   // t_struct* xs = tfunction->get_xceptions();
   // const std::vector<t_field*>& xceptions = xs->get_members();
-  f_types_ << indent() << "type " << processorName << " struct {" << endl;
-  f_types_ << indent() << "  handler " << publicize(tservice->get_name()) << endl;
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "type " << processorName << " struct {" << '\n';
+  f_types_ << indent() << "  handler " << publicize(tservice->get_name()) << '\n';
+  f_types_ << indent() << "}" << '\n' << '\n';
   f_types_ << indent() << "func (p *" << processorName
              << ") Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err "
-                "thrift.TException) {" << endl;
+                "thrift.TException) {" << '\n';
   indent_up();
   string write_err;
   if (!tfunction->is_oneway()) {
     write_err = tmp("_write_err");
-    f_types_ << indent() << "var " << write_err << " error" << endl;
+    f_types_ << indent() << "var " << write_err << " error" << '\n';
   }
-  f_types_ << indent() << "args := " << argsname << "{}" << endl;
-  f_types_ << indent() << "if err2 := args." << read_method_name_ <<  "(ctx, iprot); err2 != nil {" << endl;
+  f_types_ << indent() << "args := " << argsname << "{}" << '\n';
+  f_types_ << indent() << "if err2 := args." << read_method_name_ <<  "(ctx, iprot); err2 != nil {" << '\n';
   indent_up();
-  f_types_ << indent() << "iprot.ReadMessageEnd(ctx)" << endl;
+  f_types_ << indent() << "iprot.ReadMessageEnd(ctx)" << '\n';
   if (!tfunction->is_oneway()) {
     f_types_ << indent()
                << "x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())"
-               << endl;
+               << '\n';
     f_types_ << indent() << "oprot.WriteMessageBegin(ctx, \"" << escape_string(tfunction->get_name())
-               << "\", thrift.EXCEPTION, seqId)" << endl;
-    f_types_ << indent() << "x.Write(ctx, oprot)" << endl;
-    f_types_ << indent() << "oprot.WriteMessageEnd(ctx)" << endl;
-    f_types_ << indent() << "oprot.Flush(ctx)" << endl;
+               << "\", thrift.EXCEPTION, seqId)" << '\n';
+    f_types_ << indent() << "x.Write(ctx, oprot)" << '\n';
+    f_types_ << indent() << "oprot.WriteMessageEnd(ctx)" << '\n';
+    f_types_ << indent() << "oprot.Flush(ctx)" << '\n';
   }
-  f_types_ << indent() << "return false, thrift.WrapTException(err2)" << endl;
+  f_types_ << indent() << "return false, thrift.WrapTException(err2)" << '\n';
   indent_down();
-  f_types_ << indent() << "}" << endl;
-  f_types_ << indent() << "iprot.ReadMessageEnd(ctx)" << endl << endl;
+  f_types_ << indent() << "}" << '\n';
+  f_types_ << indent() << "iprot.ReadMessageEnd(ctx)" << '\n' << '\n';
 
   // Even though we never create the goroutine in oneway handlers,
   // always have (nop) tickerCancel defined makes the writing part of code
   // generating easier and less error-prone.
-  f_types_ << indent() << "tickerCancel := func() {}" << endl;
+  f_types_ << indent() << "tickerCancel := func() {}" << '\n';
   // Only create the goroutine for non-oneways.
   if (!tfunction->is_oneway()) {
-    f_types_ << indent() << "// Start a goroutine to do server side connectivity check." << endl;
-    f_types_ << indent() << "if thrift.ServerConnectivityCheckInterval > 0 {" << endl;
+    f_types_ << indent() << "// Start a goroutine to do server side connectivity check." << '\n';
+    f_types_ << indent() << "if thrift.ServerConnectivityCheckInterval > 0 {" << '\n';
 
     indent_up();
-    f_types_ << indent() << "var cancel context.CancelCauseFunc" << endl;
-    f_types_ << indent() << "ctx, cancel = context.WithCancelCause(ctx)" << endl;
-    f_types_ << indent() << "defer cancel(nil)" << endl;
-    f_types_ << indent() << "var tickerCtx context.Context" << endl;
-    f_types_ << indent() << "tickerCtx, tickerCancel = context.WithCancel(context.Background())" << endl;
-    f_types_ << indent() << "defer tickerCancel()" << endl;
-    f_types_ << indent() << "go func(ctx context.Context, cancel context.CancelCauseFunc) {" << endl;
+    f_types_ << indent() << "var cancel context.CancelCauseFunc" << '\n';
+    f_types_ << indent() << "ctx, cancel = context.WithCancelCause(ctx)" << '\n';
+    f_types_ << indent() << "defer cancel(nil)" << '\n';
+    f_types_ << indent() << "var tickerCtx context.Context" << '\n';
+    f_types_ << indent() << "tickerCtx, tickerCancel = context.WithCancel(context.Background())" << '\n';
+    f_types_ << indent() << "defer tickerCancel()" << '\n';
+    f_types_ << indent() << "go func(ctx context.Context, cancel context.CancelCauseFunc) {" << '\n';
 
     indent_up();
-    f_types_ << indent() << "ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)" << endl;
-    f_types_ << indent() << "defer ticker.Stop()" << endl;
-    f_types_ << indent() << "for {" << endl;
+    f_types_ << indent() << "ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)" << '\n';
+    f_types_ << indent() << "defer ticker.Stop()" << '\n';
+    f_types_ << indent() << "for {" << '\n';
 
     indent_up();
-    f_types_ << indent() << "select {" << endl;
-    f_types_ << indent() << "case <-ctx.Done():" << endl;
+    f_types_ << indent() << "select {" << '\n';
+    f_types_ << indent() << "case <-ctx.Done():" << '\n';
     indent_up();
-    f_types_ << indent() << "return" << endl;
+    f_types_ << indent() << "return" << '\n';
     indent_down();
-    f_types_ << indent() << "case <-ticker.C:" << endl;
+    f_types_ << indent() << "case <-ticker.C:" << '\n';
 
     indent_up();
-    f_types_ << indent() << "if !iprot.Transport().IsOpen() {" << endl;
+    f_types_ << indent() << "if !iprot.Transport().IsOpen() {" << '\n';
     indent_up();
-    f_types_ << indent() << "cancel(thrift.ErrAbandonRequest)" << endl;
-    f_types_ << indent() << "return" << endl;
+    f_types_ << indent() << "cancel(thrift.ErrAbandonRequest)" << '\n';
+    f_types_ << indent() << "return" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
     indent_down();
-    f_types_ << indent() << "}(tickerCtx, cancel)" << endl;
+    f_types_ << indent() << "}(tickerCtx, cancel)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl << endl;
+    f_types_ << indent() << "}" << '\n' << '\n';
   } else {
     // Make sure we don't get the defined but unused compiling error.
-    f_types_ << indent() << "_ = tickerCancel" << endl << endl;
+    f_types_ << indent() << "_ = tickerCancel" << '\n' << '\n';
   }
 
   if (!tfunction->is_oneway()) {
-    f_types_ << indent() << "result := " << resultname << "{}" << endl;
+    f_types_ << indent() << "result := " << resultname << "{}" << '\n';
   }
   bool need_reference = type_need_reference(tfunction->get_returntype());
 
@@ -2908,93 +2908,93 @@
     f_types_ << "args." << publicize((*f_iter)->get_name());
   }
 
-  f_types_ << "); err2 != nil {" << endl;
+  f_types_ << "); err2 != nil {" << '\n';
   indent_up();
-  f_types_ << indent() << "tickerCancel()" << endl;
-  f_types_ << indent() << "err = thrift.WrapTException(err2)" << endl;
+  f_types_ << indent() << "tickerCancel()" << '\n';
+  f_types_ << indent() << "err = thrift.WrapTException(err2)" << '\n';
 
   t_struct* exceptions = tfunction->get_xceptions();
   const vector<t_field*>& x_fields = exceptions->get_members();
   if (!x_fields.empty()) {
-    f_types_ << indent() << "switch v := err2.(type) {" << endl;
+    f_types_ << indent() << "switch v := err2.(type) {" << '\n';
 
     vector<t_field*>::const_iterator xf_iter;
 
     for (xf_iter = x_fields.begin(); xf_iter != x_fields.end(); ++xf_iter) {
       f_types_ << indent() << "case " << type_to_go_type(((*xf_iter)->get_type())) << ":"
-                 << endl;
+                 << '\n';
       indent_up();
-      f_types_ << indent() << "result." << publicize((*xf_iter)->get_name()) << " = v" << endl;
+      f_types_ << indent() << "result." << publicize((*xf_iter)->get_name()) << " = v" << '\n';
       indent_down();
     }
 
-    f_types_ << indent() << "default:" << endl;
+    f_types_ << indent() << "default:" << '\n';
     indent_up();
   }
 
   if (!tfunction->is_oneway()) {
     // Avoid writing the error to the wire if it's ErrAbandonRequest
-    f_types_ << indent() << "if errors.Is(err2, thrift.ErrAbandonRequest) {" << endl;
+    f_types_ << indent() << "if errors.Is(err2, thrift.ErrAbandonRequest) {" << '\n';
     indent_up();
-    f_types_ << indent() << "return false, thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << "return false, thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
-    f_types_ << indent() << "if errors.Is(err2, context.Canceled) {" << endl;
+    f_types_ << indent() << "}" << '\n';
+    f_types_ << indent() << "if errors.Is(err2, context.Canceled) {" << '\n';
     indent_up();
-    f_types_ << indent() << "if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {" << endl;
+    f_types_ << indent() << "if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {" << '\n';
     indent_up();
-    f_types_ << indent() << "return false, thrift.WrapTException(err)" << endl;
+    f_types_ << indent() << "return false, thrift.WrapTException(err)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     string exc(tmp("_exc"));
     f_types_ << indent() << exc << " := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "
                               "\"Internal error processing " << escape_string(tfunction->get_name())
-               << ": \" + err2.Error())" << endl;
+               << ": \" + err2.Error())" << '\n';
 
     f_types_ << indent() << "if err2 := oprot.WriteMessageBegin(ctx, \"" << escape_string(tfunction->get_name())
-               << "\", thrift.EXCEPTION, seqId); err2 != nil {" << endl;
+               << "\", thrift.EXCEPTION, seqId); err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     f_types_ << indent() << "if err2 := " << exc << ".Write(ctx, oprot); "
-               << write_err << " == nil && err2 != nil {" << endl;
+               << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     f_types_ << indent() << "if err2 := oprot.WriteMessageEnd(ctx); "
-               << write_err << " == nil && err2 != nil {" << endl;
+               << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     f_types_ << indent() << "if err2 := oprot.Flush(ctx); "
-               << write_err << " == nil && err2 != nil {" << endl;
+               << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
-    f_types_ << indent() << "if " << write_err << " != nil {" << endl;
+    f_types_ << indent() << "if " << write_err << " != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << "return false, thrift.WrapTException(" << write_err << ")" << endl;
+    f_types_ << indent() << "return false, thrift.WrapTException(" << write_err << ")" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     // return success=true as long as writing to the wire was successful.
-    f_types_ << indent() << "return true, err" << endl;
+    f_types_ << indent() << "return true, err" << '\n';
   }
 
   if (!x_fields.empty()) {
     indent_down();
-    f_types_ << indent() << "}" << endl; // closes switch
+    f_types_ << indent() << "}" << '\n'; // closes switch
   }
 
   indent_down();
@@ -3002,63 +3002,63 @@
 
   if (!tfunction->is_oneway()) {
     if (!tfunction->get_returntype()->is_void()) {
-      f_types_ << " else {" << endl; // make sure we set Success retval only on success
+      f_types_ << " else {" << '\n'; // make sure we set Success retval only on success
       indent_up();
       f_types_ << indent() << "result.Success = ";
       if (need_reference) {
         f_types_ << "&";
       }
-      f_types_ << "retval" << endl;
+      f_types_ << "retval" << '\n';
       indent_down();
-      f_types_ << indent() << "}" << endl;
+      f_types_ << indent() << "}" << '\n';
     } else {
-      f_types_ << endl;
+      f_types_ << '\n';
     }
-    f_types_ << indent() << "tickerCancel()" << endl;
+    f_types_ << indent() << "tickerCancel()" << '\n';
 
     f_types_ << indent() << "if err2 := oprot.WriteMessageBegin(ctx, \""
                << escape_string(tfunction->get_name()) << "\", thrift.REPLY, seqId); err2 != nil {"
-               << endl;
+               << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     f_types_ << indent() << "if err2 := result." << write_method_name_ << "(ctx, oprot); "
-               << write_err << " == nil && err2 != nil {" << endl;
+               << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     f_types_ << indent() << "if err2 := oprot.WriteMessageEnd(ctx); "
-               << write_err << " == nil && err2 != nil {" << endl;
+               << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
-    f_types_ << indent() << "if err2 := oprot.Flush(ctx); " << write_err << " == nil && err2 != nil {" << endl;
+    f_types_ << indent() << "if err2 := oprot.Flush(ctx); " << write_err << " == nil && err2 != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << endl;
+    f_types_ << indent() << write_err << " = thrift.WrapTException(err2)" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
-    f_types_ << indent() << "if " << write_err << " != nil {" << endl;
+    f_types_ << indent() << "if " << write_err << " != nil {" << '\n';
     indent_up();
-    f_types_ << indent() << "return false, thrift.WrapTException(" << write_err << ")" << endl;
+    f_types_ << indent() << "return false, thrift.WrapTException(" << write_err << ")" << '\n';
     indent_down();
-    f_types_ << indent() << "}" << endl;
+    f_types_ << indent() << "}" << '\n';
 
     // return success=true as long as writing to the wire was successful.
-    f_types_ << indent() << "return true, err" << endl;
+    f_types_ << indent() << "return true, err" << '\n';
   } else {
-    f_types_ << endl;
-    f_types_ << indent() << "tickerCancel()" << endl;
-    f_types_ << indent() << "return true, err" << endl;
+    f_types_ << '\n';
+    f_types_ << indent() << "tickerCancel()" << '\n';
+    f_types_ << indent() << "return true, err" << '\n';
   }
   indent_down();
-  f_types_ << indent() << "}" << endl << endl;
+  f_types_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -3096,7 +3096,7 @@
       string type_name = inkey ? type_to_go_key_type(tfield->get_type())
                                : type_to_go_type(tfield->get_type());
 
-      out << "var " << tfield->get_name() << " " << type_name << endl;
+      out << "var " << tfield->get_name() << " " << type_name << '\n';
     }
 
     indent(out) << "if v, err := iprot.";
@@ -3153,11 +3153,11 @@
       out << "ReadI32(ctx)";
     }
 
-    out << "; err != nil {" << endl;
+    out << "; err != nil {" << '\n';
     out << indent() << "return thrift.PrependError(\"error reading field " << tfield->get_key()
-        << ": \", err)" << endl;
+        << ": \", err)" << '\n';
 
-    out << "} else {" << endl;
+    out << "} else {" << '\n';
     string wrap;
 
     if (type->is_enum() || orig_type->is_typedef()) {
@@ -3168,13 +3168,13 @@
 
     string maybe_address = (is_pointer_field(tfield) ? "&" : "");
     if (wrap == "") {
-      indent(out) << name << " = " << maybe_address << "v" << endl;
+      indent(out) << name << " = " << maybe_address << "v" << '\n';
     } else {
-      indent(out) << "temp := " << wrap << "(v)" << endl;
-      indent(out) << name << " = " << maybe_address << "temp" << endl;
+      indent(out) << "temp := " << wrap << "(v)" << '\n';
+      indent(out) << name << " = " << maybe_address << "temp" << '\n';
     }
 
-    out << "}" << endl;
+    out << "}" << '\n';
   } else {
     throw "INVALID TYPE IN generate_deserialize_field '" + type->get_name() + "' for field '"
         + tfield->get_name() + "'";
@@ -3193,10 +3193,10 @@
 
   out << indent() << prefix << eq << (pointer_field ? "&" : "");
   generate_go_struct_initializer(out, tstruct);
-  out << indent() << "if err := " << prefix << "." << read_method_name_ <<  "(ctx, iprot); err != nil {" << endl;
+  out << indent() << "if err := " << prefix << "." << read_method_name_ <<  "(ctx, iprot); err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T error reading struct: \", "
-      << prefix << "), err)" << endl;
-  out << indent() << "}" << endl;
+      << prefix << "), err)" << '\n';
+  out << indent() << "}" << '\n';
 }
 
 /**
@@ -3217,33 +3217,33 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << "_, _, size, err := iprot.ReadMapBegin(ctx)" << endl;
-    out << indent() << "if err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading map begin: \", err)" << endl;
-    out << indent() << "}" << endl;
-    out << indent() << "tMap := make(" << type_to_go_type(orig_type) << ", size)" << endl;
-    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tMap" << endl;
+    out << indent() << "_, _, size, err := iprot.ReadMapBegin(ctx)" << '\n';
+    out << indent() << "if err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading map begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
+    out << indent() << "tMap := make(" << type_to_go_type(orig_type) << ", size)" << '\n';
+    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tMap" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << "_, size, err := iprot.ReadSetBegin(ctx)" << endl;
-    out << indent() << "if err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading set begin: \", err)" << endl;
-    out << indent() << "}" << endl;
-    out << indent() << "tSet := make(" << type_to_go_type(orig_type) << ", 0, size)" << endl;
-    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tSet" << endl;
+    out << indent() << "_, size, err := iprot.ReadSetBegin(ctx)" << '\n';
+    out << indent() << "if err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading set begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
+    out << indent() << "tSet := make(" << type_to_go_type(orig_type) << ", 0, size)" << '\n';
+    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tSet" << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << "_, size, err := iprot.ReadListBegin(ctx)" << endl;
-    out << indent() << "if err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading list begin: \", err)" << endl;
-    out << indent() << "}" << endl;
-    out << indent() << "tSlice := make(" << type_to_go_type(orig_type) << ", 0, size)" << endl;
-    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tSlice" << endl;
+    out << indent() << "_, size, err := iprot.ReadListBegin(ctx)" << '\n';
+    out << indent() << "if err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading list begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
+    out << indent() << "tSlice := make(" << type_to_go_type(orig_type) << ", 0, size)" << '\n';
+    out << indent() << prefix << eq << " " << (pointer_field ? "&" : "") << "tSlice" << '\n';
   } else {
     throw "INVALID TYPE IN generate_deserialize_container '" + ttype->get_name() + "' for prefix '"
         + prefix + "'";
   }
 
   // For loop iterates over elements
-  out << indent() << "for i := 0; i < size; i ++ {" << endl;
+  out << indent() << "for i := 0; i < size; i ++ {" << '\n';
   indent_up();
 
   if (pointer_field) {
@@ -3258,21 +3258,21 @@
   }
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 
   // Read container end
   if (ttype->is_map()) {
-    out << indent() << "if err := iprot.ReadMapEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading map end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := iprot.ReadMapEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading map end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << "if err := iprot.ReadSetEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading set end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := iprot.ReadSetEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading set end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << "if err := iprot.ReadListEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error reading list end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := iprot.ReadListEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error reading list end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   }
 }
 
@@ -3292,7 +3292,7 @@
   fval.set_req(t_field::T_OPT_IN_REQ_OUT);
   generate_deserialize_field(out, &fkey, true, "", false, false, true);
   generate_deserialize_field(out, &fval, true, "", false, false, false, true);
-  indent(out) << prefix << "[" << key << "] = " << val << endl;
+  indent(out) << prefix << "[" << key << "] = " << val << '\n';
 }
 
 /**
@@ -3307,7 +3307,7 @@
   t_field felem(tset->get_elem_type(), elem);
   felem.set_req(t_field::T_OPT_IN_REQ_OUT);
   generate_deserialize_field(out, &felem, true, "", false, false, false, true);
-  indent(out) << prefix << " = append(" << prefix << ", " << elem << ")" << endl;
+  indent(out) << prefix << " = append(" << prefix << ", " << elem << ")" << '\n';
 }
 
 /**
@@ -3322,7 +3322,7 @@
   t_field felem(((t_list*)tlist)->get_elem_type(), elem);
   felem.set_req(t_field::T_OPT_IN_REQ_OUT);
   generate_deserialize_field(out, &felem, true, "", false, false, false, true);
-  indent(out) << prefix << " = append(" << prefix << ", " << elem << ")" << endl;
+  indent(out) << prefix << " = append(" << prefix << ", " << elem << ")" << '\n';
 }
 
 /**
@@ -3406,10 +3406,10 @@
       out << "WriteI32(ctx, int32(" << name << "))";
     }
 
-    out << "; err != nil {" << endl;
+    out << "; err != nil {" << '\n';
     out << indent() << "return thrift.PrependError(fmt.Sprintf(\"%T."
         << escape_string(tfield->get_name()) << " (" << tfield->get_key()
-        << ") field write error: \", p), err) }" << endl;
+        << ") field write error: \", p), err) }" << '\n';
   } else {
     throw "compiler error: Invalid type in generate_serialize_field '" + type->get_name()
         + "' for field '" + name + "'";
@@ -3424,10 +3424,10 @@
  */
 void t_go_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  out << indent() << "if err := " << prefix << "." << write_method_name_ << "(ctx, oprot); err != nil {" << endl;
+  out << indent() << "if err := " << prefix << "." << write_method_name_ << "(ctx, oprot); err != nil {" << '\n';
   out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T error writing struct: \", "
-      << prefix << "), err)" << endl;
-  out << indent() << "}" << endl;
+      << prefix << "), err)" << '\n';
+  out << indent() << "}" << '\n';
 }
 
 void t_go_generator::generate_serialize_container(ostream& out,
@@ -3441,21 +3441,21 @@
     out << indent() << "if err := oprot.WriteMapBegin(ctx, "
         << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
         << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-        << "len(" << prefix << ")); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing map begin: \", err)" << endl;
-    out << indent() << "}" << endl;
+        << "len(" << prefix << ")); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing map begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_set()) {
     out << indent() << "if err := oprot.WriteSetBegin(ctx, "
         << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-        << "len(" << prefix << ")); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing set begin: \", err)" << endl;
-    out << indent() << "}" << endl;
+        << "len(" << prefix << ")); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing set begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_list()) {
     out << indent() << "if err := oprot.WriteListBegin(ctx, "
         << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", "
-        << "len(" << prefix << ")); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing list begin: \", err)" << endl;
-    out << indent() << "}" << endl;
+        << "len(" << prefix << ")); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing list begin: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else {
     throw "compiler error: Invalid type in generate_serialize_container '" + ttype->get_name()
         + "' for prefix '" + prefix + "'";
@@ -3463,66 +3463,66 @@
 
   if (ttype->is_map()) {
     t_map* tmap = (t_map*)ttype;
-    out << indent() << "for k, v := range " << prefix << " {" << endl;
+    out << indent() << "for k, v := range " << prefix << " {" << '\n';
     indent_up();
     generate_serialize_map_element(out, tmap, "k", "v");
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   } else if (ttype->is_set()) {
     t_set* tset = (t_set*)ttype;
-    out << indent() << "for i := 0; i<len(" << prefix << "); i++ {" << endl;
+    out << indent() << "for i := 0; i<len(" << prefix << "); i++ {" << '\n';
     indent_up();
-    out << indent() << "for j := i+1; j<len(" << prefix << "); j++ {" << endl;
+    out << indent() << "for j := i+1; j<len(" << prefix << "); j++ {" << '\n';
     indent_up();
     string wrapped_prefix = prefix;
     if (pointer_field) {
       wrapped_prefix = "(" + prefix + ")";
     }
     string goType = type_to_go_type(tset->get_elem_type());
-    out << indent() << "if func(tgt, src " << goType << ") bool {" << endl;
+    out << indent() << "if func(tgt, src " << goType << ") bool {" << '\n';
     indent_up();
     generate_go_equals(out, tset->get_elem_type(), "tgt", "src");
-    out << indent() << "return true" << endl;
+    out << indent() << "return true" << '\n';
     indent_down();
-    out << indent() << "}(" << wrapped_prefix << "[i], " << wrapped_prefix << "[j]) {" << endl;
+    out << indent() << "}(" << wrapped_prefix << "[i], " << wrapped_prefix << "[j]) {" << '\n';
     indent_up();
     out << indent()
         << "return thrift.PrependError(\"\", fmt.Errorf(\"%T error writing set field: slice is not "
            "unique\", "
-        << wrapped_prefix << "))" << endl;
+        << wrapped_prefix << "))" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "for _, v := range " << prefix << " {" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "for _, v := range " << prefix << " {" << '\n';
     indent_up();
     generate_serialize_set_element(out, tset, "v");
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   } else if (ttype->is_list()) {
     t_list* tlist = (t_list*)ttype;
-    out << indent() << "for _, v := range " << prefix << " {" << endl;
+    out << indent() << "for _, v := range " << prefix << " {" << '\n';
 
     indent_up();
     generate_serialize_list_element(out, tlist, "v");
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
   if (ttype->is_map()) {
-    out << indent() << "if err := oprot.WriteMapEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing map end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := oprot.WriteMapEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing map end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << "if err := oprot.WriteSetEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing set end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := oprot.WriteSetEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing set end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << "if err := oprot.WriteListEnd(ctx); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(\"error writing list end: \", err)" << endl;
-    out << indent() << "}" << endl;
+    out << indent() << "if err := oprot.WriteListEnd(ctx); err != nil {" << '\n';
+    out << indent() << "  return thrift.PrependError(\"error writing list end: \", err)" << '\n';
+    out << indent() << "}" << '\n';
   }
 }
 
@@ -3609,7 +3609,7 @@
       out << tgt << " != " << src;
     }
 
-    out << " { return false }" << endl;
+    out << " { return false }" << '\n';
   } else {
     throw "compiler error: Invalid type in generate_go_equals '" + ttype->get_name() + "' for '"
         + tgt + "'";
@@ -3625,7 +3625,7 @@
                                                string src) {
   (void)ttype;
   out << indent() << "if !" << tgt << "." << equals_method_name_ << "(" << src
-      << ") { return false }" << endl;
+      << ") { return false }" << '\n';
 }
 
 /**
@@ -3635,16 +3635,16 @@
                                                   t_type* ttype,
                                                   string tgt,
                                                   string src) {
-  out << indent() << "if len(" << tgt << ") != len(" << src << ") { return false }" << endl;
+  out << indent() << "if len(" << tgt << ") != len(" << src << ") { return false }" << '\n';
   if (ttype->is_map()) {
     t_map* tmap = (t_map*)ttype;
-    out << indent() << "for k, _tgt := range " << tgt << " {" << endl;
+    out << indent() << "for k, _tgt := range " << tgt << " {" << '\n';
     indent_up();
     string element_source = tmp("_src");
-    out << indent() << element_source << " := " << src << "[k]" << endl;
+    out << indent() << element_source << " := " << src << "[k]" << '\n';
     generate_go_equals(out, tmap->get_val_type(), "_tgt", element_source);
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   } else if (ttype->is_list() || ttype->is_set()) {
     t_type* elem;
     if (ttype->is_list()) {
@@ -3654,13 +3654,13 @@
       t_set* temp = (t_set*)ttype;
       elem = temp->get_elem_type();
     }
-    out << indent() << "for i, _tgt := range " << tgt << " {" << endl;
+    out << indent() << "for i, _tgt := range " << tgt << " {" << '\n';
     indent_up();
     string element_source = tmp("_src");
-    out << indent() << element_source << " := " << src << "[i]" << endl;
+    out << indent() << element_source << " := " << src << "[i]" << '\n';
     generate_go_equals(out, elem, "_tgt", element_source);
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   } else {
     throw "INVALID TYPE IN generate_go_equals_container '" + ttype->get_name();
   }
@@ -3699,7 +3699,7 @@
 
   if (fields.size() > 0) {
     if (has_doc) {
-      ss << endl;
+      ss << '\n';
     }
 
     has_doc = true;
@@ -3713,7 +3713,7 @@
       if (p->has_doc()) {
         ss << ": " << p->get_doc();
       } else {
-        ss << endl;
+        ss << '\n';
       }
     }
   }
diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.h b/compiler/cpp/src/thrift/generate/t_go_generator.h
index a67485c..55f544e 100644
--- a/compiler/cpp/src/thrift/generate/t_go_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_go_generator.h
@@ -44,8 +44,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 const string DEFAULT_THRIFT_IMPORT = "github.com/apache/thrift/lib/go/thrift";
 static std::string package_flag;
 
diff --git a/compiler/cpp/src/thrift/generate/t_gv_generator.cc b/compiler/cpp/src/thrift/generate/t_gv_generator.cc
index f8616ff..c91200b 100644
--- a/compiler/cpp/src/thrift/generate/t_gv_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_gv_generator.cc
@@ -38,8 +38,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Graphviz code generator
  */
@@ -110,10 +108,10 @@
   MKDIR(get_out_dir().c_str());
   string fname = get_out_dir() + program_->get_name() + ".gv";
   f_out_.open(fname.c_str());
-  f_out_ << "digraph \"" << escape_string(program_name_) << "\" {" << endl;
-  f_out_ << "node [style=filled, shape=record];" << endl;
-  f_out_ << "edge [arrowsize=0.5];" << endl;
-  f_out_ << "rankdir=LR" << endl;
+  f_out_ << "digraph \"" << escape_string(program_name_) << "\" {" << '\n';
+  f_out_ << "node [style=filled, shape=record];" << '\n';
+  f_out_ << "edge [arrowsize=0.5];" << '\n';
+  f_out_ << "rankdir=LR" << '\n';
 }
 
 /**
@@ -126,29 +124,29 @@
   // Print edges
   std::list<string>::iterator iter = edges.begin();
   for (; iter != edges.end(); iter++) {
-    f_out_ << (*iter) << endl;
+    f_out_ << (*iter) << '\n';
   }
 
   // Print graph end } and close file
-  f_out_ << "}" << endl;
+  f_out_ << "}" << '\n';
   f_out_.close();
 }
 
 void t_gv_generator::generate_typedef(t_typedef* ttypedef) {
   string name = ttypedef->get_name();
-  f_out_ << "node [fillcolor=azure];" << endl;
+  f_out_ << "node [fillcolor=azure];" << '\n';
   f_out_ << name << " [label=\"";
 
   f_out_ << escape_string(name);
   f_out_ << " :: ";
   print_type(ttypedef->get_type(), name);
 
-  f_out_ << "\"];" << endl;
+  f_out_ << "\"];" << '\n';
 }
 
 void t_gv_generator::generate_enum(t_enum* tenum) {
   string name = tenum->get_name();
-  f_out_ << "node [fillcolor=white];" << endl;
+  f_out_ << "node [fillcolor=white];" << '\n';
   f_out_ << name << " [label=\"enum " << escape_string(name);
 
   vector<t_enum_value*> values = tenum->get_constants();
@@ -159,13 +157,13 @@
     f_out_ << (*val_iter)->get_value();
   }
 
-  f_out_ << "\"];" << endl;
+  f_out_ << "\"];" << '\n';
 }
 
 void t_gv_generator::generate_const(t_const* tconst) {
   string name = tconst->get_name();
 
-  f_out_ << "node [fillcolor=aliceblue];" << endl;
+  f_out_ << "node [fillcolor=aliceblue];" << '\n';
   f_out_ << "const_" << name << " [label=\"";
 
   f_out_ << escape_string(name);
@@ -174,22 +172,22 @@
   f_out_ << " :: ";
   print_type(tconst->get_type(), "const_" + name);
 
-  f_out_ << "\"];" << endl;
+  f_out_ << "\"];" << '\n';
 }
 
 void t_gv_generator::generate_struct(t_struct* tstruct) {
   string name = tstruct->get_name();
 
   if (tstruct->is_xception()) {
-    f_out_ << "node [fillcolor=lightpink];" << endl;
+    f_out_ << "node [fillcolor=lightpink];" << '\n';
     f_out_ << name << " [label=\"";
     f_out_ << "exception " << escape_string(name);
   } else if (tstruct->is_union()) {
-    f_out_ << "node [fillcolor=lightcyan];" << endl;
+    f_out_ << "node [fillcolor=lightcyan];" << '\n';
     f_out_ << name << " [label=\"";
     f_out_ << "union " << escape_string(name);
   } else {
-    f_out_ << "node [fillcolor=beige];" << endl;
+    f_out_ << "node [fillcolor=beige];" << '\n';
     f_out_ << name << " [label=\"";
     f_out_ << "struct " << escape_string(name);
   }
@@ -208,7 +206,7 @@
     print_type((*mem_iter)->get_type(), name + ":field_" + field_name);
   }
 
-  f_out_ << "\"];" << endl;
+  f_out_ << "\"];" << '\n';
 }
 
 void t_gv_generator::print_type(t_type* ttype, string struct_field_ref) {
@@ -296,10 +294,10 @@
 
 void t_gv_generator::generate_service(t_service* tservice) {
   string service_name = get_service_name(tservice);
-  f_out_ << "subgraph cluster_" << service_name << " {" << endl;
-  f_out_ << "node [fillcolor=bisque];" << endl;
-  f_out_ << "style=dashed;" << endl;
-  f_out_ << "label = \"" << escape_string(service_name) << " service\";" << endl;
+  f_out_ << "subgraph cluster_" << service_name << " {" << '\n';
+  f_out_ << "node [fillcolor=bisque];" << '\n';
+  f_out_ << "style=dashed;" << '\n';
+  f_out_ << "label = \"" << escape_string(service_name) << " service\";" << '\n';
 
   // TODO: service extends
 
@@ -327,7 +325,7 @@
                  "function_" + service_name + fn_name + ":param_" + (*arg_iter)->get_name());
     }
     // end of node
-    f_out_ << "\"];" << endl;
+    f_out_ << "\"];" << '\n';
 
     // Exception edges
     if (exception_arrows) {
@@ -340,7 +338,7 @@
     }
   }
 
-  f_out_ << " }" << endl;	
+  f_out_ << " }" << '\n';
 }
 
 std::string t_gv_generator::display_name() const {
diff --git a/compiler/cpp/src/thrift/generate/t_haxe_generator.cc b/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
index b236e0b..40d4ce2 100644
--- a/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_haxe_generator.cc
@@ -37,8 +37,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Haxe code generator.
  *
@@ -424,10 +422,10 @@
   f_enum.open(f_enum_name.c_str());
 
   // Comment and package it
-  f_enum << autogen_comment() << haxe_package() << ";" << endl << endl;
+  f_enum << autogen_comment() << haxe_package() << ";" << '\n' << '\n';
 
   // Add haxe imports
-  f_enum << string() + "import org.apache.thrift.helper.*;" << endl << endl;
+  f_enum << string() + "import org.apache.thrift.helper.*;" << '\n' << '\n';
 
   generate_rtti_decoration(f_enum);
   generate_macro_decoration(f_enum);
@@ -439,11 +437,11 @@
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     indent(f_enum) << "public static inline var " << (*c_iter)->get_name() << " : Int = " << value
-                   << ";" << endl;
+                   << ";" << '\n';
   }
 
   // Create a static Set with all valid values for this enum
-  f_enum << endl;
+  f_enum << '\n';
 
   indent(f_enum) << "public static var VALID_VALUES = { new IntSet( [";
   indent_up();
@@ -454,19 +452,19 @@
     firstValue = false;
   }
   indent_down();
-  f_enum << "]); };" << endl;
+  f_enum << "]); };" << '\n';
 
   indent(f_enum) << "public static var VALUES_TO_NAMES = { [";
   indent_up();
   firstValue = true;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    f_enum << (firstValue ? "" : ",") << endl;
+    f_enum << (firstValue ? "" : ",") << '\n';
     indent(f_enum) << (*c_iter)->get_name() << " => \"" << (*c_iter)->get_name() << "\"";
     firstValue = false;
   }
-  f_enum << endl;
+  f_enum << '\n';
   indent_down();
-  indent(f_enum) << "]; };" << endl;
+  indent(f_enum) << "]; };" << '\n';
 
   scope_down(f_enum); // end class
 
@@ -486,15 +484,15 @@
   f_consts.open(f_consts_name.c_str());
 
   // Print header
-  f_consts << autogen_comment() << haxe_package() << ";" << endl << endl;
+  f_consts << autogen_comment() << haxe_package() << ";" << '\n' << '\n';
 
-  f_consts << endl;
+  f_consts << '\n';
 
   f_consts << haxe_type_imports();
 
   generate_rtti_decoration(f_consts);
   generate_macro_decoration(f_consts);
-  indent(f_consts) << "class " << get_cap_name(program_name_) << "Constants {" << endl << endl;
+  indent(f_consts) << "class " << get_cap_name(program_name_) << "Constants {" << '\n' << '\n';
   indent_up();
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
@@ -504,7 +502,7 @@
                       (*c_iter)->get_value());
   }
   indent_down();
-  indent(f_consts) << "}" << endl;
+  indent(f_consts) << "}" << '\n';
   f_consts.close();
 }
 
@@ -527,7 +525,7 @@
   }
   out << " : " << get_cap_name(type_name(type)) << " = ";
   render_const_value(out, type, value);
-  out << ";" << endl << endl;
+  out << ";" << '\n' << '\n';
 }
 
 std::string t_haxe_generator::render_const_value_str( t_type* type, t_const_value* value) {
@@ -594,9 +592,9 @@
 void t_haxe_generator::render_struct_initializer(std::ostream& out,
                                                  t_struct* type,
                                                  t_const_value* value) {
-  out << "(function() : " << get_cap_name(type_name(type)) << " {" << endl;
+  out << "(function() : " << get_cap_name(type_name(type)) << " {" << '\n';
   indent_up();
-  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << endl; 
+  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << '\n';
 
   const vector<t_field*>& fields = ((t_struct*)type)->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -615,24 +613,24 @@
     }
     indent(out) << "tmp." << v_iter->first->get_string() << " = ";
     render_const_value(out, field_type, v_iter->second);
-    out << ";" << endl;
+    out << ";" << '\n';
   }
 
-  indent(out) << "return tmp;" << endl; 
+  indent(out) << "return tmp;" << '\n';
   indent_down();
-  indent(out) << "})()";  // no endl
+  indent(out) << "})()";  // no line break
 }
 
 void t_haxe_generator::render_map_initializer(std::ostream& out,
                                               t_map* type,
                                               t_const_value* value) {
-  out << "(function() : " << get_cap_name(type_name(type)) << " {" << endl;
+  out << "(function() : " << get_cap_name(type_name(type)) << " {" << '\n';
   indent_up();
-  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << endl; 
+  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << '\n';
 
   t_type* key_type = ((t_map*)type)->get_key_type();
   t_type* val_type = ((t_map*)type)->get_val_type();
-  
+
   const map<t_const_value*, t_const_value*, t_const_value::value_compare>& values = value->get_map();
   map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
   for (v_iter = values.begin(); v_iter != values.end(); ++v_iter) {
@@ -640,56 +638,56 @@
     render_const_value(out, key_type, v_iter->first);
     out << ", ";
     render_const_value(out, val_type, v_iter->second);
-    out << ");" << endl;
+    out << ");" << '\n';
   }
- 
-  indent(out) << "return tmp;" << endl; 
+
+  indent(out) << "return tmp;" << '\n';
   indent_down();
-  indent(out) << "})()";  // no endl
+  indent(out) << "})()";  // no line break
 }
 
 void t_haxe_generator::render_list_initializer(std::ostream& out,
                                                t_list* type,
                                                t_const_value* value) {
-  out << "(function() : " << get_cap_name(type_name(type)) << " {" << endl;
+  out << "(function() : " << get_cap_name(type_name(type)) << " {" << '\n';
   indent_up();
-  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << endl; 
+  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << '\n';
 
   t_type* elm_type = type->get_elem_type();
-  
+
   const vector<t_const_value*>& values = value->get_list();
   vector<t_const_value*>::const_iterator v_iter;
   for (v_iter = values.begin(); v_iter != values.end(); ++v_iter) {
     indent(out) << "tmp.add(";
     render_const_value(out, elm_type, *v_iter);
-    out << ");" << endl;
+    out << ");" << '\n';
   }
- 
-  indent(out) << "return tmp;" << endl; 
+
+  indent(out) << "return tmp;" << '\n';
   indent_down();
-  indent(out) << "})()";  // no endl
+  indent(out) << "})()";  // no line break
 }
 
 void t_haxe_generator::render_set_initializer(std::ostream& out,
                                               t_set* type,
                                               t_const_value* value) {
-  out << "(function() : " << get_cap_name(type_name(type)) << " {" << endl;
+  out << "(function() : " << get_cap_name(type_name(type)) << " {" << '\n';
   indent_up();
-  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << endl; 
+  indent(out) << "var tmp = new " << get_cap_name(type_name(type)) <<  "();" << '\n';
 
   t_type* elm_type = type->get_elem_type();
-  
+
   const vector<t_const_value*>& values = value->get_list();
   vector<t_const_value*>::const_iterator v_iter;
   for (v_iter = values.begin(); v_iter != values.end(); ++v_iter) {
     indent(out) << "tmp.add(";
     render_const_value(out, elm_type, *v_iter);
-    out << ");" << endl;
+    out << ");" << '\n';
   }
-  
-  indent(out) << "return tmp;" << endl; 
+
+  indent(out) << "return tmp;" << '\n';
   indent_down();
-  indent(out) << "})()";  // no endl
+  indent(out) << "})()";  // no line break
 }
 
 
@@ -723,14 +721,14 @@
   ofstream_with_content_based_conditional_update f_struct;
   f_struct.open(f_struct_name.c_str());
 
-  f_struct << autogen_comment() << haxe_package() << ";" << endl;
+  f_struct << autogen_comment() << haxe_package() << ";" << '\n';
 
-  f_struct << endl;
+  f_struct << '\n';
 
   string imports;
 
   f_struct << haxe_type_imports() << haxe_thrift_imports()
-           << haxe_thrift_gen_imports(tstruct, imports) << endl;
+           << haxe_thrift_gen_imports(tstruct, imports) << '\n';
 
   generate_haxe_struct_definition(f_struct, tstruct, is_exception, is_result);
 
@@ -762,11 +760,11 @@
   if (is_exception) {
     out << "extends TException ";
   }
-  out << "implements TBase {" << endl << endl;
+  out << "implements TBase {" << '\n' << '\n';
   indent_up();
 
   indent(out) << "static var STRUCT_DESC = { new TStruct(\"" << tstruct->get_name() << "\"); };"
-              << endl;
+              << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
@@ -775,69 +773,69 @@
     indent(out) << "static var " << constant_name((*m_iter)->get_name())
                 << "_FIELD_DESC = { new TField(\"" << (*m_iter)->get_name() << "\", "
                 << type_to_enum((*m_iter)->get_type()) << ", " << (*m_iter)->get_key() << "); };"
-                << endl;
+                << '\n';
   }
-  out << endl;
+  out << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     generate_haxe_doc(out, *m_iter);
     // indent(out) << "private var _" << (*m_iter)->get_name() + " : " +
-    // type_name((*m_iter)->get_type()) << ";" << endl;
-    indent(out) << "@:isVar" << endl;
+    // type_name((*m_iter)->get_type()) << ";" << '\n';
+    indent(out) << "@:isVar" << '\n';
     indent(out) << "public var "
                 << (*m_iter)->get_name() + "(get,set) : "
-                   + get_cap_name(type_name((*m_iter)->get_type())) << ";" << endl;
+                   + get_cap_name(type_name((*m_iter)->get_type())) << ";" << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     indent(out) << "inline static var " << upcase_string((*m_iter)->get_name())
-                << "_FIELD_ID : Int = " << (*m_iter)->get_key() << ";" << endl;
+                << "_FIELD_ID : Int = " << (*m_iter)->get_key() << ";" << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   // Inner Isset class
   if (members.size() > 0) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if (!type_can_be_null((*m_iter)->get_type())) {
         indent(out) << "private var __isset_" << (*m_iter)->get_name() << " : Bool = false;"
-                    << endl;
+                    << '\n';
       }
     }
   }
 
-  out << endl;
+  out << '\n';
 
   // Static initializer to populate global class to struct metadata map
   if (false) {
     // TODO: reactivate when needed
     generate_haxe_meta_data_map(out, tstruct);
-    indent(out) << "{" << endl;
+    indent(out) << "{" << '\n';
     indent_up();
     indent(out) << "FieldMetaData.addStructMetaDataMap(" << type_name(tstruct) << ", metaDataMap);"
-                << endl;
+                << '\n';
     indent_down();
-    indent(out) << "}" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
+    indent(out) << "}" << '\n';
   }
 
   // Default constructor
-  indent(out) << "public function new() {" << endl;
+  indent(out) << "public function new() {" << '\n';
   indent_up();
   if (is_exception) {
-    indent(out) << "super();" << endl;
+    indent(out) << "super();" << '\n';
   }
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     if ((*m_iter)->get_value() != nullptr) {
       indent(out) << "this." << (*m_iter)->get_name() << " = ";
       render_const_value( out, (*m_iter)->get_type(), (*m_iter)->get_value());
-      out << ";" << endl;
+      out << ";" << '\n';
     }
   }
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   generate_property_getters_setters(out, tstruct);
   generate_generic_field_getters_setters(out, tstruct);
@@ -852,7 +850,7 @@
   generate_haxe_struct_tostring(out, tstruct, is_exception);
   generate_haxe_validator(out, tstruct);
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -861,123 +859,123 @@
  * @param tstruct The struct definition
  */
 void t_haxe_generator::generate_haxe_struct_reader(ostream& out, t_struct* tstruct) {
-  out << indent() << "public function read( iprot : TProtocol) : Void {" << endl;
+  out << indent() << "public function read( iprot : TProtocol) : Void {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "iprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
+  indent(out) << "iprot.IncrementRecursionDepth();" << '\n';
+  indent(out) << "try" << '\n';
   scope_up(out);
 
   // Declare stack tmp variables and read struct header
-  out << indent() << "var field : TField;" << endl << indent() << "iprot.readStructBegin();"
-      << endl;
+  out << indent() << "var field : TField;" << '\n' << indent() << "iprot.readStructBegin();"
+      << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
+  indent(out) << "while (true)" << '\n';
   scope_up(out);
 
   // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
+  indent(out) << "field = iprot.readFieldBegin();" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if (field.type == TType.STOP) { " << endl;
+  indent(out) << "if (field.type == TType.STOP) { " << '\n';
   indent_up();
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Switch statement on the field we are reading
-  indent(out) << "switch (field.id)" << endl;
+  indent(out) << "switch (field.id)" << '\n';
 
   scope_up(out);
 
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << "_FIELD_ID:" << endl;
+    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << "_FIELD_ID:" << '\n';
     indent_up();
-    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
     indent_up();
 
     generate_deserialize_field(out, *f_iter, "this.");
     generate_isset_set(out, *f_iter);
     indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-        << endl << indent() << "}" << endl;
+    out << indent() << "} else { " << '\n' << indent() << "  TProtocolUtil.skip(iprot, field.type);"
+        << '\n' << indent() << "}" << '\n';
     indent_down();
   }
 
   // In the default case we skip the field
-  out << indent() << "default:" << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-      << endl;
+  out << indent() << "default:" << '\n' << indent() << "  TProtocolUtil.skip(iprot, field.type);"
+      << '\n';
 
   scope_down(out);
 
   // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
+  indent(out) << "iprot.readFieldEnd();" << '\n';
 
   scope_down(out);
 
-  out << indent() << "iprot.readStructEnd();" << endl << endl;
+  out << indent() << "iprot.readStructEnd();" << '\n' << '\n';
 
-  indent(out) << "iprot.DecrementRecursionDepth();" << endl;
+  indent(out) << "iprot.DecrementRecursionDepth();" << '\n';
   scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
+  indent(out) << "catch(e:Dynamic)" << '\n';
   scope_up(out);
-  indent(out) << "iprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
+  indent(out) << "iprot.DecrementRecursionDepth();" << '\n';
+  indent(out) << "throw e;" << '\n';
   scope_down(out);
 
   // check for required fields of primitive type
   // (which can be checked here but not in the general validate method)
-  out << endl << indent() << "// check for required fields of primitive type, which can't be "
-                             "checked in the validate method" << endl;
+  out << '\n' << indent() << "// check for required fields of primitive type, which can't be "
+                             "checked in the validate method" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
-      out << indent() << "if (!__isset_" << (*f_iter)->get_name() << ") {" << endl << indent()
+      out << indent() << "if (!__isset_" << (*f_iter)->get_name() << ") {" << '\n' << indent()
           << "  throw new TProtocolException(TProtocolException.UNKNOWN, \"Required field '"
           << (*f_iter)->get_name()
-          << "' was not found in serialized data! Struct: \" + toString());" << endl << indent()
-          << "}" << endl;
+          << "' was not found in serialized data! Struct: \" + toString());" << '\n' << indent()
+          << "}" << '\n';
     }
   }
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
+  indent(out) << "validate();" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 // generates haxe method to perform various checks
 // (e.g. check that all required fields are set)
 void t_haxe_generator::generate_haxe_validator(ostream& out, t_struct* tstruct) {
-  indent(out) << "public function validate() : Void {" << endl;
+  indent(out) << "public function validate() : Void {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out << indent() << "// check for required fields" << endl;
+  out << indent() << "// check for required fields" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       if (type_can_be_null((*f_iter)->get_type())) {
-        indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
+        indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << '\n';
         indent(out)
             << "  throw new TProtocolException(TProtocolException.UNKNOWN, \"Required field '"
-            << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << endl;
-        indent(out) << "}" << endl;
+            << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << '\n';
+        indent(out) << "}" << '\n';
       } else {
         indent(out) << "// alas, we cannot check '" << (*f_iter)->get_name()
-                    << "' because it's a primitive." << endl;
+                    << "' because it's a primitive." << '\n';
       }
     }
   }
 
   // check that fields of type enum have valid values
-  out << indent() << "// check that fields of type enum have valid values" << endl;
+  out << indent() << "// check that fields of type enum have valid values" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = (*f_iter);
     t_type* type = field->get_type();
@@ -985,18 +983,18 @@
     if (type->is_enum()) {
       indent(out) << "if (" << generate_isset_check(field) << " && !"
                   << get_cap_name(get_enum_class_name(type)) << ".VALID_VALUES.contains("
-                  << field->get_name() << ")){" << endl;
+                  << field->get_name() << ")){" << '\n';
       indent_up();
       indent(out) << "throw new TProtocolException(TProtocolException.UNKNOWN, \"The field '"
                   << field->get_name() << "' has been assigned the invalid value \" + "
-                  << field->get_name() << ");" << endl;
+                  << field->get_name() << ");" << '\n';
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1005,7 +1003,7 @@
  * @param tstruct The struct definition
  */
 void t_haxe_generator::generate_haxe_struct_writer(ostream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol) : Void {" << endl;
+  out << indent() << "public function write(oprot:TProtocol) : Void {" << '\n';
   indent_up();
 
   string name = tstruct->get_name();
@@ -1013,57 +1011,57 @@
   vector<t_field*>::const_iterator f_iter;
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
-  indent(out) << "oprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
+  indent(out) << "validate();" << '\n';
+  indent(out) << "oprot.IncrementRecursionDepth();" << '\n';
+  indent(out) << "try" << '\n';
   scope_up(out);
 
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
     if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
+      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << '\n';
       indent_up();
     }
     bool null_allowed = type_can_be_null((*f_iter)->get_type());
     if (null_allowed) {
-      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << endl;
+      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << '\n';
       indent_up();
     }
 
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     if (null_allowed) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     if (could_be_unset) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
-  indent(out) << "oprot.writeFieldStop();" << endl;
-  indent(out) << "oprot.writeStructEnd();" << endl;
+  indent(out) << "oprot.writeFieldStop();" << '\n';
+  indent(out) << "oprot.writeStructEnd();" << '\n';
 
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
+  indent(out) << "oprot.DecrementRecursionDepth();" << '\n';
   scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
+  indent(out) << "catch(e:Dynamic)" << '\n';
   scope_up(out);
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
+  indent(out) << "oprot.DecrementRecursionDepth();" << '\n';
+  indent(out) << "throw e;" << '\n';
   scope_down(out);
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1075,59 +1073,59 @@
  * @param tstruct The struct definition
  */
 void t_haxe_generator::generate_haxe_struct_result_writer(ostream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol) : Void {" << endl;
+  out << indent() << "public function write(oprot:TProtocol) : Void {" << '\n';
   indent_up();
 
   string name = tstruct->get_name();
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "oprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
+  indent(out) << "oprot.IncrementRecursionDepth();" << '\n';
+  indent(out) << "try" << '\n';
   scope_up(out);
 
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << '\n';
 
   bool first = true;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (first) {
       first = false;
-      out << endl << indent() << "if ";
+      out << '\n' << indent() << "if ";
     } else {
       out << " else if ";
     }
 
-    out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
+    out << "(this." << generate_isset_check(*f_iter) << ") {" << '\n';
 
     indent_up();
 
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     indent_down();
     indent(out) << "}";
   }
 
-  indent(out) << endl;
-  indent(out) << "oprot.writeFieldStop();" << endl;
-  indent(out) << "oprot.writeStructEnd();" << endl;
+  indent(out) << '\n';
+  indent(out) << "oprot.writeFieldStop();" << '\n';
+  indent(out) << "oprot.writeStructEnd();" << '\n';
 
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
+  indent(out) << "oprot.DecrementRecursionDepth();" << '\n';
   scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
+  indent(out) << "catch(e:Dynamic)" << '\n';
   scope_up(out);
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
+  indent(out) << "oprot.DecrementRecursionDepth();" << '\n';
+  indent(out) << "throw e;" << '\n';
   scope_down(out);
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 void t_haxe_generator::generate_reflection_getters(ostringstream& out,
@@ -1136,9 +1134,9 @@
                                                    string cap_name) {
   (void)type;
   (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << endl;
+  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << '\n';
   indent_up();
-  indent(out) << "return this." << field_name << ";" << endl;
+  indent(out) << "return this." << field_name << ";" << '\n';
   indent_down();
 }
 
@@ -1148,13 +1146,13 @@
                                                    string cap_name) {
   (void)type;
   (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << endl;
+  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << '\n';
   indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  this." << field_name << " = value;" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "if (value == null) {" << '\n';
+  indent(out) << "  unset" << get_cap_name(field_name) << "();" << '\n';
+  indent(out) << "} else {" << '\n';
+  indent(out) << "  this." << field_name << " = value;" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   indent_down();
 }
@@ -1181,39 +1179,39 @@
   }
 
   // create the setter
-  indent(out) << "public function setFieldValue(fieldID : Int, value : Dynamic) : Void {" << endl;
+  indent(out) << "public function setFieldValue(fieldID : Int, value : Dynamic) : Void {" << '\n';
   indent_up();
 
   if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
+    indent(out) << "switch (fieldID) {" << '\n';
     out << setter_stream.str();
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "default:" << '\n';
+    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
+    indent(out) << "}" << '\n';
   } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
+    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   // create the getter
-  indent(out) << "public function getFieldValue(fieldID : Int) : Dynamic {" << endl;
+  indent(out) << "public function getFieldValue(fieldID : Int) : Dynamic {" << '\n';
   indent_up();
 
   if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
+    indent(out) << "switch (fieldID) {" << '\n';
     out << getter_stream.str();
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "default:" << '\n';
+    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
+    indent(out) << "}" << '\n';
   } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
+    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
   }
 
   indent_down();
 
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 // Creates a generic isSet method that takes the field number as argument
@@ -1223,29 +1221,29 @@
 
   // create the isSet method
   indent(out) << "// Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise" << endl;
-  indent(out) << "public function isSet(fieldID : Int) : Bool {" << endl;
+                 "value) and false otherwise" << '\n';
+  indent(out) << "public function isSet(fieldID : Int) : Bool {" << '\n';
   indent_up();
   if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
+    indent(out) << "switch (fieldID) {" << '\n';
 
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       t_field* field = *f_iter;
-      indent(out) << "case " << upcase_string(field->get_name()) << "_FIELD_ID:" << endl;
+      indent(out) << "case " << upcase_string(field->get_name()) << "_FIELD_ID:" << '\n';
       indent_up();
-      indent(out) << "return " << generate_isset_check(field) << ";" << endl;
+      indent(out) << "return " << generate_isset_check(field) << ";" << '\n';
       indent_down();
     }
 
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "default:" << '\n';
+    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
+    indent(out) << "}" << '\n';
   } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
+    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << '\n';
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1265,48 +1263,48 @@
     // Simple getter
     generate_haxe_doc(out, field);
     indent(out) << "public function get_" << field_name << "() : " << get_cap_name(type_name(type))
-                << " {" << endl;
+                << " {" << '\n';
     indent_up();
-    indent(out) << "return this." << field_name << ";" << endl;
+    indent(out) << "return this." << field_name << ";" << '\n';
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // Simple setter
     generate_haxe_doc(out, field);
     indent(out) << "public function set_" << field_name << "(" << field_name << ":"
                 << get_cap_name(type_name(type)) << ") : " << get_cap_name(type_name(type)) << " {"
-                << endl;
+                << '\n';
     indent_up();
-    indent(out) << "this." << field_name << " = " << field_name << ";" << endl;
+    indent(out) << "this." << field_name << " = " << field_name << ";" << '\n';
     generate_isset_set(out, field);
-    indent(out) << "return this." << field_name << ";" << endl;
+    indent(out) << "return this." << field_name << ";" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // Unsetter
-    indent(out) << "public function unset" << cap_name << "() : Void {" << endl;
+    indent(out) << "public function unset" << cap_name << "() : Void {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
+      indent(out) << "this." << field_name << " = null;" << '\n';
     } else {
-      indent(out) << "this.__isset_" << field_name << " = false;" << endl;
+      indent(out) << "this.__isset_" << field_name << " = false;" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // isSet method
     indent(out) << "// Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise" << endl;
-    indent(out) << "public function is" << get_cap_name("set") << cap_name << "() : Bool {" << endl;
+                << " is set (has been assigned a value) and false otherwise" << '\n';
+    indent(out) << "public function is" << get_cap_name("set") << cap_name << "() : Bool {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "return this." << field_name << " != null;" << endl;
+      indent(out) << "return this." << field_name << " != null;" << '\n';
     } else {
-      indent(out) << "return this.__isset_" << field_name << ";" << endl;
+      indent(out) << "return this.__isset_" << field_name << ";" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 }
 
@@ -1320,11 +1318,11 @@
   if( is_override) {
     out << "override ";
   }
-  out << "function toString() : String {" << endl;
+  out << "function toString() : String {" << '\n';
   indent_up();
 
-  out << indent() << "var ret : String = \"" << tstruct->get_name() << "(\";" << endl;
-  out << indent() << "var first : Bool = true;" << endl << endl;
+  out << indent() << "var ret : String = \"" << tstruct->get_name() << "(\";" << '\n';
+  out << indent() << "var first : Bool = true;" << '\n' << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -1332,58 +1330,58 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
     if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
+      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << '\n';
       indent_up();
     }
 
     t_field* field = (*f_iter);
 
     if (!first) {
-      indent(out) << "if (!first) ret +=  \", \";" << endl;
+      indent(out) << "if (!first) ret +=  \", \";" << '\n';
     }
-    indent(out) << "ret += \"" << (*f_iter)->get_name() << ":\";" << endl;
+    indent(out) << "ret += \"" << (*f_iter)->get_name() << ":\";" << '\n';
     bool can_be_null = type_can_be_null(field->get_type());
     if (can_be_null) {
-      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << endl;
-      indent(out) << "  ret += \"null\";" << endl;
-      indent(out) << "} else {" << endl;
+      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << '\n';
+      indent(out) << "  ret += \"null\";" << '\n';
+      indent(out) << "} else {" << '\n';
       indent_up();
     }
 
     if (field->get_type()->is_binary()) {
-      indent(out) << "  ret += \"BINARY\";" << endl;
+      indent(out) << "  ret += \"BINARY\";" << '\n';
     } else if (field->get_type()->is_enum()) {
       indent(out) << "var " << field->get_name()
                   << "_name : String = " << get_cap_name(get_enum_class_name(field->get_type()))
-                  << ".VALUES_TO_NAMES[this." << (*f_iter)->get_name() << "];" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += " << field->get_name() << "_name;" << endl;
-      indent(out) << "  ret += \" (\";" << endl;
-      indent(out) << "}" << endl;
-      indent(out) << "ret += this." << field->get_name() << ";" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += \")\";" << endl;
-      indent(out) << "}" << endl;
+                  << ".VALUES_TO_NAMES[this." << (*f_iter)->get_name() << "];" << '\n';
+      indent(out) << "if (" << field->get_name() << "_name != null) {" << '\n';
+      indent(out) << "  ret += " << field->get_name() << "_name;" << '\n';
+      indent(out) << "  ret += \" (\";" << '\n';
+      indent(out) << "}" << '\n';
+      indent(out) << "ret += this." << field->get_name() << ";" << '\n';
+      indent(out) << "if (" << field->get_name() << "_name != null) {" << '\n';
+      indent(out) << "  ret += \")\";" << '\n';
+      indent(out) << "}" << '\n';
     } else {
-      indent(out) << "ret += this." << (*f_iter)->get_name() << ";" << endl;
+      indent(out) << "ret += this." << (*f_iter)->get_name() << ";" << '\n';
     }
 
     if (can_be_null) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    indent(out) << "first = false;" << endl;
+    indent(out) << "first = false;" << '\n';
 
     if (could_be_unset) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     first = false;
   }
-  out << indent() << "ret += \")\";" << endl << indent() << "return ret;" << endl;
+  out << indent() << "ret += \")\";" << '\n' << indent() << "return ret;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1397,7 +1395,7 @@
   vector<t_field*>::const_iterator f_iter;
 
   // Static Map with fieldID -> FieldMetaData mappings
-  indent(out) << "inline static var metaDataMap : IntMap = new IntMap();" << endl;
+  indent(out) << "inline static var metaDataMap : IntMap = new IntMap();" << '\n';
 
   if (fields.size() > 0) {
     // Populate map
@@ -1419,7 +1417,7 @@
 
       // Create value meta data
       generate_field_value_meta_data(out, field->get_type());
-      out << ");" << endl;
+      out << ");" << '\n';
     }
     scope_down(out);
   }
@@ -1484,7 +1482,7 @@
 }
 
 void t_haxe_generator::generate_field_value_meta_data(std::ostream& out, t_type* type) {
-  out << endl;
+  out << '\n';
   indent_up();
   indent_up();
   if (type->is_struct()) {
@@ -1527,20 +1525,20 @@
   string f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + "_service.hx";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl;
+  f_service_ << autogen_comment() << haxe_package() << ";" << '\n';
 
-  f_service_ << endl << haxe_type_imports() << haxe_thrift_imports()
+  f_service_ << '\n' << haxe_type_imports() << haxe_thrift_imports()
              << haxe_thrift_gen_imports(tservice);
 
   if (tservice->get_extends() != nullptr) {
     t_type* parent = tservice->get_extends();
     string parent_namespace = make_package_name( parent->get_program()->get_namespace("haxe"));
     if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << get_cap_name(type_name(parent)) << "_service;" << endl;
+      f_service_ << "import " << get_cap_name(type_name(parent)) << "_service;" << '\n';
     }
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   generate_service_interface(tservice,false);
   f_service_.close();
@@ -1549,20 +1547,20 @@
   f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + ".hx";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl;
+  f_service_ << autogen_comment() << haxe_package() << ";" << '\n';
 
-  f_service_ << endl << haxe_type_imports() << haxe_thrift_imports()
+  f_service_ << '\n' << haxe_type_imports() << haxe_thrift_imports()
              << haxe_thrift_gen_imports(tservice);
 
   if (tservice->get_extends() != nullptr) {
     t_type* parent = tservice->get_extends();
     string parent_namespace = make_package_name( parent->get_program()->get_namespace("haxe"));
     if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << get_cap_name(type_name(parent)) << ";" << endl;
+      f_service_ << "import " << get_cap_name(type_name(parent)) << ";" << '\n';
     }
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   generate_service_interface(tservice,true);
   f_service_.close();
@@ -1571,18 +1569,18 @@
   f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + "Impl.hx";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl << endl << haxe_type_imports()
-             << haxe_thrift_imports() << haxe_thrift_gen_imports(tservice) << endl;
+  f_service_ << autogen_comment() << haxe_package() << ";" << '\n' << '\n' << haxe_type_imports()
+             << haxe_thrift_imports() << haxe_thrift_gen_imports(tservice) << '\n';
 
   if (tservice->get_extends() != nullptr) {
     t_type* parent = tservice->get_extends();
     string parent_namespace = make_package_name( parent->get_program()->get_namespace("haxe"));
     if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << get_cap_name(type_name(parent)) << "Impl;" << endl;
+      f_service_ << "import " << get_cap_name(type_name(parent)) << "Impl;" << '\n';
     }
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   generate_service_client(tservice);
   f_service_.close();
@@ -1594,17 +1592,17 @@
   f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + "Processor.hx";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl 
-             << endl 
+  f_service_ << autogen_comment() << haxe_package() << ";" << '\n'
+             << '\n'
              << haxe_type_imports()
-             << haxe_thrift_imports() 
-             << haxe_thrift_gen_imports(tservice) 
-             << endl;
+             << haxe_thrift_imports()
+             << haxe_thrift_gen_imports(tservice)
+             << '\n';
 
   if (!package_name_.empty()) {
-    f_service_ << "import " << package_name_ << ".*;" << endl;
-    f_service_ << "import " << package_name_ << "." << get_cap_name(service_name_).c_str() << "Impl;" << endl;
-    f_service_ << endl;
+    f_service_ << "import " << package_name_ << ".*;" << '\n';
+    f_service_ << "import " << package_name_ << "." << get_cap_name(service_name_).c_str() << "Impl;" << '\n';
+    f_service_ << '\n';
   }
 
   generate_service_server(tservice);
@@ -1668,9 +1666,9 @@
                                                                 bool is_interface) {
   if (is_interface) {
     generate_deprecation_attribute(f_service_, tfunction, true);
-    indent(f_service_) << function_signature_normal(tfunction) << ";" << endl << endl;
+    indent(f_service_) << function_signature_normal(tfunction) << ";" << '\n' << '\n';
   } else {
-    indent(f_service_) << "public " << function_signature_normal(tfunction) << " {" << endl;
+    indent(f_service_) << "public " << function_signature_normal(tfunction) << " {" << '\n';
   }
 }
 
@@ -1683,15 +1681,15 @@
                                                                   bool is_interface) {
   if (!tfunction->is_oneway()) {
     std::string on_success_impl = generate_service_method_onsuccess(tfunction, false, false);
-    indent(f_service_) << "// function onError(Dynamic) : Void;" << endl;
-    indent(f_service_) << "// function " << on_success_impl.c_str() << ";" << endl;
+    indent(f_service_) << "// function onError(Dynamic) : Void;" << '\n';
+    indent(f_service_) << "// function " << on_success_impl.c_str() << ";" << '\n';
   }
 
   if (is_interface) {
     generate_deprecation_attribute(f_service_, tfunction, false);
-    indent(f_service_) << function_signature_combined(tfunction) << ";" << endl << endl;
+    indent(f_service_) << function_signature_combined(tfunction) << ";" << '\n' << '\n';
   } else {
-    indent(f_service_) << "public " << function_signature_combined(tfunction) << " {" << endl;
+    indent(f_service_) << "public " << function_signature_combined(tfunction) << " {" << '\n';
   }
 }
 
@@ -1738,7 +1736,7 @@
       }
     }
 
-    out << endl;
+    out << '\n';
   }
 }
 
@@ -1762,14 +1760,14 @@
   generate_rtti_decoration(f_service_);
   generate_macro_decoration(f_service_);
   f_service_ << indent() << "interface " << get_cap_name(service_name_) << cbk_postfix << extends_iface << " {"
-             << endl << endl;
+             << '\n' << '\n';
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_haxe_doc(f_service_, *f_iter);
     generate_service_method_signature(*f_iter, true, combined);
   }
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1778,7 +1776,7 @@
  * @param tservice The service
  */
 void t_haxe_generator::generate_service_helpers(t_service* tservice) {
-  f_service_ << endl << endl;
+  f_service_ << '\n' << '\n';
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1804,44 +1802,44 @@
   generate_rtti_decoration(f_service_);
   // build macro is inherited from interface
   indent(f_service_) << "class " << get_cap_name(service_name_) << "Impl" << extends_client
-                     << " implements " << get_cap_name(service_name_) << " {" << endl << endl;
+                     << " implements " << get_cap_name(service_name_) << " {" << '\n' << '\n';
   indent_up();
 
-  indent(f_service_) << "public function new( iprot : TProtocol, oprot : TProtocol = null)" << endl;
+  indent(f_service_) << "public function new( iprot : TProtocol, oprot : TProtocol = null)" << '\n';
   scope_up(f_service_);
   if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl;
-    f_service_ << indent() << "if (oprot == null) {" << endl;
+    f_service_ << indent() << "iprot_ = iprot;" << '\n';
+    f_service_ << indent() << "if (oprot == null) {" << '\n';
     indent_up();
-    f_service_ << indent() << "oprot_ = iprot;" << endl;
+    f_service_ << indent() << "oprot_ = iprot;" << '\n';
     indent_down();
-    f_service_ << indent() << "} else {" << endl;
+    f_service_ << indent() << "} else {" << '\n';
     indent_up();
-    f_service_ << indent() << "oprot_ = oprot;" << endl;
+    f_service_ << indent() << "oprot_ = oprot;" << '\n';
     indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << indent() << "}" << '\n';
   } else {
-    f_service_ << indent() << "super(iprot, oprot);" << endl;
+    f_service_ << indent() << "super(iprot, oprot);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   if (extends.empty()) {
-    f_service_ << indent() << "private var iprot_ : TProtocol;" << endl << indent()
-               << "private var oprot_ : TProtocol;" << endl << indent()
-               << "private var seqid_ : Int;" << endl << endl;
+    f_service_ << indent() << "private var iprot_ : TProtocol;" << '\n' << indent()
+               << "private var oprot_ : TProtocol;" << '\n' << indent()
+               << "private var seqid_ : Int;" << '\n' << '\n';
 
-    indent(f_service_) << "public function getInputProtocol() : TProtocol" << endl;
+    indent(f_service_) << "public function getInputProtocol() : TProtocol" << '\n';
     scope_up(f_service_);
-    indent(f_service_) << "return this.iprot_;" << endl;
+    indent(f_service_) << "return this.iprot_;" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
-    indent(f_service_) << "public function getOutputProtocol() : TProtocol" << endl;
+    indent(f_service_) << "public function getOutputProtocol() : TProtocol" << '\n';
     scope_up(f_service_);
-    indent(f_service_) << "return this.oprot_;" << endl;
+    indent(f_service_) << "return this.oprot_;" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   // Generate client method implementations
@@ -1866,140 +1864,140 @@
     string args = tmp("args");
     string calltype = (*f_iter)->is_oneway() ? "ONEWAY" : "CALL";
     f_service_ << indent() << "oprot_.writeMessageBegin(new TMessage(\"" << funname
-               << "\", TMessageType." << calltype << ", seqid_));" << endl << indent()
-               << "var " << args << " : " << argsname << " = new " << argsname << "();" << endl;
+               << "\", TMessageType." << calltype << ", seqid_));" << '\n' << indent()
+               << "var " << args << " : " << argsname << " = new " << argsname << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << args << "." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << ";" << endl;
+                 << (*fld_iter)->get_name() << ";" << '\n';
     }
 
-    f_service_ << indent() << args << ".write(oprot_);" << endl << indent()
-               << "oprot_.writeMessageEnd();" << endl;
+    f_service_ << indent() << args << ".write(oprot_);" << '\n' << indent()
+               << "oprot_.writeMessageEnd();" << '\n';
 
     string retval = tmp("retval");
     if (!((*f_iter)->is_oneway() || (*f_iter)->get_returntype()->is_void())) {
       f_service_ << indent() << "var " << retval << " : " << type_name((*f_iter)->get_returntype())
-                 << " = " << render_default_value_for_type((*f_iter)->get_returntype(),true) 
-                 << ";" << endl;
+                 << " = " << render_default_value_for_type((*f_iter)->get_returntype(),true)
+                 << ";" << '\n';
     }
 
     if ((*f_iter)->is_oneway()) {
-      f_service_ << indent() << "oprot_.getTransport().flush();" << endl;
+      f_service_ << indent() << "oprot_.getTransport().flush();" << '\n';
     } else {
-      indent(f_service_) << "oprot_.getTransport().flush(function(error:Dynamic) : Void {" << endl;
+      indent(f_service_) << "oprot_.getTransport().flush(function(error:Dynamic) : Void {" << '\n';
       indent_up();
-      indent(f_service_) << "try {" << endl;
+      indent(f_service_) << "try {" << '\n';
       indent_up();
       string appex = tmp("appex");
-      indent(f_service_) << "var " << appex << " : TApplicationException;" << endl;
+      indent(f_service_) << "var " << appex << " : TApplicationException;" << '\n';
       string resultname = get_cap_name((*f_iter)->get_name() + "_result");
-      indent(f_service_) << "if (error != null) {" << endl;
+      indent(f_service_) << "if (error != null) {" << '\n';
       indent_up();
-      indent(f_service_) << "if (onError == null)" << endl;
+      indent(f_service_) << "if (onError == null)" << '\n';
       indent_up();
-      indent(f_service_) << "throw error;" << endl;
+      indent(f_service_) << "throw error;" << '\n';
       indent_down();
-      indent(f_service_) << "onError(error);" << endl;
-      indent(f_service_) << "return;" << endl;
+      indent(f_service_) << "onError(error);" << '\n';
+      indent(f_service_) << "return;" << '\n';
       indent_down();
-      indent(f_service_) << "}" << endl << endl;
+      indent(f_service_) << "}" << '\n' << '\n';
       string msg = tmp("msg");
-      indent(f_service_) << "var " << msg << " : TMessage = iprot_.readMessageBegin();" << endl;
-      indent(f_service_) << "if (" << msg << ".type == TMessageType.EXCEPTION) {" << endl;
+      indent(f_service_) << "var " << msg << " : TMessage = iprot_.readMessageBegin();" << '\n';
+      indent(f_service_) << "if (" << msg << ".type == TMessageType.EXCEPTION) {" << '\n';
       indent_up();
-      indent(f_service_) << appex << " = TApplicationException.read(iprot_);" << endl;
-      indent(f_service_) << "iprot_.readMessageEnd();" << endl;
-      indent(f_service_) << "if (onError == null)" << endl;
+      indent(f_service_) << appex << " = TApplicationException.read(iprot_);" << '\n';
+      indent(f_service_) << "iprot_.readMessageEnd();" << '\n';
+      indent(f_service_) << "if (onError == null)" << '\n';
       indent_up();
-      indent(f_service_) << "throw " << appex << ";" << endl;
+      indent(f_service_) << "throw " << appex << ";" << '\n';
       indent_down();
-      indent(f_service_) << "onError(" << appex << ");" << endl;
-      indent(f_service_) << "return;" << endl;
+      indent(f_service_) << "onError(" << appex << ");" << '\n';
+      indent(f_service_) << "return;" << '\n';
       indent_down();
-      indent(f_service_) << "}" << endl << endl;
+      indent(f_service_) << "}" << '\n' << '\n';
       string result = tmp("result");
-      indent(f_service_) << "var " << result << " : " << resultname << " = new " << resultname << "();" << endl;
-      indent(f_service_) << "" << result << ".read(iprot_);" << endl;
-      indent(f_service_) << "iprot_.readMessageEnd();" << endl;
+      indent(f_service_) << "var " << result << " : " << resultname << " = new " << resultname << "();" << '\n';
+      indent(f_service_) << "" << result << ".read(iprot_);" << '\n';
+      indent(f_service_) << "iprot_.readMessageEnd();" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "if (" << result << "." << generate_isset_check("success") << ") {" << endl;
+        indent(f_service_) << "if (" << result << "." << generate_isset_check("success") << ") {" << '\n';
         indent_up();
-        indent(f_service_) << "if (onSuccess != null)" << endl;
+        indent(f_service_) << "if (onSuccess != null)" << '\n';
         indent_up();
-        indent(f_service_) << "onSuccess(" << result << ".success);" << endl;
+        indent(f_service_) << "onSuccess(" << result << ".success);" << '\n';
         indent_down();
-        indent(f_service_) << retval << " = " << result << ".success;" << endl;
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << retval << " = " << result << ".success;" << '\n';
+        indent(f_service_) << "return;" << '\n';
         indent_down();
-        indent(f_service_) << "}" << endl << endl;
+        indent(f_service_) << "}" << '\n' << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        indent(f_service_) << "if (" << result << "." << (*x_iter)->get_name() << " != null) {" << endl;
+        indent(f_service_) << "if (" << result << "." << (*x_iter)->get_name() << " != null) {" << '\n';
         indent_up();
-        indent(f_service_) << "if (onError == null)" << endl;
+        indent(f_service_) << "if (onError == null)" << '\n';
         indent_up();
-        indent(f_service_) << "throw " << result << "." << (*x_iter)->get_name() << ";" << endl;
+        indent(f_service_) << "throw " << result << "." << (*x_iter)->get_name() << ";" << '\n';
         indent_down();
-        indent(f_service_) << "onError(" << result << "." << (*x_iter)->get_name() << ");" << endl;
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "onError(" << result << "." << (*x_iter)->get_name() << ");" << '\n';
+        indent(f_service_) << "return;" << '\n';
         indent_down();
-        indent(f_service_) << "}" << endl << endl;
+        indent(f_service_) << "}" << '\n' << '\n';
       }
 
       // If you get here it's an exception, unless a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "if (onSuccess != null)" << endl;
+        indent(f_service_) << "if (onSuccess != null)" << '\n';
         indent_up();
-        indent(f_service_) << "onSuccess();" << endl;
+        indent(f_service_) << "onSuccess();" << '\n';
         indent_down();
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "return;" << '\n';
       } else {
         indent(f_service_) << appex << " = new TApplicationException("
                            << "TApplicationException.MISSING_RESULT,"
-                           << "\"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
-        indent(f_service_) << "if (onError == null)" << endl;
+                           << "\"" << (*f_iter)->get_name() << " failed: unknown result\");" << '\n';
+        indent(f_service_) << "if (onError == null)" << '\n';
         indent_up();
-        indent(f_service_) << "throw " << appex << ";" << endl;
+        indent(f_service_) << "throw " << appex << ";" << '\n';
         indent_down();
-        indent(f_service_) << "onError(" << appex << ");" << endl;
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "onError(" << appex << ");" << '\n';
+        indent(f_service_) << "return;" << '\n';
       }
 
       indent_down();
-      indent(f_service_) << endl;
-      indent(f_service_) << "} catch( e : TException) {" << endl;
+      indent(f_service_) << '\n';
+      indent(f_service_) << "} catch( e : TException) {" << '\n';
       indent_up();
-      indent(f_service_) << "if (onError == null)" << endl;
+      indent(f_service_) << "if (onError == null)" << '\n';
       indent_up();
-      indent(f_service_) << "throw e;" << endl;
+      indent(f_service_) << "throw e;" << '\n';
       indent_down();
-      indent(f_service_) << "onError(e);" << endl;
-      indent(f_service_) << "return;" << endl;
+      indent(f_service_) << "onError(e);" << '\n';
+      indent(f_service_) << "return;" << '\n';
       indent_down();
-      indent(f_service_) << "}" << endl;
+      indent(f_service_) << "}" << '\n';
 
       indent_down();
-      indent(f_service_) << "});" << endl << endl;
+      indent(f_service_) << "});" << '\n' << '\n';
     }
 
     if (!((*f_iter)->is_oneway() || (*f_iter)->get_returntype()->is_void())) {
-      f_service_ << indent() << "return " << retval << ";" << endl;
+      f_service_ << indent() << "return " << retval << ";" << '\n';
     }
 
     // Close function
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
 }
 
 /**
@@ -2024,35 +2022,35 @@
   generate_rtti_decoration(f_service_);
   generate_macro_decoration(f_service_);
   indent(f_service_) << "class " << get_cap_name(service_name_) << "Processor" << extends_processor
-                     << " implements TProcessor {" << endl << endl;
+                     << " implements TProcessor {" << '\n' << '\n';
   indent_up();
 
   f_service_ << indent() << "private var " << get_cap_name(service_name_)
-             << "_iface_ : " << get_cap_name(service_name_) << "_service;" << endl;
+             << "_iface_ : " << get_cap_name(service_name_) << "_service;" << '\n';
 
   if (extends.empty()) {
     f_service_ << indent()
                << "private var PROCESS_MAP = new StringMap< Int->TProtocol->TProtocol->Void >();"
-               << endl;
+               << '\n';
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   indent(f_service_) << "public function new( iface : " << get_cap_name(service_name_) << "_service)"
-                     << endl;
+                     << '\n';
   scope_up(f_service_);
   if (!extends.empty()) {
-    f_service_ << indent() << "super(iface);" << endl;
+    f_service_ << indent() << "super(iface);" << '\n';
   }
-  f_service_ << indent() << get_cap_name(service_name_) << "_iface_ = iface;" << endl;
+  f_service_ << indent() << get_cap_name(service_name_) << "_iface_ = iface;" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ << indent() << "PROCESS_MAP.set(\"" << (*f_iter)->get_name() << "\", "
-               << (*f_iter)->get_name() << "());" << endl;
+               << (*f_iter)->get_name() << "());" << '\n';
   }
 
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the server implementation
   string override = "";
@@ -2061,31 +2059,31 @@
   }
   indent(f_service_) << override
                      << "public function process( iprot : TProtocol, oprot : TProtocol) : Bool"
-                     << endl;
+                     << '\n';
   scope_up(f_service_);
 
-  f_service_ << indent() << "var msg : TMessage = iprot.readMessageBegin();" << endl;
+  f_service_ << indent() << "var msg : TMessage = iprot.readMessageBegin();" << '\n';
 
   // TODO(mcslee): validate message, was the seqid etc. legit?
 
   f_service_
-      << indent() << "var fn  = PROCESS_MAP.get(msg.name);" << endl
-      << indent() << "if (fn == null) {" << endl
-      << indent() << "  TProtocolUtil.skip(iprot, TType.STRUCT);" << endl
-      << indent() << "  iprot.readMessageEnd();" << endl
+      << indent() << "var fn  = PROCESS_MAP.get(msg.name);" << '\n'
+      << indent() << "if (fn == null) {" << '\n'
+      << indent() << "  TProtocolUtil.skip(iprot, TType.STRUCT);" << '\n'
+      << indent() << "  iprot.readMessageEnd();" << '\n'
       << indent() << "  var appex = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "
-                  << "\"Invalid method name: '\"+msg.name+\"'\");" << endl
-      << indent() << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));" << endl
-      << indent() << "  appex.write(oprot);" << endl << indent() << "  oprot.writeMessageEnd();" << endl
-      << indent() << "  oprot.getTransport().flush();" << endl
-      << indent() << "  return true;" << endl << indent() << "}" << endl
-      << indent() << "fn( msg.seqid, iprot, oprot);" << endl
+                  << "\"Invalid method name: '\"+msg.name+\"'\");" << '\n'
+      << indent() << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));" << '\n'
+      << indent() << "  appex.write(oprot);" << '\n' << indent() << "  oprot.writeMessageEnd();" << '\n'
+      << indent() << "  oprot.getTransport().flush();" << '\n'
+      << indent() << "  return true;" << '\n' << indent() << "}" << '\n'
+      << indent() << "fn( msg.seqid, iprot, oprot);" << '\n'
       ;
 
-  f_service_ << indent() << "return true;" << endl;
+  f_service_ << indent() << "return true;" << '\n';
 
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -2093,7 +2091,7 @@
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2132,20 +2130,20 @@
   (void)tservice;
   // Open class
   indent(f_service_) << "private function " << tfunction->get_name()
-                     << "() : Int->TProtocol->TProtocol->Void {" << endl;
+                     << "() : Int->TProtocol->TProtocol->Void {" << '\n';
   indent_up();
 
   // Open function
   indent(f_service_) << "return function( seqid : Int, iprot : TProtocol, oprot : TProtocol) : Void"
-                     << endl;
+                     << '\n';
   scope_up(f_service_);
 
   string argsname = get_cap_name(tfunction->get_name() + "_args");
   string resultname = get_cap_name(tfunction->get_name() + "_result");
 
-  f_service_ << indent() << "var args : " << argsname << " = new " << argsname << "();" << endl
-             << indent() << "args.read(iprot);" << endl << indent() << "iprot.readMessageEnd();"
-             << endl;
+  f_service_ << indent() << "var args : " << argsname << " = new " << argsname << "();" << '\n'
+             << indent() << "args.read(iprot);" << '\n' << indent() << "iprot.readMessageEnd();"
+             << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -2153,11 +2151,11 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "var result : " << resultname << " = new " << resultname << "();" << endl;
+    f_service_ << indent() << "var result : " << resultname << " = new " << resultname << "();" << '\n';
   }
 
   // Try block for any  function to catch (defined or undefined) exceptions
-  f_service_ << indent() << "try {" << endl;
+  f_service_ << indent() << "try {" << '\n';
   indent_up();
 
 
@@ -2182,7 +2180,7 @@
     }
     f_service_ << "args." << (*f_iter)->get_name();
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   indent_down();
   f_service_ << indent() << "}";
@@ -2190,11 +2188,11 @@
     // catch exceptions defined in the IDL
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << " catch (" << (*x_iter)->get_name() << ":"
-                 << get_cap_name(type_name((*x_iter)->get_type(), false, false)) << ") {" << endl;
+                 << get_cap_name(type_name((*x_iter)->get_type(), false, false)) << ") {" << '\n';
       if (!tfunction->is_oneway()) {
         indent_up();
         f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << ";" << endl;
+                   << (*x_iter)->get_name() << ";" << '\n';
         indent_down();
         f_service_ << indent() << "}";
       } else {
@@ -2205,45 +2203,45 @@
 
   // always catch all exceptions to prevent from service denial
   string appex = tmp("appex");
-  f_service_ << " catch (th : Dynamic) {" << endl;
+  f_service_ << " catch (th : Dynamic) {" << '\n';
   indent_up();
-  indent(f_service_) << "trace(\"Internal error processing " << tfunction->get_name() << "\", th);" << endl;
+  indent(f_service_) << "trace(\"Internal error processing " << tfunction->get_name() << "\", th);" << '\n';
   if (!tfunction->is_oneway()) {
     indent(f_service_) << "var appex = new TApplicationException(TApplicationException.INTERNAL_ERROR, "
-                          "\"Internal error processing " << tfunction->get_name() << "\");" << endl;
+                          "\"Internal error processing " << tfunction->get_name() << "\");" << '\n';
     indent(f_service_) << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-                       << "\", TMessageType.EXCEPTION, seqid));" << endl;
-    indent(f_service_) << "appex.write(oprot);" << endl;
-    indent(f_service_) << "oprot.writeMessageEnd();" << endl;
-    indent(f_service_) << "oprot.getTransport().flush();" << endl;
+                       << "\", TMessageType.EXCEPTION, seqid));" << '\n';
+    indent(f_service_) << "appex.write(oprot);" << '\n';
+    indent(f_service_) << "oprot.writeMessageEnd();" << '\n';
+    indent(f_service_) << "oprot.getTransport().flush();" << '\n';
   }
-  indent(f_service_) << "return;" << endl;
+  indent(f_service_) << "return;" << '\n';
   indent_down();
-  f_service_ << indent() << "}" << endl;
+  f_service_ << indent() << "}" << '\n';
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
+    f_service_ << indent() << "return;" << '\n';
     scope_down(f_service_);
 
     // Close class
     indent_down();
-    f_service_ << indent() << "}" << endl << endl;
+    f_service_ << indent() << "}" << '\n' << '\n';
     return;
   }
 
   f_service_ << indent() << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.REPLY, seqid));" << endl << indent() << "result.write(oprot);"
-             << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-             << "oprot.getTransport().flush();" << endl;
+             << "\", TMessageType.REPLY, seqid));" << '\n' << indent() << "result.write(oprot);"
+             << '\n' << indent() << "oprot.writeMessageEnd();" << '\n' << indent()
+             << "oprot.getTransport().flush();" << '\n';
 
   // Close function
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Close class
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -2309,7 +2307,7 @@
     } else if (type->is_enum()) {
       out << "readI32();";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -2323,8 +2321,8 @@
 void t_haxe_generator::generate_deserialize_struct(ostream& out,
                                                    t_struct* tstruct,
                                                    string prefix) {
-  out << indent() << prefix << " = new " << get_cap_name(type_name(tstruct)) << "();" << endl
-      << indent() << prefix << ".read(iprot);" << endl;
+  out << indent() << prefix << " = new " << get_cap_name(type_name(tstruct)) << "();" << '\n'
+      << indent() << prefix << ".read(iprot);" << '\n';
 }
 
 /**
@@ -2345,21 +2343,21 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    indent(out) << "var " << obj << " = iprot.readMapBegin();" << endl;
+    indent(out) << "var " << obj << " = iprot.readMapBegin();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "var " << obj << " = iprot.readSetBegin();" << endl;
+    indent(out) << "var " << obj << " = iprot.readSetBegin();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "var " << obj << " = iprot.readListBegin();" << endl;
+    indent(out) << "var " << obj << " = iprot.readListBegin();" << '\n';
   }
 
   indent(out) << prefix << " = new " << type_name(ttype, false, true)
               // size the collection correctly
               << "("
-              << ");" << endl;
+              << ");" << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
-  indent(out) << "for( " << i << " in 0 ... " << obj << ".size)" << endl;
+  indent(out) << "for( " << i << " in 0 ... " << obj << ".size)" << '\n';
 
   scope_up(out);
 
@@ -2375,11 +2373,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd();" << endl;
+    indent(out) << "iprot.readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd();" << endl;
+    indent(out) << "iprot.readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd();" << endl;
+    indent(out) << "iprot.readListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -2394,13 +2392,13 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
+  indent(out) << declare_field(&fkey) << '\n';
+  indent(out) << declare_field(&fval) << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << prefix << ".set( " << key << ", " << val << ");" << endl;
+  indent(out) << prefix << ".set( " << key << ", " << val << ");" << '\n';
 }
 
 /**
@@ -2410,11 +2408,11 @@
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 }
 
 /**
@@ -2426,11 +2424,11 @@
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 }
 
 /**
@@ -2496,7 +2494,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(" << name << ");";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -2513,7 +2511,7 @@
  */
 void t_haxe_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  out << indent() << prefix << ".write(oprot);" << endl;
+  out << indent() << prefix << ".write(oprot);" << '\n';
 }
 
 /**
@@ -2527,30 +2525,30 @@
   if (ttype->is_map()) {
     string iter = tmp("_key");
     string counter = tmp("_sizeCounter");
-    indent(out) << "var " << counter << " : Int = 0;" << endl;
-    indent(out) << "for( " << iter << " in " << prefix << ") {" << endl;
-    indent(out) << "  " << counter << +"++;" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "var " << counter << " : Int = 0;" << '\n';
+    indent(out) << "for( " << iter << " in " << prefix << ") {" << '\n';
+    indent(out) << "  " << counter << +"++;" << '\n';
+    indent(out) << "}" << '\n';
 
     indent(out) << "oprot.writeMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
                 << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << counter << "));"
-                << endl;
+                << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot.writeSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".size));" << endl;
+                << ", " << prefix << ".size));" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot.writeListBegin(new TList("
                 << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".length));"
-                << endl;
+                << '\n';
   }
 
   string iter = tmp("elem");
   if (ttype->is_map()) {
-    indent(out) << "for( " << iter << " in " << prefix << ".keys())" << endl;
+    indent(out) << "for( " << iter << " in " << prefix << ".keys())" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "for( " << iter << " in " << prefix << ".toArray())" << endl;
+    indent(out) << "for( " << iter << " in " << prefix << ".toArray())" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "for( " << iter << " in " << prefix << ")" << endl;
+    indent(out) << "for( " << iter << " in " << prefix << ")" << '\n';
   }
 
   scope_up(out);
@@ -2566,11 +2564,11 @@
   scope_down(out);
 
   if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd();" << endl;
+    indent(out) << "oprot.writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd();" << endl;
+    indent(out) << "oprot.writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd();" << endl;
+    indent(out) << "oprot.writeListEnd();" << '\n';
   }
 
 }
@@ -3006,7 +3004,7 @@
  */
 void t_haxe_generator::generate_rtti_decoration(ostream& out) {
   if (rtti_) {
-    out << "@:rtti" << endl;
+    out << "@:rtti" << '\n';
   }
 }
 
@@ -3015,10 +3013,10 @@
  */
 void t_haxe_generator::generate_macro_decoration(ostream& out) {
   if (!buildmacro_.empty()) {
-    out << "#if ! macro" << endl;
-    out << "@:build( " << buildmacro_ << ")" << endl;     // current class/interface
-    out << "@:autoBuild( " << buildmacro_ << ")" << endl; // inherited classes/interfaces
-    out << "#end" << endl;
+    out << "#if ! macro" << '\n';
+    out << "@:build( " << buildmacro_ << ")" << '\n';     // current class/interface
+    out << "@:autoBuild( " << buildmacro_ << ")" << '\n'; // inherited classes/interfaces
+    out << "#end" << '\n';
   }
 }
 
@@ -3061,7 +3059,7 @@
 
 void t_haxe_generator::generate_isset_set(ostream& out, t_field* field) {
   if (!type_can_be_null(field->get_type())) {
-    indent(out) << "this.__isset_" << field->get_name() << " = true;" << endl;
+    indent(out) << "this.__isset_" << field->get_name() << " = true;" << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_html_generator.cc b/compiler/cpp/src/thrift/generate/t_html_generator.cc
index 15a0401..637cd88 100644
--- a/compiler/cpp/src/thrift/generate/t_html_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_html_generator.cc
@@ -38,8 +38,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 enum input_type { INPUT_UNKNOWN, INPUT_UTF8, INPUT_PLAIN };
 
 /**
@@ -129,9 +127,9 @@
 void t_html_generator::generate_program_toc() {
   f_out_ << "<table class=\"table-bordered table-striped "
             "table-condensed\"><thead><tr><th>Module</th><th>Services</th>"
-         << "<th>Data types</th><th>Constants</th></tr></thead><tbody>" << endl;
+         << "<th>Data types</th><th>Constants</th></tr></thead><tbody>" << '\n';
   generate_program_toc_row(program_);
-  f_out_ << "</tbody></table>" << endl;
+  f_out_ << "</tbody></table>" << '\n';
 }
 
 /**
@@ -159,15 +157,15 @@
  */
 void t_html_generator::generate_program_toc_row(t_program* tprog) {
   string fname = tprog->get_name() + ".html";
-  f_out_ << "<tr>" << endl << "<td>" << tprog->get_name() << "</td><td>";
+  f_out_ << "<tr>" << '\n' << "<td>" << tprog->get_name() << "</td><td>";
   if (!tprog->get_services().empty()) {
     vector<t_service*> services = tprog->get_services();
     vector<t_service*>::iterator sv_iter;
     for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
       string name = get_service_name(*sv_iter);
       f_out_ << "<a href=\"" << make_file_link(fname) << "#Svc_" << name << "\">" << name
-             << "</a><br/>" << endl;
-      f_out_ << "<ul>" << endl;
+             << "</a><br/>" << '\n';
+      f_out_ << "<ul>" << '\n';
       map<string, string> fn_html;
       vector<t_function*> functions = (*sv_iter)->get_functions();
       vector<t_function*>::iterator fn_iter;
@@ -178,12 +176,12 @@
         fn_html.insert(pair<string, string>(fn_name, html));
       }
       for (auto & html_iter : fn_html) {
-        f_out_ << html_iter.second << endl;
+        f_out_ << html_iter.second << '\n';
       }
-      f_out_ << "</ul>" << endl;
+      f_out_ << "</ul>" << '\n';
     }
   }
-  f_out_ << "</td>" << endl << "<td>";
+  f_out_ << "</td>" << '\n' << "<td>";
   map<string, string> data_types;
   if (!tprog->get_enums().empty()) {
     vector<t_enum*> enums = tprog->get_enums();
@@ -191,7 +189,7 @@
     for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
       string name = (*en_iter)->get_name();
       // f_out_ << "<a href=\"" << make_file_link(fname) << "#Enum_" << name << "\">" << name
-      // <<  "</a><br/>" << endl;
+      // <<  "</a><br/>" << '\n';
       string html = "<a href=\"" + make_file_link(fname) + "#Enum_" + name + "\">" + name + "</a>";
       data_types.insert(pair<string, string>(name, html));
     }
@@ -202,7 +200,7 @@
     for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
       string name = (*td_iter)->get_symbolic();
       // f_out_ << "<a href=\"" << make_file_link(fname) << "#Typedef_" << name << "\">" << name
-      // << "</a><br/>" << endl;
+      // << "</a><br/>" << '\n';
       string html = "<a href=\"" + make_file_link(fname) + "#Typedef_" + name + "\">" + name
                     + "</a>";
       data_types.insert(pair<string, string>(name, html));
@@ -214,16 +212,16 @@
     for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
       string name = (*o_iter)->get_name();
       // f_out_ << "<a href=\"" << make_file_link(fname) << "#Struct_" << name << "\">" << name
-      //<< "</a><br/>" << endl;
+      //<< "</a><br/>" << '\n';
       string html = "<a href=\"" + make_file_link(fname) + "#Struct_" + name + "\">" + name
                     + "</a>";
       data_types.insert(pair<string, string>(name, html));
     }
   }
   for (auto & data_type : data_types) {
-    f_out_ << data_type.second << "<br/>" << endl;
+    f_out_ << data_type.second << "<br/>" << '\n';
   }
-  f_out_ << "</td>" << endl << "<td>";
+  f_out_ << "</td>" << '\n' << "<td>";
   if (!tprog->get_consts().empty()) {
     map<string, string> const_html;
     vector<t_const*> consts = tprog->get_consts();
@@ -235,10 +233,10 @@
       const_html.insert(pair<string, string>(name, html));
     }
     for (auto & con_iter : const_html) {
-      f_out_ << con_iter.second << "<br/>" << endl;
+      f_out_ << con_iter.second << "<br/>" << '\n';
     }
   }
-  f_out_ << "</td>" << endl << "</tr>";
+  f_out_ << "</td>" << '\n' << "</tr>";
 }
 
 /**
@@ -251,30 +249,30 @@
   current_file_ = program_->get_name() + ".html";
   string fname = get_out_dir() + current_file_;
   f_out_.open(fname.c_str());
-  f_out_ << "<!DOCTYPE html>" << endl;
-  f_out_ << "<html lang=\"en\">" << endl;
-  f_out_ << "<head>" << endl;
-  f_out_ << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />" << endl;
+  f_out_ << "<!DOCTYPE html>" << '\n';
+  f_out_ << "<html lang=\"en\">" << '\n';
+  f_out_ << "<head>" << '\n';
+  f_out_ << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />" << '\n';
   generate_style_tag();
-  f_out_ << "<title>Thrift module: " << program_->get_name() << "</title></head><body>" << endl
-         << "<div class=\"container-fluid\">" << endl
-         << "<h1>Thrift module: " << program_->get_name() << "</h1>" << endl;
+  f_out_ << "<title>Thrift module: " << program_->get_name() << "</title></head><body>" << '\n'
+         << "<div class=\"container-fluid\">" << '\n'
+         << "<h1>Thrift module: " << program_->get_name() << "</h1>" << '\n';
 
   print_doc(program_);
 
   generate_program_toc();
 
   if (!program_->get_consts().empty()) {
-    f_out_ << "<hr/><h2 id=\"Constants\">Constants</h2>" << endl;
+    f_out_ << "<hr/><h2 id=\"Constants\">Constants</h2>" << '\n';
     vector<t_const*> consts = program_->get_consts();
     f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
-    f_out_ << "<thead><tr><th>Constant</th><th>Type</th><th>Value</th></tr></thead><tbody>" << endl;
+    f_out_ << "<thead><tr><th>Constant</th><th>Type</th><th>Value</th></tr></thead><tbody>" << '\n';
     generate_consts(consts);
     f_out_ << "</tbody></table>";
   }
 
   if (!program_->get_enums().empty()) {
-    f_out_ << "<hr/><h2 id=\"Enumerations\">Enumerations</h2>" << endl;
+    f_out_ << "<hr/><h2 id=\"Enumerations\">Enumerations</h2>" << '\n';
     // Generate enums
     vector<t_enum*> enums = program_->get_enums();
     vector<t_enum*>::iterator en_iter;
@@ -284,7 +282,7 @@
   }
 
   if (!program_->get_typedefs().empty()) {
-    f_out_ << "<hr/><h2 id=\"Typedefs\">Type declarations</h2>" << endl;
+    f_out_ << "<hr/><h2 id=\"Typedefs\">Type declarations</h2>" << '\n';
     // Generate typedefs
     vector<t_typedef*> typedefs = program_->get_typedefs();
     vector<t_typedef*>::iterator td_iter;
@@ -294,7 +292,7 @@
   }
 
   if (!program_->get_objects().empty()) {
-    f_out_ << "<hr/><h2 id=\"Structs\">Data structures</h2>" << endl;
+    f_out_ << "<hr/><h2 id=\"Structs\">Data structures</h2>" << '\n';
     // Generate structs and exceptions in declared order
     vector<t_struct*> objects = program_->get_objects();
     vector<t_struct*>::iterator o_iter;
@@ -308,7 +306,7 @@
   }
 
   if (!program_->get_services().empty()) {
-    f_out_ << "<hr/><h2 id=\"Services\">Services</h2>" << endl;
+    f_out_ << "<hr/><h2 id=\"Services\">Services</h2>" << '\n';
     // Generate services
     vector<t_service*> services = program_->get_services();
     vector<t_service*>::iterator sv_iter;
@@ -318,7 +316,7 @@
     }
   }
 
-  f_out_ << "</div></body></html>" << endl;
+  f_out_ << "</div></body></html>" << '\n';
   f_out_.close();
 
   generate_index();
@@ -332,17 +330,17 @@
   current_file_ = "index.html";
   string index_fname = get_out_dir() + current_file_;
   f_out_.open(index_fname.c_str());
-  f_out_ << "<!DOCTYPE html>" << endl << "<html lang=\"en\"><head>" << endl;
+  f_out_ << "<!DOCTYPE html>" << '\n' << "<html lang=\"en\"><head>" << '\n';
   generate_style_tag();
-  f_out_ << "<title>All Thrift declarations</title></head><body>" << endl
-         << "<div class=\"container-fluid\">" << endl << "<h1>All Thrift declarations</h1>" << endl;
+  f_out_ << "<title>All Thrift declarations</title></head><body>" << '\n'
+         << "<div class=\"container-fluid\">" << '\n' << "<h1>All Thrift declarations</h1>" << '\n';
   f_out_ << "<table class=\"table-bordered table-striped "
             "table-condensed\"><thead><tr><th>Module</th><th>Services</th><th>Data types</th>"
-         << "<th>Constants</th></tr></thead><tbody>" << endl;
+         << "<th>Constants</th></tr></thead><tbody>" << '\n';
   vector<t_program*> programs;
   generate_program_toc_rows(program_, programs);
-  f_out_ << "</tbody></table>" << endl;
-  f_out_ << "</div></body></html>" << endl;
+  f_out_ << "</tbody></table>" << '\n';
+  f_out_ << "</div></body></html>" << '\n';
   f_out_.close();
 }
 
@@ -357,17 +355,17 @@
 }
 
 void t_html_generator::generate_css_content(std::ostream& f_target) {
-  f_target << BOOTSTRAP_CSS() << endl;
-  f_target << "/* Auto-generated CSS for generated Thrift docs */" << endl;
-  f_target << "h3, h4 { margin-bottom: 6px; }" << endl;
+  f_target << BOOTSTRAP_CSS() << '\n';
+  f_target << "/* Auto-generated CSS for generated Thrift docs */" << '\n';
+  f_target << "h3, h4 { margin-bottom: 6px; }" << '\n';
   f_target << "div.definition { border: 1px solid #CCC; margin-bottom: 10px; padding: 10px; }"
-           << endl;
-  f_target << "div.extends { margin: -0.5em 0 1em 5em }" << endl;
-  f_target << "td { vertical-align: top; }" << endl;
-  f_target << "table { empty-cells: show; }" << endl;
-  f_target << "code { line-height: 20px; }" << endl;
+           << '\n';
+  f_target << "div.extends { margin: -0.5em 0 1em 5em }" << '\n';
+  f_target << "td { vertical-align: top; }" << '\n';
+  f_target << "table { empty-cells: show; }" << '\n';
+  f_target << "code { line-height: 20px; }" << '\n';
   f_target << ".table-bordered th, .table-bordered td { border-bottom: 1px solid #DDDDDD; }"
-           << endl;
+           << '\n';
 }
 
 /**
@@ -377,11 +375,11 @@
  */
 void t_html_generator::generate_style_tag() {
   if (!standalone_) {
-    f_out_ << "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"/>" << endl;
+    f_out_ << "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"/>" << '\n';
   } else {
-    f_out_ << "<style type=\"text/css\"/><!--" << endl;
+    f_out_ << "<style type=\"text/css\"/><!--" << '\n';
     generate_css_content(f_out_);
-    f_out_ << "--></style>" << endl;
+    f_out_ << "--></style>" << '\n';
   }
 }
 
@@ -856,14 +854,14 @@
     if (has_docs) {
       arg_iter = args.begin();
       f_out_ << "<br/><h4 id=\"Parameters_" << service_name_ << "_" << tfunction->get_name()
-             << "\">Parameters</h4>" << endl;
+             << "\">Parameters</h4>" << '\n';
       f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
       f_out_ << "<thead><tr><th>Name</th><th>Description</th></tr></thead><tbody>";
       for (; arg_iter != args.end(); arg_iter++) {
         f_out_ << "<tr><td>" << (*arg_iter)->get_name();
         f_out_ << "</td><td>";
         f_out_ << escape_html((*arg_iter)->get_doc());
-        f_out_ << "</td></tr>" << endl;
+        f_out_ << "</td></tr>" << '\n';
       }
       f_out_ << "</tbody></table>";
     }
@@ -880,14 +878,14 @@
     if (has_docs) {
       ex_iter = excepts.begin();
       f_out_ << "<br/><h4 id=\"Exceptions_" << service_name_ << "_" << tfunction->get_name()
-             << "\">Exceptions</h4>" << endl;
+             << "\">Exceptions</h4>" << '\n';
       f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
       f_out_ << "<thead><tr><th>Type</th><th>Description</th></tr></thead><tbody>";
       for (; ex_iter != excepts.end(); ex_iter++) {
         f_out_ << "<tr><td>" << (*ex_iter)->get_type()->get_name();
         f_out_ << "</td><td>";
         f_out_ << escape_html((*ex_iter)->get_doc());
-        f_out_ << "</td></tr>" << endl;
+        f_out_ << "</td></tr>" << '\n';
       }
       f_out_ << "</tbody></table>";
     }
@@ -902,12 +900,12 @@
 void t_html_generator::generate_typedef(t_typedef* ttypedef) {
   string name = ttypedef->get_name();
   f_out_ << "<div class=\"definition\">";
-  f_out_ << "<h3 id=\"Typedef_" << name << "\">Typedef: " << name << "</h3>" << endl;
+  f_out_ << "<h3 id=\"Typedef_" << name << "\">Typedef: " << name << "</h3>" << '\n';
   f_out_ << "<p><strong>Base type:</strong>&nbsp;";
   print_type(ttypedef->get_type());
-  f_out_ << "</p>" << endl;
+  f_out_ << "</p>" << '\n';
   print_doc(ttypedef);
-  f_out_ << "</div>" << endl;
+  f_out_ << "</div>" << '\n';
 }
 
 /**
@@ -918,21 +916,21 @@
 void t_html_generator::generate_enum(t_enum* tenum) {
   string name = tenum->get_name();
   f_out_ << "<div class=\"definition\">";
-  f_out_ << "<h3 id=\"Enum_" << name << "\">Enumeration: " << name << "</h3>" << endl;
+  f_out_ << "<h3 id=\"Enum_" << name << "\">Enumeration: " << name << "</h3>" << '\n';
   print_doc(tenum);
   vector<t_enum_value*> values = tenum->get_constants();
   vector<t_enum_value*>::iterator val_iter;
-  f_out_ << "<br/><table class=\"table-bordered table-striped table-condensed\">" << endl;
+  f_out_ << "<br/><table class=\"table-bordered table-striped table-condensed\">" << '\n';
   for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
     f_out_ << "<tr><td><code>";
     f_out_ << (*val_iter)->get_name();
     f_out_ << "</code></td><td><code>";
     f_out_ << (*val_iter)->get_value();
-    f_out_ << "</code></td><td>" << endl;
+    f_out_ << "</code></td><td>" << '\n';
     print_doc((*val_iter));
-    f_out_ << "</td></tr>" << endl;
+    f_out_ << "</td></tr>" << '\n';
   }
-  f_out_ << "</table></div>" << endl;
+  f_out_ << "</table></div>" << '\n';
 }
 
 /**
@@ -968,12 +966,12 @@
   } else {
     f_out_ << "Struct: ";
   }
-  f_out_ << name << "</h3>" << endl;
+  f_out_ << name << "</h3>" << '\n';
   vector<t_field*> members = tstruct->get_members();
   vector<t_field*>::iterator mem_iter = members.begin();
   f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
   f_out_ << "<thead><tr><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</"
-            "th><th>Default value</th></tr></thead><tbody>" << endl;
+            "th><th>Default value</th></tr></thead><tbody>" << '\n';
   for (; mem_iter != members.end(); mem_iter++) {
     f_out_ << "<tr><td>" << (*mem_iter)->get_key() << "</td><td>";
     f_out_ << (*mem_iter)->get_name();
@@ -996,7 +994,7 @@
       print_const_value((*mem_iter)->get_type(), default_val);
       f_out_ << "</code>";
     }
-    f_out_ << "</td></tr>" << endl;
+    f_out_ << "</td></tr>" << '\n';
   }
   f_out_ << "</tbody></table><br/>";
   print_doc(tstruct);
@@ -1018,7 +1016,7 @@
  * @param tservice The service definition
  */
 void t_html_generator::generate_service(t_service* tservice) {
-  f_out_ << "<h3 id=\"Svc_" << service_name_ << "\">Service: " << service_name_ << "</h3>" << endl;
+  f_out_ << "<h3 id=\"Svc_" << service_name_ << "\">Service: " << service_name_ << "</h3>" << '\n';
 
   if (tservice->get_extends()) {
     f_out_ << "<div class=\"extends\"><em>extends</em> ";
@@ -1032,7 +1030,7 @@
     string fn_name = (*fn_iter)->get_name();
     f_out_ << "<div class=\"definition\">";
     f_out_ << "<h4 id=\"Fn_" << service_name_ << "_" << fn_name << "\">Function: " << service_name_
-           << "." << fn_name << "</h4>" << endl;
+           << "." << fn_name << "</h4>" << '\n';
     f_out_ << "<pre>";
     std::string::size_type offset = print_type((*fn_iter)->get_returntype());
     bool first = true;
@@ -1042,7 +1040,7 @@
     vector<t_field*>::iterator arg_iter = args.begin();
     for (; arg_iter != args.end(); arg_iter++) {
       if (!first) {
-        f_out_ << "," << endl;
+        f_out_ << "," << '\n';
         for (std::string::size_type i = 0; i < offset; ++i) {
           f_out_ << " ";
         }
@@ -1055,7 +1053,7 @@
         print_const_value((*arg_iter)->get_type(), (*arg_iter)->get_value());
       }
     }
-    f_out_ << ")" << endl;
+    f_out_ << ")" << '\n';
     first = true;
     vector<t_field*> excepts = (*fn_iter)->get_xceptions()->get_members();
     vector<t_field*>::iterator ex_iter = excepts.begin();
@@ -1068,7 +1066,7 @@
         first = false;
         print_type((*ex_iter)->get_type());
       }
-      f_out_ << endl;
+      f_out_ << '\n';
     }
     f_out_ << "</pre>";
     print_doc(*fn_iter);
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index 1985a3d..e81744e 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -45,8 +45,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 static const string thrift_option_class = "org.apache.thrift.Option";
 static const string jdk_option_class = "java.util.Optional";
 
@@ -511,8 +509,7 @@
 }
 
 string t_java_generator::java_suppressions() {
-  return "@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", \"unchecked\", \"unused\"})"
-         + endl;
+  return "@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", \"unchecked\", \"unused\"})\n";
 }
 
 string t_java_generator::java_nullable_annotation() {
@@ -567,7 +564,7 @@
   f_enum.open(f_enum_name.c_str());
 
   // Comment and package it
-  f_enum << autogen_comment() << java_package() << endl;
+  f_enum << autogen_comment() << java_package() << '\n';
 
   generate_java_doc(f_enum, tenum);
 
@@ -576,7 +573,7 @@
   }
 
   if (is_deprecated) {
-    indent(f_enum) << "@Deprecated" << endl;
+    indent(f_enum) << "@Deprecated" << '\n';
   }
   indent(f_enum) << "public enum " << tenum->get_name() << " implements org.apache.thrift.TEnum ";
   scope_up(f_enum);
@@ -590,62 +587,62 @@
     if (first) {
       first = false;
     } else {
-      f_enum << "," << endl;
+      f_enum << "," << '\n';
     }
 
     generate_java_doc(f_enum, *c_iter);
     if (this->is_deprecated((*c_iter)->annotations_)) {
-      indent(f_enum) << "@Deprecated" << endl;
+      indent(f_enum) << "@Deprecated" << '\n';
     }
     indent(f_enum) << (*c_iter)->get_name() << "(" << value << ")";
   }
-  f_enum << ";" << endl << endl;
+  f_enum << ";" << '\n' << '\n';
 
   // Field for thriftCode
-  indent(f_enum) << "private final int value;" << endl << endl;
+  indent(f_enum) << "private final int value;" << '\n' << '\n';
 
-  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << endl;
-  indent(f_enum) << "  this.value = value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
+  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << '\n';
+  indent(f_enum) << "  this.value = value;" << '\n';
+  indent(f_enum) << "}" << '\n' << '\n';
 
-  indent(f_enum) << "/**" << endl;
+  indent(f_enum) << "/**" << '\n';
   indent(f_enum) << " * Get the integer value of this enum value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << java_override_annotation() << endl;
-  indent(f_enum) << "public int getValue() {" << endl;
-  indent(f_enum) << "  return value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
+                 << '\n';
+  indent(f_enum) << " */" << '\n';
+  indent(f_enum) << java_override_annotation() << '\n';
+  indent(f_enum) << "public int getValue() {" << '\n';
+  indent(f_enum) << "  return value;" << '\n';
+  indent(f_enum) << "}" << '\n' << '\n';
 
-  indent(f_enum) << "/**" << endl;
+  indent(f_enum) << "/**" << '\n';
   indent(f_enum) << " * Find a the enum type by its integer value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " * @return null if the value is not found." << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << java_nullable_annotation() << endl;
-  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << endl;
+                 << '\n';
+  indent(f_enum) << " * @return null if the value is not found." << '\n';
+  indent(f_enum) << " */" << '\n';
+  indent(f_enum) << java_nullable_annotation() << '\n';
+  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << '\n';
 
   indent_up();
 
-  indent(f_enum) << "switch (value) {" << endl;
+  indent(f_enum) << "switch (value) {" << '\n';
   indent_up();
 
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    indent(f_enum) << "case " << value << ":" << endl;
-    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << endl;
+    indent(f_enum) << "case " << value << ":" << '\n';
+    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << '\n';
   }
 
-  indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;
+  indent(f_enum) << "default:" << '\n';
+  indent(f_enum) << "  return null;" << '\n';
 
   indent_down();
 
-  indent(f_enum) << "}" << endl;
+  indent(f_enum) << "}" << '\n';
 
   indent_down();
 
-  indent(f_enum) << "}" << endl;
+  indent(f_enum) << "}" << '\n';
 
   scope_down(f_enum);
 
@@ -667,8 +664,8 @@
 
   // Print header
   f_consts << autogen_comment() << java_package() << java_suppressions();
-  f_consts << "public class " << make_valid_java_identifier(program_name_) << "Constants {" << endl
-           << endl;
+  f_consts << "public class " << make_valid_java_identifier(program_name_) << "Constants {" << '\n'
+           << '\n';
   indent_up();
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
@@ -677,7 +674,7 @@
                       (*c_iter)->get_value(), false);
   }
   indent_down();
-  indent(f_consts) << "}" << endl;
+  indent(f_consts) << "}" << '\n';
   f_consts.close();
 }
 
@@ -700,9 +697,9 @@
   }
   if (type->is_base_type()) {
     string v2 = render_const_value(out, type, value);
-    out << name << " = " << v2 << ";" << endl << endl;
+    out << name << " = " << v2 << ";" << '\n' << '\n';
   } else if (type->is_enum()) {
-    out << name << " = " << render_const_value(out, type, value) << ";" << endl << endl;
+    out << name << " = " << render_const_value(out, type, value) << ";" << '\n' << '\n';
   } else if (type->is_struct() || type->is_xception()) {
     const vector<t_field*>& unsorted_fields = ((t_struct*)type)->get_members();
     vector<t_field*> fields = unsorted_fields;
@@ -710,9 +707,9 @@
     vector<t_field*>::const_iterator f_iter;
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
+    out << name << " = new " << type_name(type, false, true) << "();" << '\n';
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
@@ -728,22 +725,22 @@
       string val = render_const_value(out, field_type, v_iter->second);
       indent(out) << name << ".";
       std::string cap_name = get_cap_name(v_iter->first->get_string());
-      out << "set" << cap_name << "(" << val << ");" << endl;
+      out << "set" << cap_name << "(" << val << ");" << '\n';
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_map()) {
     std::string constructor_args;
     if (is_enum_map(type)) {
       constructor_args = inner_enum_type_name(type);
     }
     out << name << " = new " << type_name(type, false, true) << "(" << constructor_args << ");"
-        << endl;
+        << '\n';
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     t_type* ktype = ((t_map*)type)->get_key_type();
@@ -753,22 +750,22 @@
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string key = render_const_value(out, ktype, v_iter->first);
       string val = render_const_value(out, vtype, v_iter->second);
-      indent(out) << name << ".put(" << key << ", " << val << ");" << endl;
+      indent(out) << name << ".put(" << key << ", " << val << ");" << '\n';
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_list() || type->is_set()) {
     if (is_enum_set(type)) {
       out << name << " = " << type_name(type, false, true, true) << ".noneOf("
-          << inner_enum_type_name(type) << ");" << endl;
+          << inner_enum_type_name(type) << ");" << '\n';
     } else {
-      out << name << " = new " << type_name(type, false, true) << "();" << endl;
+      out << name << " = new " << type_name(type, false, true) << "();" << '\n';
     }
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     t_type* etype;
@@ -781,13 +778,13 @@
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(out, etype, *v_iter);
-      indent(out) << name << ".add(" << val << ");" << endl;
+      indent(out) << name << ".add(" << val << ");" << '\n';
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else {
     throw "compiler error: no const of type " + type->get_name();
   }
@@ -916,7 +913,7 @@
   }
 
   if (is_deprecated) {
-    indent(f_struct) << "@Deprecated" << endl;
+    indent(f_struct) << "@Deprecated" << '\n';
   }
   indent(f_struct) << "public " << (is_final ? "final " : "") << "class " << make_valid_java_identifier(tstruct->get_name())
                    << " extends org.apache.thrift.TUnion<" << make_valid_java_identifier(tstruct->get_name()) << ", "
@@ -927,49 +924,49 @@
   generate_struct_desc(f_struct, tstruct);
   generate_field_descs(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_field_name_constants(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_java_meta_data_map(f_struct, tstruct);
 
   generate_union_constructor(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_abstract_methods(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_java_struct_field_by_id(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_getters_and_setters(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_is_set_methods(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_comparisons(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_hashcode(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_java_struct_write_object(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_java_struct_read_object(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   scope_down(f_struct);
 
@@ -980,63 +977,63 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  indent(out) << "public " << type_name(tstruct) << "() {" << endl;
+  indent(out) << "public " << type_name(tstruct) << "() {" << '\n';
   indent_up();
   bool default_value = false;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* type = get_true_type((*m_iter)->get_type());
     if ((*m_iter)->get_value() != nullptr) {
       indent(out) << "super(_Fields." << constant_name((*m_iter)->get_name()) << ", "
-                  << render_const_value(out, type, (*m_iter)->get_value()) << ");" << endl;
+                  << render_const_value(out, type, (*m_iter)->get_value()) << ");" << '\n';
       default_value = true;
       break;
     }
   }
   if (default_value == false) {
-    indent(out) << "super();" << endl;
+    indent(out) << "super();" << '\n';
   }
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   indent(out) << "public " << type_name(tstruct) << "(_Fields setField, java.lang.Object value) {"
-              << endl;
-  indent(out) << "  super(setField, value);" << endl;
-  indent(out) << "}" << endl << endl;
+              << '\n';
+  indent(out) << "  super(setField, value);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   indent(out) << "public " << type_name(tstruct)
               << "(" << type_name(tstruct) << " other) {"
-              << endl;
-  indent(out) << "  super(other);" << endl;
-  indent(out) << "}" << endl;
+              << '\n';
+  indent(out) << "  super(other);" << '\n';
+  indent(out) << "}" << '\n';
 
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << " deepCopy() {" << '\n';
+  indent(out) << "  return new " << tstruct->get_name() << "(this);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   // generate "constructors" for each field
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* type = (*m_iter)->get_type();
     indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name() << "("
-                << type_name(type) << " value) {" << endl;
-    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << endl;
-    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << endl;
-    indent(out) << "  return x;" << endl;
-    indent(out) << "}" << endl << endl;
+                << type_name(type) << " value) {" << '\n';
+    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << '\n';
+    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << '\n';
+    indent(out) << "  return x;" << '\n';
+    indent(out) << "}" << '\n' << '\n';
 
     if (type->is_binary()) {
       indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name()
-                  << "(byte[] value) {" << endl;
+                  << "(byte[] value) {" << '\n';
       indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();"
-                  << endl;
+                  << '\n';
       indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name());
       if (unsafe_binaries_) {
-        indent(out) << "(java.nio.ByteBuffer.wrap(value));" << endl;
+        indent(out) << "(java.nio.ByteBuffer.wrap(value));" << '\n';
       } else {
-        indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << endl;
+        indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << '\n';
       }
-      indent(out) << "  return x;" << endl;
-      indent(out) << "}" << endl << endl;
+      indent(out) << "  return x;" << '\n';
+      indent(out) << "}" << '\n' << '\n';
     }
   }
 }
@@ -1050,7 +1047,7 @@
     if (first) {
       first = false;
     } else {
-      out << endl;
+      out << '\n';
     }
 
     t_field* field = (*m_iter);
@@ -1061,95 +1058,95 @@
     generate_java_doc(out, field);
     if (type->is_binary()) {
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
-      indent(out) << "public byte[] get" << cap_name << "() {" << endl;
+      indent(out) << "public byte[] get" << cap_name << "() {" << '\n';
       indent(out) << "  set" << cap_name << "(org.apache.thrift.TBaseHelper.rightSize(buffer"
-                  << get_cap_name("for") << cap_name << "()));" << endl;
+                  << get_cap_name("for") << cap_name << "()));" << '\n';
       indent(out) << "  java.nio.ByteBuffer b = buffer" << get_cap_name("for") << cap_name << "();"
-                  << endl;
-      indent(out) << "  return b == null ? null : b.array();" << endl;
-      indent(out) << "}" << endl;
+                  << '\n';
+      indent(out) << "  return b == null ? null : b.array();" << '\n';
+      indent(out) << "}" << '\n';
 
-      out << endl;
+      out << '\n';
 
       indent(out) << "public java.nio.ByteBuffer buffer" << get_cap_name("for")
-                  << get_cap_name(field->get_name()) << "() {" << endl;
+                  << get_cap_name(field->get_name()) << "() {" << '\n';
       indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                  << endl;
+                  << '\n';
 
       if (unsafe_binaries_) {
-        indent(out) << "    return (java.nio.ByteBuffer)getFieldValue();" << endl;
+        indent(out) << "    return (java.nio.ByteBuffer)getFieldValue();" << '\n';
       } else {
         indent(out)
             << "    return "
                "org.apache.thrift.TBaseHelper.copyBinary((java.nio.ByteBuffer)getFieldValue());"
-            << endl;
+            << '\n';
       }
 
-      indent(out) << "  } else {" << endl;
+      indent(out) << "  } else {" << '\n';
       indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '"
                   << field->get_name()
                   << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                  << endl;
-      indent(out) << "  }" << endl;
-      indent(out) << "}" << endl;
+                  << '\n';
+      indent(out) << "  }" << '\n';
+      indent(out) << "}" << '\n';
     } else {
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
       indent(out) << "public " << type_name(field->get_type()) << " get"
-                  << get_cap_name(field->get_name()) << "() {" << endl;
+                  << get_cap_name(field->get_name()) << "() {" << '\n';
       indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                  << endl;
+                  << '\n';
       indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();"
-                  << endl;
-      indent(out) << "  } else {" << endl;
+                  << '\n';
+      indent(out) << "  } else {" << '\n';
       indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '"
                   << field->get_name()
                   << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                  << endl;
-      indent(out) << "  }" << endl;
-      indent(out) << "}" << endl;
+                  << '\n';
+      indent(out) << "  }" << '\n';
+      indent(out) << "}" << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     generate_java_doc(out, field);
     if (type->is_binary()) {
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
       indent(out) << "public void set" << get_cap_name(field->get_name()) << "(byte[] value) {"
-                  << endl;
+                  << '\n';
       indent(out) << "  set" << get_cap_name(field->get_name());
 
       if (unsafe_binaries_) {
-        indent(out) << "(java.nio.ByteBuffer.wrap(value));" << endl;
+        indent(out) << "(java.nio.ByteBuffer.wrap(value));" << '\n';
       } else {
-        indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << endl;
+        indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << '\n';
       }
 
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
 
-      out << endl;
+      out << '\n';
     }
     if (is_deprecated) {
-      indent(out) << "@Deprecated" << endl;
+      indent(out) << "@Deprecated" << '\n';
     }
     indent(out) << "public void set" << get_cap_name(field->get_name()) << "("
-                << type_name(field->get_type()) << " value) {" << endl;
+                << type_name(field->get_type()) << " value) {" << '\n';
 
-    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << endl;
+    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << '\n';
 
     if (type_can_be_null(field->get_type())) {
       indent(out) << "  value_ = java.util.Objects.requireNonNull(value,\""
-                  << "_Fields." << constant_name(field->get_name()) << "\");" << endl;
+                  << "_Fields." << constant_name(field->get_name()) << "\");" << '\n';
     } else {
-      indent(out) << "  value_ = value;" << endl;
+      indent(out) << "  value_ = value;" << '\n';
     }
 
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 }
 
@@ -1162,49 +1159,49 @@
     if (first) {
       first = false;
     } else {
-      out << endl;
+      out << '\n';
     }
 
     std::string field_name = (*m_iter)->get_name();
 
     indent(out) << "public boolean is" << get_cap_name("set") << get_cap_name(field_name) << "() {"
-                << endl;
+                << '\n';
     indent_up();
-    indent(out) << "return setField_ == _Fields." << constant_name(field_name) << ";" << endl;
+    indent(out) << "return setField_ == _Fields." << constant_name(field_name) << ";" << '\n';
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 }
 
 void t_java_generator::generate_union_abstract_methods(ostream& out, t_struct* tstruct) {
   generate_check_type(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_standard_scheme_read_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_standard_scheme_write_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_tuple_scheme_read_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_tuple_scheme_write_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_get_field_desc(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_get_struct_desc(out, tstruct);
-  out << endl;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "protected _Fields enumForId(short id) {" << endl;
-  indent(out) << "  return _Fields.findByThriftIdOrThrow(id);" << endl;
-  indent(out) << "}" << endl;
+  out << '\n';
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "protected _Fields enumForId(short id) {" << '\n';
+  indent(out) << "  return _Fields.findByThriftIdOrThrow(id);" << '\n';
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_check_type(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "protected void checkType(_Fields setField, java.lang.Object value) throws "
                  "java.lang.ClassCastException {"
-              << endl;
+              << '\n';
   indent_up();
 
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -1213,42 +1210,42 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true)
-                << ") {" << endl;
-    indent(out) << "    break;" << endl;
-    indent(out) << "  }" << endl;
+                << ") {" << '\n';
+    indent(out) << "    break;" << '\n';
+    indent(out) << "  }" << '\n';
     indent(out) << "  throw new java.lang.ClassCastException(\"Was expecting value of type "
                 << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
-                << "', but got \" + value.getClass().getSimpleName());" << endl;
+                << "', but got \" + value.getClass().getSimpleName());" << '\n';
     // do the real check here
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);"
-              << endl;
+              << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_standard_scheme_read_value(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out)
       << "protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol "
          "iprot, org.apache.thrift.protocol.TField field) throws "
          "org.apache.thrift.TException {"
-      << endl;
+      << '\n';
 
   indent_up();
 
-  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
+  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << '\n';
+  indent(out) << "if (setField != null) {" << '\n';
   indent_up();
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -1257,53 +1254,53 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << "if (field.type == " << constant_name(field->get_name()) << "_FIELD_DESC.type) {"
-                << endl;
+                << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
+                << '\n';
     generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
+    indent(out) << "return " << field->get_name() << ";" << '\n';
     indent_down();
-    indent(out) << "} else {" << endl;
-    indent(out) << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << endl;
-    indent(out) << "  return null;" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "} else {" << '\n';
+    indent(out) << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << '\n';
+    indent(out) << "  return null;" << '\n';
+    indent(out) << "}" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out)
       << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
          "of the case statements!\");"
-      << endl;
+      << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "} else {" << endl;
+  indent(out) << "} else {" << '\n';
   indent_up();
-  indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << endl;
-  indent(out) << "return null;" << endl;
+  indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << '\n';
+  indent(out) << "return null;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_standard_scheme_write_value(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol "
                  "oprot) throws org.apache.thrift.TException {"
-              << endl;
+              << '\n';
 
   indent_up();
 
-  indent(out) << "switch (setField_) {" << endl;
+  indent(out) << "switch (setField_) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -1312,42 +1309,42 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
+                << type_name(field->get_type(), true, false) << ")value_;" << '\n';
     generate_serialize_field(out, field);
-    indent(out) << "return;" << endl;
+    indent(out) << "return;" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out)
       << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
          "setField_);"
-      << endl;
+      << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
 
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_tuple_scheme_read_value(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out)
       << "protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol "
          "iprot, short fieldID) throws org.apache.thrift.TException {"
-      << endl;
+      << '\n';
 
   indent_up();
 
-  indent(out) << "_Fields setField = _Fields.findByThriftId(fieldID);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
+  indent(out) << "_Fields setField = _Fields.findByThriftId(fieldID);" << '\n';
+  indent(out) << "if (setField != null) {" << '\n';
   indent_up();
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -1356,45 +1353,45 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
+                << '\n';
     generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
+    indent(out) << "return " << field->get_name() << ";" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out)
       << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
          "of the case statements!\");"
-      << endl;
+      << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "} else {" << endl;
+  indent(out) << "} else {" << '\n';
   indent_up();
   indent(out) << "throw new org.apache.thrift.protocol.TProtocolException(\"Couldn't find a field "
                  "with field id \" + fieldID);"
-              << endl;
+              << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_tuple_scheme_write_value(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) "
                  "throws org.apache.thrift.TException {"
-              << endl;
+              << '\n';
 
   indent_up();
 
-  indent(out) << "switch (setField_) {" << endl;
+  indent(out) << "switch (setField_) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -1403,119 +1400,119 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
+                << type_name(field->get_type(), true, false) << ")value_;" << '\n';
     generate_serialize_field(out, field);
-    indent(out) << "return;" << endl;
+    indent(out) << "return;" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out)
       << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
          "setField_);"
-      << endl;
+      << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
 
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_get_field_desc(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {"
-              << endl;
+              << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
+    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << '\n';
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);"
-              << endl;
+              << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_get_struct_desc(ostream& out, t_struct* tstruct) {
   (void)tstruct;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "protected org.apache.thrift.protocol.TStruct getStructDesc() {" << endl;
-  indent(out) << "  return STRUCT_DESC;" << endl;
-  indent(out) << "}" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "protected org.apache.thrift.protocol.TStruct getStructDesc() {" << '\n';
+  indent(out) << "  return STRUCT_DESC;" << '\n';
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_union_comparisons(ostream& out, t_struct* tstruct) {
   // equality
-  indent(out) << "public boolean equals(java.lang.Object other) {" << endl;
-  indent(out) << "  if (other instanceof " << make_valid_java_identifier(tstruct->get_name()) << ") {" << endl;
-  indent(out) << "    return equals((" << make_valid_java_identifier(tstruct->get_name()) << ")other);" << endl;
-  indent(out) << "  } else {" << endl;
-  indent(out) << "    return false;" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl;
+  indent(out) << "public boolean equals(java.lang.Object other) {" << '\n';
+  indent(out) << "  if (other instanceof " << make_valid_java_identifier(tstruct->get_name()) << ") {" << '\n';
+  indent(out) << "    return equals((" << make_valid_java_identifier(tstruct->get_name()) << ")other);" << '\n';
+  indent(out) << "  } else {" << '\n';
+  indent(out) << "    return false;" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n';
 
-  out << endl;
+  out << '\n';
 
-  indent(out) << "public boolean equals(" << make_valid_java_identifier(tstruct->get_name()) << " other) {" << endl;
+  indent(out) << "public boolean equals(" << make_valid_java_identifier(tstruct->get_name()) << " other) {" << '\n';
   indent(out) << "  return other != null && getSetField() == other.getSetField() && "
                  "getFieldValue().equals(other.getFieldValue());"
-              << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+              << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
 
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << '\n';
   indent(out) << "  int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), "
                  "other.getSetField());"
-              << endl;
-  indent(out) << "  if (lastComparison == 0) {" << endl;
+              << '\n';
+  indent(out) << "  if (lastComparison == 0) {" << '\n';
   indent(out) << "    return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), "
                  "other.getFieldValue());"
-              << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return lastComparison;" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+              << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "  return lastComparison;" << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
 }
 
 void t_java_generator::generate_union_hashcode(ostream& out, t_struct* tstruct) {
   (void)tstruct;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public int hashCode() {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public int hashCode() {" << '\n';
   indent(out)
       << "  java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();"
-      << endl;
-  indent(out) << "  list.add(this.getClass().getName());" << endl;
-  indent(out) << "  org.apache.thrift.TFieldIdEnum setField = getSetField();" << endl;
-  indent(out) << "  if (setField != null) {" << endl;
-  indent(out) << "    list.add(setField.getThriftFieldId());" << endl;
-  indent(out) << "    java.lang.Object value = getFieldValue();" << endl;
-  indent(out) << "    if (value instanceof org.apache.thrift.TEnum) {" << endl;
-  indent(out) << "      list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());" << endl;
-  indent(out) << "    } else {" << endl;
-  indent(out) << "      list.add(value);" << endl;
-  indent(out) << "    }" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return list.hashCode();" << endl;
+      << '\n';
+  indent(out) << "  list.add(this.getClass().getName());" << '\n';
+  indent(out) << "  org.apache.thrift.TFieldIdEnum setField = getSetField();" << '\n';
+  indent(out) << "  if (setField != null) {" << '\n';
+  indent(out) << "    list.add(setField.getThriftFieldId());" << '\n';
+  indent(out) << "    java.lang.Object value = getFieldValue();" << '\n';
+  indent(out) << "    if (value instanceof org.apache.thrift.TEnum) {" << '\n';
+  indent(out) << "      list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());" << '\n';
+  indent(out) << "    } else {" << '\n';
+  indent(out) << "      list.add(value);" << '\n';
+  indent(out) << "    }" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "  return list.hashCode();" << '\n';
   indent(out) << "}";
 }
 
@@ -1545,7 +1542,7 @@
   }
 
   if (is_deprecated) {
-    indent(out) << "@Deprecated" << endl;
+    indent(out) << "@Deprecated" << '\n';
   }
   indent(out) << "public " << (is_final ? "final " : "") << (in_class ? "static " : "") << "class "
               << make_valid_java_identifier(tstruct->get_name()) << " ";
@@ -1571,15 +1568,15 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  out << endl;
+  out << '\n';
 
   generate_field_descs(out, tstruct);
 
-  out << endl;
+  out << '\n';
 
   generate_scheme_map(out, tstruct);
 
-  out << endl;
+  out << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     if (bean_style_ || private_members_) {
@@ -1588,10 +1585,10 @@
       generate_java_doc(out, *m_iter);
       indent(out) << "public ";
     }
-    out << declare_field(*m_iter, false, true) << endl;
+    out << declare_field(*m_iter, false, true) << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   if (android_style_) {
     generate_java_struct_parcelable(out, tstruct);
@@ -1601,9 +1598,9 @@
 
   // isset data
   if (members.size() > 0) {
-    out << endl;
+    out << '\n';
 
-    indent(out) << "// isset id assignments" << endl;
+    indent(out) << "// isset id assignments" << '\n';
 
     int i = 0;
     int optionals = 0;
@@ -1613,7 +1610,7 @@
       }
       if (!type_can_be_null((*m_iter)->get_type())) {
         indent(out) << "private static final int " << isset_field_id(*m_iter) << " = " << i << ";"
-                    << endl;
+                    << '\n';
         i++;
       }
     }
@@ -1623,11 +1620,11 @@
     case ISSET_NONE:
       break;
     case ISSET_PRIMITIVE:
-      indent(out) << "private " << primitiveType << " __isset_bitfield = 0;" << endl;
+      indent(out) << "private " << primitiveType << " __isset_bitfield = 0;" << '\n';
       break;
     case ISSET_BITSET:
       indent(out) << "private java.util.BitSet __isset_bit_vector = new java.util.BitSet(" << i
-                  << ");" << endl;
+                  << ");" << '\n';
       break;
     }
 
@@ -1638,7 +1635,7 @@
           output_string = output_string + "_Fields." + constant_name((*m_iter)->get_name()) + ",";
         }
       }
-      indent(out) << output_string.substr(0, output_string.length() - 1) << "};" << endl;
+      indent(out) << output_string.substr(0, output_string.length() - 1) << "};" << '\n';
     }
   }
 
@@ -1647,7 +1644,7 @@
   bool all_optional_members = true;
 
   // Default constructor
-  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << "() {" << endl;
+  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << "() {" << '\n';
   indent_up();
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
@@ -1660,27 +1657,27 @@
     }
   }
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   if (!members.empty() && !all_optional_members) {
     // Full constructor for all fields
-    indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << "(" << endl;
+    indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << "(" << '\n';
     indent_up();
     bool first = true;
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
         if (!first) {
-          out << "," << endl;
+          out << "," << '\n';
         }
         first = false;
         indent(out) << type_name((*m_iter)->get_type()) << " " << make_valid_java_identifier((*m_iter)->get_name());
       }
     }
-    out << ")" << endl;
+    out << ")" << '\n';
     indent_down();
-    indent(out) << "{" << endl;
+    indent(out) << "{" << '\n';
     indent_up();
-    indent(out) << "this();" << endl;
+    indent(out) << "this();" << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
         t_type* type = get_true_type((*m_iter)->get_type());
@@ -1688,44 +1685,44 @@
           if (unsafe_binaries_) {
             indent(out) << "this." << make_valid_java_identifier((*m_iter)->get_name())
                         << " = " << make_valid_java_identifier((*m_iter)->get_name()) << ";"
-                        << endl;
+                        << '\n';
           } else {
             indent(out) << "this." << make_valid_java_identifier((*m_iter)->get_name())
                         << " = org.apache.thrift.TBaseHelper.copyBinary("
                         << make_valid_java_identifier((*m_iter)->get_name())
-                        << ");" << endl;
+                        << ");" << '\n';
           }
         } else {
           indent(out) << "this." << make_valid_java_identifier((*m_iter)->get_name()) << " = "
                       << make_valid_java_identifier((*m_iter)->get_name()) << ";"
-                      << endl;
+                      << '\n';
         }
         generate_isset_set(out, (*m_iter), "");
       }
     }
 
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 
   // copy constructor
-  indent(out) << "/**" << endl;
-  indent(out) << " * Performs a deep copy on <i>other</i>." << endl;
-  indent(out) << " */" << endl;
+  indent(out) << "/**" << '\n';
+  indent(out) << " * Performs a deep copy on <i>other</i>." << '\n';
+  indent(out) << " */" << '\n';
   indent(out) << "public " << make_valid_java_identifier(tstruct->get_name())
               << "(" << make_valid_java_identifier(tstruct->get_name()) << " other) {"
-              << endl;
+              << '\n';
   indent_up();
 
   switch (needs_isset(tstruct)) {
   case ISSET_NONE:
     break;
   case ISSET_PRIMITIVE:
-    indent(out) << "__isset_bitfield = other.__isset_bitfield;" << endl;
+    indent(out) << "__isset_bitfield = other.__isset_bitfield;" << '\n';
     break;
   case ISSET_BITSET:
-    indent(out) << "__isset_bit_vector.clear();" << endl;
-    indent(out) << "__isset_bit_vector.or(other.__isset_bit_vector);" << endl;
+    indent(out) << "__isset_bit_vector.clear();" << '\n';
+    indent(out) << "__isset_bit_vector.or(other.__isset_bit_vector);" << '\n';
     break;
   }
 
@@ -1736,33 +1733,33 @@
     bool can_be_null = type_can_be_null(type);
 
     if (can_be_null) {
-      indent(out) << "if (other." << generate_isset_check(field) << ") {" << endl;
+      indent(out) << "if (other." << generate_isset_check(field) << ") {" << '\n';
       indent_up();
     }
 
     if (type->is_container()) {
       generate_deep_copy_container(out, "other", field_name, "__this__" + field_name, type);
-      indent(out) << "this." << make_valid_java_identifier(field_name) << " = __this__" << field_name << ";" << endl;
+      indent(out) << "this." << make_valid_java_identifier(field_name) << " = __this__" << field_name << ";" << '\n';
     } else {
       indent(out) << "this." << make_valid_java_identifier(field_name) << " = ";
       generate_deep_copy_non_container(out, "other." + make_valid_java_identifier(field_name), field_name, type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
     if (can_be_null) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   // clone method, so that you can deep copy an object when you don't know its class.
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << " deepCopy() {" << endl;
-  indent(out) << "  return new " << make_valid_java_identifier(tstruct->get_name()) << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public " << make_valid_java_identifier(tstruct->get_name()) << " deepCopy() {" << '\n';
+  indent(out) << "  return new " << make_valid_java_identifier(tstruct->get_name()) << "(this);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   generate_java_struct_clear(out, tstruct);
 
@@ -1791,7 +1788,7 @@
   generate_java_scheme_lookup(out);
 
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1803,30 +1800,30 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  out << indent() << java_override_annotation() << endl
-      << indent() << "public void writeToParcel(android.os.Parcel out, int flags) {" << endl;
+  out << indent() << java_override_annotation() << '\n'
+      << indent() << "public void writeToParcel(android.os.Parcel out, int flags) {" << '\n';
   indent_up();
   string bitsetPrimitiveType = "";
   switch (needs_isset(tstruct, &bitsetPrimitiveType)) {
   case ISSET_NONE:
     break;
   case ISSET_PRIMITIVE:
-    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << endl;
+    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << '\n';
     if (bitsetPrimitiveType == "byte") {
-      indent(out) << "out.writeByte(__isset_bitfield);" << endl;
+      indent(out) << "out.writeByte(__isset_bitfield);" << '\n';
     } else if (bitsetPrimitiveType == "short") {
-      indent(out) << "out.writeInt(new Short(__isset_bitfield).intValue());" << endl;
+      indent(out) << "out.writeInt(new Short(__isset_bitfield).intValue());" << '\n';
     } else if (bitsetPrimitiveType == "int") {
-      indent(out) << "out.writeInt(__isset_bitfield);" << endl;
+      indent(out) << "out.writeInt(__isset_bitfield);" << '\n';
     } else if (bitsetPrimitiveType == "long") {
-      indent(out) << "out.writeLong(__isset_bitfield);" << endl;
+      indent(out) << "out.writeLong(__isset_bitfield);" << '\n';
     }
-    out << endl;
+    out << '\n';
     break;
   case ISSET_BITSET:
-    indent(out) << "//BitSet" << endl;
-    indent(out) << "out.writeSerializable(__isset_bit_vector);" << endl;
-    out << endl;
+    indent(out) << "//BitSet" << '\n';
+    indent(out) << "out.writeSerializable(__isset_bit_vector);" << '\n';
+    out << '\n';
     break;
   }
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1834,54 +1831,54 @@
     string name = (*m_iter)->get_name();
 
     if (t->is_struct()) {
-      indent(out) << "out.writeParcelable(" << name << ", flags);" << endl;
+      indent(out) << "out.writeParcelable(" << name << ", flags);" << '\n';
     } else if (type_name(t) == "float") {
-      indent(out) << "out.writeFloat(" << name << ");" << endl;
+      indent(out) << "out.writeFloat(" << name << ");" << '\n';
     } else if (t->is_enum()) {
       indent(out) << "out.writeInt(" << name << " != null ? " << name << ".getValue() : -1);"
-                  << endl;
+                  << '\n';
     } else if (t->is_list()) {
       if (((t_list*)t)->get_elem_type()->get_true_type()->is_struct()) {
-        indent(out) << "out.writeTypedList(" << name << ");" << endl;
+        indent(out) << "out.writeTypedList(" << name << ");" << '\n';
       } else {
-        indent(out) << "out.writeList(" << name << ");" << endl;
+        indent(out) << "out.writeList(" << name << ");" << '\n';
       }
     } else if (t->is_map()) {
-      indent(out) << "out.writeMap(" << name << ");" << endl;
+      indent(out) << "out.writeMap(" << name << ");" << '\n';
     } else if (t->is_base_type()) {
       if (t->is_binary()) {
-        indent(out) << "out.writeInt(" << name << "!=null ? 1 : 0);" << endl;
-        indent(out) << "if(" << name << " != null) { " << endl;
+        indent(out) << "out.writeInt(" << name << "!=null ? 1 : 0);" << '\n';
+        indent(out) << "if(" << name << " != null) { " << '\n';
         indent_up();
         indent(out) << "out.writeByteArray(" << name << ".array(), " << name << ".position() + "
                     << name << ".arrayOffset(), " << name << ".limit() - " << name
-                    << ".position() );" << endl;
+                    << ".position() );" << '\n';
         scope_down(out);
       } else {
         switch (((t_base_type*)t)->get_base()) {
         case t_base_type::TYPE_I16:
-          indent(out) << "out.writeInt(new Short(" << name << ").intValue());" << endl;
+          indent(out) << "out.writeInt(new Short(" << name << ").intValue());" << '\n';
           break;
         case t_base_type::TYPE_UUID:
-          indent(out) << "out.writeUuid(" << name << ");" << endl;
+          indent(out) << "out.writeUuid(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_I32:
-          indent(out) << "out.writeInt(" << name << ");" << endl;
+          indent(out) << "out.writeInt(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_I64:
-          indent(out) << "out.writeLong(" << name << ");" << endl;
+          indent(out) << "out.writeLong(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_BOOL:
-          indent(out) << "out.writeInt(" << name << " ? 1 : 0);" << endl;
+          indent(out) << "out.writeInt(" << name << " ? 1 : 0);" << '\n';
           break;
         case t_base_type::TYPE_I8:
-          indent(out) << "out.writeByte(" << name << ");" << endl;
+          indent(out) << "out.writeByte(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_DOUBLE:
-          indent(out) << "out.writeDouble(" << name << ");" << endl;
+          indent(out) << "out.writeDouble(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_STRING:
-          indent(out) << "out.writeString(" << name << ");" << endl;
+          indent(out) << "out.writeString(" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_VOID:
           break;
@@ -1892,38 +1889,38 @@
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  out << indent() << java_override_annotation() << endl
-      << indent() << "public int describeContents() {" << endl;
+  out << indent() << java_override_annotation() << '\n'
+      << indent() << "public int describeContents() {" << '\n';
   indent_up();
-  out << indent() << "return 0;" << endl;
+  out << indent() << "return 0;" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  indent(out) << "public " << tname << "(android.os.Parcel in) {" << endl;
+  indent(out) << "public " << tname << "(android.os.Parcel in) {" << '\n';
   indent_up();
   // read in the required bitfield
   switch (needs_isset(tstruct, &bitsetPrimitiveType)) {
   case ISSET_NONE:
     break;
   case ISSET_PRIMITIVE:
-    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << endl;
+    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << '\n';
     if (bitsetPrimitiveType == "byte") {
-      indent(out) << "__isset_bitfield = in.readByte();" << endl;
+      indent(out) << "__isset_bitfield = in.readByte();" << '\n';
     } else if (bitsetPrimitiveType == "short") {
-      indent(out) << "__isset_bitfield = (short) in.readInt();" << endl;
+      indent(out) << "__isset_bitfield = (short) in.readInt();" << '\n';
     } else if (bitsetPrimitiveType == "int") {
-      indent(out) << "__isset_bitfield = in.readInt();" << endl;
+      indent(out) << "__isset_bitfield = in.readInt();" << '\n';
     } else if (bitsetPrimitiveType == "long") {
-      indent(out) << "__isset_bitfield = in.readLong();" << endl;
+      indent(out) << "__isset_bitfield = in.readLong();" << '\n';
     }
-    out << endl;
+    out << '\n';
     break;
   case ISSET_BITSET:
-    indent(out) << "//BitSet" << endl;
-    indent(out) << "__isset_bit_vector = (java.util.BitSet) in.readSerializable();" << endl;
-    out << endl;
+    indent(out) << "//BitSet" << '\n';
+    indent(out) << "__isset_bit_vector = (java.util.BitSet) in.readSerializable();" << '\n';
+    out << '\n';
     break;
   }
   // read all the fields
@@ -1934,57 +1931,57 @@
 
     if (t->is_struct()) {
       indent(out) << prefix << "= in.readParcelable(" << tname << ".class.getClassLoader());"
-                  << endl;
+                  << '\n';
     } else if (t->is_enum()) {
-      indent(out) << prefix << " = " << type_name(t) << ".findByValue(in.readInt());" << endl;
+      indent(out) << prefix << " = " << type_name(t) << ".findByValue(in.readInt());" << '\n';
     } else if (t->is_list()) {
       t_list* list = (t_list*)t;
-      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << endl;
+      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << '\n';
       if (list->get_elem_type()->get_true_type()->is_struct()) {
         indent(out) << "in.readTypedList(" << prefix << ", " << type_name(list->get_elem_type())
-                    << ".CREATOR);" << endl;
+                    << ".CREATOR);" << '\n';
       } else {
         indent(out) << "in.readList(" << prefix << ", " << tname << ".class.getClassLoader());"
-                    << endl;
+                    << '\n';
       }
     } else if (t->is_map()) {
-      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << endl;
+      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << '\n';
       indent(out) << " in.readMap(" << prefix << ", " << tname << ".class.getClassLoader());"
-                  << endl;
+                  << '\n';
     } else if (type_name(t) == "float") {
-      indent(out) << prefix << " = in.readFloat();" << endl;
+      indent(out) << prefix << " = in.readFloat();" << '\n';
     } else if (t->is_base_type()) {
       t_base_type* bt = (t_base_type*)t;
       if (bt->is_binary()) {
-        indent(out) << "if(in.readInt()==1) {" << endl;
+        indent(out) << "if(in.readInt()==1) {" << '\n';
         indent_up();
-        indent(out) << prefix << " = java.nio.ByteBuffer.wrap(in.createByteArray());" << endl;
+        indent(out) << prefix << " = java.nio.ByteBuffer.wrap(in.createByteArray());" << '\n';
         scope_down(out);
       } else {
         switch (bt->get_base()) {
         case t_base_type::TYPE_I8:
-          indent(out) << prefix << " = in.readByte();" << endl;
+          indent(out) << prefix << " = in.readByte();" << '\n';
           break;
         case t_base_type::TYPE_I16:
-          indent(out) << prefix << " = (short) in.readInt();" << endl;
+          indent(out) << prefix << " = (short) in.readInt();" << '\n';
           break;
         case t_base_type::TYPE_I32:
-          indent(out) << prefix << " = in.readInt();" << endl;
+          indent(out) << prefix << " = in.readInt();" << '\n';
           break;
         case t_base_type::TYPE_I64:
-          indent(out) << prefix << " = in.readLong();" << endl;
+          indent(out) << prefix << " = in.readLong();" << '\n';
           break;
         case t_base_type::TYPE_UUID:
-          indent(out) << prefix << " = in.readUuid();" << endl;
+          indent(out) << prefix << " = in.readUuid();" << '\n';
           break;
         case t_base_type::TYPE_BOOL:
-          indent(out) << prefix << " = (in.readInt()==1);" << endl;
+          indent(out) << prefix << " = (in.readInt()==1);" << '\n';
           break;
         case t_base_type::TYPE_DOUBLE:
-          indent(out) << prefix << " = in.readDouble();" << endl;
+          indent(out) << prefix << " = in.readDouble();" << '\n';
           break;
         case t_base_type::TYPE_STRING:
-          indent(out) << prefix << "= in.readString();" << endl;
+          indent(out) << prefix << "= in.readString();" << '\n';
           break;
         case t_base_type::TYPE_VOID:
           break;
@@ -1996,29 +1993,29 @@
   }
 
   scope_down(out);
-  out << endl;
+  out << '\n';
 
   indent(out) << "public static final android.os.Parcelable.Creator<" << tname
-              << "> CREATOR = new android.os.Parcelable.Creator<" << tname << ">() {" << endl;
+              << "> CREATOR = new android.os.Parcelable.Creator<" << tname << ">() {" << '\n';
   indent_up();
 
-  indent(out) << java_override_annotation() << endl
-              << indent() << "public " << tname << "[] newArray(int size) {" << endl;
+  indent(out) << java_override_annotation() << '\n'
+              << indent() << "public " << tname << "[] newArray(int size) {" << '\n';
   indent_up();
-  indent(out) << "return new " << tname << "[size];" << endl;
+  indent(out) << "return new " << tname << "[size];" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  indent(out) << java_override_annotation() << endl
+  indent(out) << java_override_annotation() << '\n'
               << indent() << "public " << tname << " createFromParcel(android.os.Parcel in) {"
-              << endl;
+              << '\n';
   indent_up();
-  indent(out) << "return new " << tname << "(in);" << endl;
+  indent(out) << "return new " << tname << "(in);" << '\n';
   scope_down(out);
 
   indent_down();
-  indent(out) << "};" << endl;
-  out << endl;
+  indent(out) << "};" << '\n';
+  out << '\n';
 }
 
 /**
@@ -2027,26 +2024,26 @@
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_equality(ostream& out, t_struct* tstruct) {
-  out << indent() << java_override_annotation() << endl
-      << indent() << "public boolean equals(java.lang.Object that) {" << endl;
+  out << indent() << java_override_annotation() << '\n'
+      << indent() << "public boolean equals(java.lang.Object that) {" << '\n';
   indent_up();
-  out << indent() << "if (that instanceof " << make_valid_java_identifier(tstruct->get_name()) << ")" << endl
-      << indent() << "  return this.equals((" << make_valid_java_identifier(tstruct->get_name()) << ")that);" << endl
-      << indent() << "return false;" << endl;
+  out << indent() << "if (that instanceof " << make_valid_java_identifier(tstruct->get_name()) << ")" << '\n'
+      << indent() << "  return this.equals((" << make_valid_java_identifier(tstruct->get_name()) << ")that);" << '\n'
+      << indent() << "return false;" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  out << indent() << "public boolean equals(" << make_valid_java_identifier(tstruct->get_name()) << " that) {" << endl;
+  out << indent() << "public boolean equals(" << make_valid_java_identifier(tstruct->get_name()) << " that) {" << '\n';
   indent_up();
-  out << indent() << "if (that == null)" << endl
-      << indent() << "  return false;" << endl
-      << indent() << "if (this == that)" << endl
-      << indent() << "  return true;" << endl;
+  out << indent() << "if (that == null)" << '\n'
+      << indent() << "  return false;" << '\n'
+      << indent() << "if (this == that)" << '\n'
+      << indent() << "  return true;" << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
+    out << '\n';
 
     t_type* t = get_true_type((*m_iter)->get_type());
     // Most existing Thrift code does not use isset or optional/required,
@@ -2064,14 +2061,14 @@
       that_present += " && that." + generate_isset_check(*m_iter);
     }
 
-    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << endl
-        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << endl
+    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << '\n'
+        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << '\n'
         << indent() << "if ("
-        << "this_present_" << name << " || that_present_" << name << ") {" << endl;
+        << "this_present_" << name << " || that_present_" << name << ") {" << '\n';
     indent_up();
     out << indent() << "if (!("
-        << "this_present_" << name << " && that_present_" << name << "))" << endl
-        << indent() << "  return false;" << endl;
+        << "this_present_" << name << " && that_present_" << name << "))" << '\n'
+        << indent() << "  return false;" << '\n';
 
     if (t->is_binary()) {
       unequal = "!this." + make_valid_java_identifier(name) + ".equals(that." + make_valid_java_identifier(name) + ")";
@@ -2081,25 +2078,25 @@
       unequal = "this." + make_valid_java_identifier(name) + " != that." + make_valid_java_identifier(name);
     }
 
-    out << indent() << "if (" << unequal << ")" << endl << indent() << "  return false;" << endl;
+    out << indent() << "if (" << unequal << ")" << '\n' << indent() << "  return false;" << '\n';
 
     scope_down(out);
   }
-  out << endl;
-  indent(out) << "return true;" << endl;
+  out << '\n';
+  indent(out) << "return true;" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
   const int MUL = 8191; // HashCode multiplier
   const int B_YES = 131071;
   const int B_NO = 524287;
-  out << indent() << java_override_annotation() << endl
-      << indent() << "public int hashCode() {" << endl;
+  out << indent() << java_override_annotation() << '\n'
+      << indent() << "public int hashCode() {" << '\n';
   indent_up();
-  indent(out) << "int hashCode = 1;" << endl;
+  indent(out) << "int hashCode = 1;" << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
+    out << '\n';
 
     t_type* t = get_true_type((*m_iter)->get_type());
     bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
@@ -2108,37 +2105,37 @@
 
     if (is_optional || can_be_null) {
       indent(out) << "hashCode = hashCode * " << MUL << " + ((" << generate_isset_check(*m_iter)
-                  << ") ? " << B_YES << " : " << B_NO << ");" << endl;
+                  << ") ? " << B_YES << " : " << B_NO << ");" << '\n';
     }
 
     if (is_optional || can_be_null) {
-      indent(out) << "if (" + generate_isset_check(*m_iter) + ")" << endl;
+      indent(out) << "if (" + generate_isset_check(*m_iter) + ")" << '\n';
       indent_up();
     }
 
     if (t->is_enum()) {
-      indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".getValue();" << endl;
+      indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".getValue();" << '\n';
     } else if (t->is_base_type()) {
       switch (((t_base_type*)t)->get_base()) {
       case t_base_type::TYPE_STRING:
       case t_base_type::TYPE_UUID:
-        indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << endl;
+        indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << '\n';
         break;
       case t_base_type::TYPE_BOOL:
         indent(out) << "hashCode = hashCode * " << MUL << " + ((" << name << ") ? " << B_YES
-                    << " : " << B_NO << ");" << endl;
+                    << " : " << B_NO << ");" << '\n';
         break;
       case t_base_type::TYPE_I8:
-        indent(out) << "hashCode = hashCode * " << MUL << " + (int) (" << name << ");" << endl;
+        indent(out) << "hashCode = hashCode * " << MUL << " + (int) (" << name << ");" << '\n';
         break;
       case t_base_type::TYPE_I16:
       case t_base_type::TYPE_I32:
-        indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ";" << endl;
+        indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ";" << '\n';
         break;
       case t_base_type::TYPE_I64:
       case t_base_type::TYPE_DOUBLE:
         indent(out) << "hashCode = hashCode * " << MUL
-                    << " + org.apache.thrift.TBaseHelper.hashCode(" << name << ");" << endl;
+                    << " + org.apache.thrift.TBaseHelper.hashCode(" << name << ");" << '\n';
         break;
       case t_base_type::TYPE_VOID:
         throw std::logic_error("compiler error: a struct field cannot be void");
@@ -2147,7 +2144,7 @@
                                + t_base_type::t_base_name(((t_base_type*)t)->get_base()));
       }
     } else {
-      indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << endl;
+      indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << '\n';
     }
 
     if (is_optional || can_be_null) {
@@ -2155,49 +2152,49 @@
     }
   }
 
-  out << endl;
-  indent(out) << "return hashCode;" << endl;
+  out << '\n';
+  indent(out) << "return hashCode;" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_java_struct_compare_to(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << '\n';
   indent_up();
 
-  indent(out) << "if (!getClass().equals(other.getClass())) {" << endl;
-  indent(out) << "  return getClass().getName().compareTo(other.getClass().getName());" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+  indent(out) << "if (!getClass().equals(other.getClass())) {" << '\n';
+  indent(out) << "  return getClass().getName().compareTo(other.getClass().getName());" << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
 
-  indent(out) << "int lastComparison = 0;" << endl;
-  out << endl;
+  indent(out) << "int lastComparison = 0;" << '\n';
+  out << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = *m_iter;
     indent(out) << "lastComparison = java.lang.Boolean.compare(" << generate_isset_check(field)
-                << ", other." << generate_isset_check(field) << ");" << endl;
-    indent(out) << "if (lastComparison != 0) {" << endl;
-    indent(out) << "  return lastComparison;" << endl;
-    indent(out) << "}" << endl;
+                << ", other." << generate_isset_check(field) << ");" << '\n';
+    indent(out) << "if (lastComparison != 0) {" << '\n';
+    indent(out) << "  return lastComparison;" << '\n';
+    indent(out) << "}" << '\n';
 
-    indent(out) << "if (" << generate_isset_check(field) << ") {" << endl;
+    indent(out) << "if (" << generate_isset_check(field) << ") {" << '\n';
     indent(out) << "  lastComparison = org.apache.thrift.TBaseHelper.compareTo(this."
                 << make_valid_java_identifier(field->get_name())
-                << ", other." << make_valid_java_identifier(field->get_name()) << ");" << endl;
-    indent(out) << "  if (lastComparison != 0) {" << endl;
-    indent(out) << "    return lastComparison;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
+                << ", other." << make_valid_java_identifier(field->get_name()) << ");" << '\n';
+    indent(out) << "  if (lastComparison != 0) {" << '\n';
+    indent(out) << "    return lastComparison;" << '\n';
+    indent(out) << "  }" << '\n';
+    indent(out) << "}" << '\n';
   }
 
-  indent(out) << "return 0;" << endl;
+  indent(out) << "return 0;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2206,63 +2203,63 @@
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_reader(ostream& out, t_struct* /*tstruct*/) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol iprot) throws "
                  "org.apache.thrift.TException {"
-              << endl;
+              << '\n';
   indent_up();
-  indent(out) << "scheme(iprot).read(iprot, this);" << endl;
+  indent(out) << "scheme(iprot).read(iprot, this);" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 // generates java method to perform various checks
 // (e.g. check that all required fields are set)
 void t_java_generator::generate_java_validator(ostream& out, t_struct* tstruct) {
-  indent(out) << "public void validate() throws org.apache.thrift.TException {" << endl;
+  indent(out) << "public void validate() throws org.apache.thrift.TException {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out << indent() << "// check for required fields" << endl;
+  out << indent() << "// check for required fields" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       if (bean_style_) {
-        out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl
+        out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << '\n'
             << indent()
             << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
-            << (*f_iter)->get_name() << "' is unset! Struct:\" + toString());" << endl
-            << indent() << "}" << endl
-            << endl;
+            << (*f_iter)->get_name() << "' is unset! Struct:\" + toString());" << '\n'
+            << indent() << "}" << '\n'
+            << '\n';
       } else {
         if (type_can_be_null((*f_iter)->get_type())) {
-          indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
+          indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << '\n';
           indent(out)
               << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
-              << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << endl;
-          indent(out) << "}" << endl;
+              << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << '\n';
+          indent(out) << "}" << '\n';
         } else {
           indent(out) << "// alas, we cannot check '" << (*f_iter)->get_name()
                       << "' because it's a primitive and you chose the non-beans generator."
-                      << endl;
+                      << '\n';
         }
       }
     }
   }
 
-  out << indent() << "// check for sub-struct validity" << endl;
+  out << indent() << "// check for sub-struct validity" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_type* type = get_true_type((*f_iter)->get_type());
     if (type->is_struct() && !((t_struct*)type)->is_union()) {
-      out << indent() << "if (" << make_valid_java_identifier((*f_iter)->get_name()) << " != null) {" << endl;
-      out << indent() << "  " << make_valid_java_identifier((*f_iter)->get_name()) << ".validate();" << endl;
-      out << indent() << "}" << endl;
+      out << indent() << "if (" << make_valid_java_identifier((*f_iter)->get_name()) << " != null) {" << '\n';
+      out << indent() << "  " << make_valid_java_identifier((*f_iter)->get_name()) << ".validate();" << '\n';
+      out << indent() << "}" << '\n';
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2271,15 +2268,15 @@
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_writer(ostream& out, t_struct* /*tstruct*/) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
                  "org.apache.thrift.TException {"
-              << endl;
+              << '\n';
   indent_up();
-  indent(out) << "scheme(oprot).write(oprot, this);" << endl;
+  indent(out) << "scheme(oprot).write(oprot, this);" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2294,30 +2291,30 @@
   (void)tstruct;
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
                  "org.apache.thrift.TException {"
-              << endl;
+              << '\n';
   indent_up();
-  indent(out) << "scheme(oprot).write(oprot, this);" << endl;
+  indent(out) << "scheme(oprot).write(oprot, this);" << '\n';
 
   indent_down();
-  indent(out) << "  }" << endl << endl;
+  indent(out) << "  }" << '\n' << '\n';
 }
 
 void t_java_generator::generate_java_struct_field_by_id(ostream& out, t_struct* tstruct) {
   (void)tstruct;
-  indent(out) << java_nullable_annotation() << endl;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public _Fields fieldForId(int fieldId) {" << endl;
-  indent(out) << "  return _Fields.findByThriftId(fieldId);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << java_nullable_annotation() << '\n';
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public _Fields fieldForId(int fieldId) {" << '\n';
+  indent(out) << "  return _Fields.findByThriftId(fieldId);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_reflection_getters(ostringstream& out,
                                                    t_type* type,
                                                    string field_name,
                                                    string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
+  indent(out) << "case " << constant_name(field_name) << ":" << '\n';
   indent_up();
-  indent(out) << "return " << (type->is_bool() ? "is" : "get") << cap_name << "();" << endl << endl;
+  indent(out) << "return " << (type->is_bool() ? "is" : "get") << cap_name << "();" << '\n' << '\n';
   indent_down();
 }
 
@@ -2326,24 +2323,24 @@
                                                    string field_name,
                                                    string cap_name) {
   const bool is_binary = type->is_binary();
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
+  indent(out) << "case " << constant_name(field_name) << ":" << '\n';
   indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
+  indent(out) << "if (value == null) {" << '\n';
+  indent(out) << "  unset" << get_cap_name(field_name) << "();" << '\n';
+  indent(out) << "} else {" << '\n';
   if (is_binary) {
     indent_up();
-    indent(out) << "if (value instanceof byte[]) {" << endl;
-    indent(out) << "  set" << cap_name << "((byte[])value);" << endl;
-    indent(out) << "} else {" << endl;
+    indent(out) << "if (value instanceof byte[]) {" << '\n';
+    indent(out) << "  set" << cap_name << "((byte[])value);" << '\n';
+    indent(out) << "} else {" << '\n';
   }
-  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << endl;
+  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << '\n';
   if (is_binary) {
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
     indent_down();
   }
-  indent(out) << "}" << endl;
-  indent(out) << "break;" << endl << endl;
+  indent(out) << "}" << '\n';
+  indent(out) << "break;" << '\n' << '\n';
 
   indent_down();
 }
@@ -2370,25 +2367,25 @@
 
   // create the setter
 
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void setFieldValue(_Fields field, " << java_nullable_annotation()
-              << " java.lang.Object value) {" << endl;
-  indent(out) << "  switch (field) {" << endl;
+              << " java.lang.Object value) {" << '\n';
+  indent(out) << "  switch (field) {" << '\n';
   out << setter_stream.str();
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   // create the getter
-  indent(out) << java_nullable_annotation() << endl;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public java.lang.Object getFieldValue(_Fields field) {" << endl;
+  indent(out) << java_nullable_annotation() << '\n';
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public java.lang.Object getFieldValue(_Fields field) {" << '\n';
   indent_up();
-  indent(out) << "switch (field) {" << endl;
+  indent(out) << "switch (field) {" << '\n';
   out << getter_stream.str();
-  indent(out) << "}" << endl;
-  indent(out) << "throw new java.lang.IllegalStateException();" << endl;
+  indent(out) << "}" << '\n';
+  indent(out) << "throw new java.lang.IllegalStateException();" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 // Creates a generic isSet method that takes the field number as argument
@@ -2399,28 +2396,28 @@
   // create the isSet method
   indent(out) << "/** Returns true if field corresponding to fieldID is set (has been assigned a "
                  "value) and false otherwise */"
-              << endl;
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public boolean isSet(_Fields field) {" << endl;
+              << '\n';
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public boolean isSet(_Fields field) {" << '\n';
   indent_up();
-  indent(out) << "if (field == null) {" << endl;
-  indent(out) << "  throw new java.lang.IllegalArgumentException();" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "if (field == null) {" << '\n';
+  indent(out) << "  throw new java.lang.IllegalArgumentException();" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "switch (field) {" << endl;
+  indent(out) << "switch (field) {" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = *f_iter;
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
-    indent(out) << "return " << generate_isset_check(field) << ";" << endl;
+    indent(out) << "return " << generate_isset_check(field) << ";" << '\n';
     indent_down();
   }
 
-  indent(out) << "}" << endl;
-  indent(out) << "throw new java.lang.IllegalStateException();" << endl;
+  indent(out) << "}" << '\n';
+  indent(out) << "throw new java.lang.IllegalStateException();" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2445,7 +2442,7 @@
       // Method to return the size of the collection
       if (optional) {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
 
         if (use_jdk8_option_type_) {
@@ -2454,20 +2451,20 @@
           indent(out) << "public " << thrift_option_class << "<Integer> get" << cap_name;
         }
 
-        out << get_cap_name("size() {") << endl;
+        out << get_cap_name("size() {") << '\n';
 
         indent_up();
-        indent(out) << "if (this." << field_name << " == null) {" << endl;
+        indent(out) << "if (this." << field_name << " == null) {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
-          indent(out) << "return " << jdk_option_class << ".empty();" << endl;
+          indent(out) << "return " << jdk_option_class << ".empty();" << '\n';
         } else {
-          indent(out) << "return " << thrift_option_class << ".none();" << endl;
+          indent(out) << "return " << thrift_option_class << ".none();" << '\n';
         }
 
         indent_down();
-        indent(out) << "} else {" << endl;
+        indent(out) << "} else {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
@@ -2475,24 +2472,24 @@
         } else {
           indent(out) << "return " << thrift_option_class << ".some(this.";
         }
-        out << field_name << ".size());" << endl;
+        out << field_name << ".size());" << '\n';
 
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       } else {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
         indent(out) << "public int get" << cap_name;
-        out << get_cap_name("size() {") << endl;
+        out << get_cap_name("size() {") << '\n';
 
         indent_up();
         indent(out) << "return (this." << field_name << " == null) ? 0 : "
-                    << "this." << field_name << ".size();" << endl;
+                    << "this." << field_name << ".size();" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       }
     }
 
@@ -2507,7 +2504,7 @@
       // Iterator getter for sets and lists
       if (optional) {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
 
         if (use_jdk8_option_type_) {
@@ -2518,20 +2515,20 @@
         out << "java.util.Iterator<" << type_name(element_type, true, false) << ">> get"
             << cap_name;
 
-        out << get_cap_name("iterator() {") << endl;
+        out << get_cap_name("iterator() {") << '\n';
 
         indent_up();
-        indent(out) << "if (this." << field_name << " == null) {" << endl;
+        indent(out) << "if (this." << field_name << " == null) {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
-          indent(out) << "return " << jdk_option_class << ".empty();" << endl;
+          indent(out) << "return " << jdk_option_class << ".empty();" << '\n';
         } else {
-          indent(out) << "return " << thrift_option_class << ".none();" << endl;
+          indent(out) << "return " << thrift_option_class << ".none();" << '\n';
         }
 
         indent_down();
-        indent(out) << "} else {" << endl;
+        indent(out) << "} else {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
@@ -2539,104 +2536,104 @@
         } else {
           indent(out) << "return " << thrift_option_class << ".some(this.";
         }
-        out << field_name << ".iterator());" << endl;
+        out << field_name << ".iterator());" << '\n';
 
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       } else {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
-        indent(out) << java_nullable_annotation() << endl;
+        indent(out) << java_nullable_annotation() << '\n';
         indent(out) << "public java.util.Iterator<" << type_name(element_type, true, false)
                     << "> get" << cap_name;
-        out << get_cap_name("iterator() {") << endl;
+        out << get_cap_name("iterator() {") << '\n';
 
         indent_up();
         indent(out) << "return (this." << field_name << " == null) ? null : "
-                    << "this." << field_name << ".iterator();" << endl;
+                    << "this." << field_name << ".iterator();" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       }
 
       // Add to set or list, create if the set/list is null
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
       indent(out) << "public void add" << get_cap_name("to");
-      out << cap_name << "(" << type_name(element_type) << " elem) {" << endl;
+      out << cap_name << "(" << type_name(element_type) << " elem) {" << '\n';
 
       indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
+      indent(out) << "if (this." << field_name << " == null) {" << '\n';
       indent_up();
       indent(out) << "this." << field_name;
       if (is_enum_set(type)) {
         out << " = " << type_name(type, false, true, true) << ".noneOf("
-            << inner_enum_type_name(type) << ");" << endl;
+            << inner_enum_type_name(type) << ");" << '\n';
       } else {
-        out << " = new " << type_name(type, false, true) << "();" << endl;
+        out << " = new " << type_name(type, false, true) << "();" << '\n';
       }
       indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".add(elem);" << endl;
+      indent(out) << "}" << '\n';
+      indent(out) << "this." << field_name << ".add(elem);" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     } else if (type->is_map()) {
       // Put to map
       t_type* key_type = ((t_map*)type)->get_key_type();
       t_type* val_type = ((t_map*)type)->get_val_type();
 
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
       indent(out) << "public void put" << get_cap_name("to");
       out << cap_name << "(" << type_name(key_type) << " key, " << type_name(val_type) << " val) {"
-          << endl;
+          << '\n';
 
       indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
+      indent(out) << "if (this." << field_name << " == null) {" << '\n';
       indent_up();
       std::string constructor_args;
       if (is_enum_map(type)) {
         constructor_args = inner_enum_type_name(type);
       }
       indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "("
-                  << constructor_args << ");" << endl;
+                  << constructor_args << ");" << '\n';
       indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".put(key, val);" << endl;
+      indent(out) << "}" << '\n';
+      indent(out) << "this." << field_name << ".put(key, val);" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
 
     // Simple getter
     generate_java_doc(out, field);
     if (type->is_binary()) {
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
-      indent(out) << "public byte[] get" << cap_name << "() {" << endl;
+      indent(out) << "public byte[] get" << cap_name << "() {" << '\n';
       indent(out) << "  set" << cap_name << "(org.apache.thrift.TBaseHelper.rightSize("
-                  << field_name << "));" << endl;
+                  << field_name << "));" << '\n';
       indent(out) << "  return " << field_name << " == null ? null : " << field_name << ".array();"
-                  << endl;
-      indent(out) << "}" << endl << endl;
+                  << '\n';
+      indent(out) << "}" << '\n' << '\n';
 
       indent(out) << "public java.nio.ByteBuffer buffer" << get_cap_name("for") << cap_name
-                  << "() {" << endl;
+                  << "() {" << '\n';
       if (unsafe_binaries_) {
-        indent(out) << "  return " << field_name << ";" << endl;
+        indent(out) << "  return " << field_name << ";" << '\n';
       } else {
         indent(out) << "  return org.apache.thrift.TBaseHelper.copyBinary(" << field_name << ");"
-                    << endl;
+                    << '\n';
       }
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     } else {
       if (optional) {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
 
         if (use_jdk8_option_type_) {
@@ -2650,10 +2647,10 @@
         } else {
           out << " get";
         }
-        out << cap_name << "() {" << endl;
+        out << cap_name << "() {" << '\n';
         indent_up();
 
-        indent(out) << "if (this.isSet" << cap_name << "()) {" << endl;
+        indent(out) << "if (this.isSet" << cap_name << "()) {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
@@ -2661,28 +2658,28 @@
         } else {
           indent(out) << "return " << thrift_option_class << ".some(this.";
         }
-        out << field_name << ");" << endl;
+        out << field_name << ");" << '\n';
 
         indent_down();
-        indent(out) << "} else {" << endl;
+        indent(out) << "} else {" << '\n';
         indent_up();
 
         if (use_jdk8_option_type_) {
-          indent(out) << "return " << jdk_option_class << ".empty();" << endl;
+          indent(out) << "return " << jdk_option_class << ".empty();" << '\n';
         } else {
-          indent(out) << "return " << thrift_option_class << ".none();" << endl;
+          indent(out) << "return " << thrift_option_class << ".none();" << '\n';
         }
 
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       } else {
         if (is_deprecated) {
-          indent(out) << "@Deprecated" << endl;
+          indent(out) << "@Deprecated" << '\n';
         }
         if (type_can_be_null(type)) {
-          indent(out) << java_nullable_annotation() << endl;
+          indent(out) << java_nullable_annotation() << '\n';
         }
         indent(out) << "public " << type_name(type);
         if (type->is_base_type() && ((t_base_type*)type)->get_base() == t_base_type::TYPE_BOOL) {
@@ -2690,11 +2687,11 @@
         } else {
           out << " get";
         }
-        out << cap_name << "() {" << endl;
+        out << cap_name << "() {" << '\n';
         indent_up();
-        indent(out) << "return this." << make_valid_java_identifier(field_name) << ";" << endl;
+        indent(out) << "return this." << make_valid_java_identifier(field_name) << ";" << '\n';
         indent_down();
-        indent(out) << "}" << endl << endl;
+        indent(out) << "}" << '\n' << '\n';
       }
     }
 
@@ -2702,7 +2699,7 @@
     generate_java_doc(out, field);
     if (type->is_binary()) {
       if (is_deprecated) {
-        indent(out) << "@Deprecated" << endl;
+        indent(out) << "@Deprecated" << '\n';
       }
       indent(out) << "public ";
       if (bean_style_) {
@@ -2710,23 +2707,23 @@
       } else {
         out << type_name(tstruct);
       }
-      out << " set" << cap_name << "(byte[] " << make_valid_java_identifier(field_name) << ") {" << endl;
+      out << " set" << cap_name << "(byte[] " << make_valid_java_identifier(field_name) << ") {" << '\n';
       indent(out) << "  this." << make_valid_java_identifier(field_name) << " = " << make_valid_java_identifier(field_name)
                   << " == null ? (java.nio.ByteBuffer)null";
 
       if (unsafe_binaries_) {
-        indent(out) << " : java.nio.ByteBuffer.wrap(" << make_valid_java_identifier(field_name) << ");" << endl;
+        indent(out) << " : java.nio.ByteBuffer.wrap(" << make_valid_java_identifier(field_name) << ");" << '\n';
       } else {
-        indent(out) << " : java.nio.ByteBuffer.wrap(" << make_valid_java_identifier(field_name) << ".clone());" << endl;
+        indent(out) << " : java.nio.ByteBuffer.wrap(" << make_valid_java_identifier(field_name) << ".clone());" << '\n';
       }
 
       if (!bean_style_) {
-        indent(out) << "  return this;" << endl;
+        indent(out) << "  return this;" << '\n';
       }
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
     if (is_deprecated) {
-      indent(out) << "@Deprecated" << endl;
+      indent(out) << "@Deprecated" << '\n';
     }
     indent(out) << "public ";
     if (bean_style_) {
@@ -2737,7 +2734,7 @@
     out << " set" << cap_name << "("
         << (type_can_be_null(type) ? (java_nullable_annotation() + " ") : "")
         << type_name(type)
-        << " " << make_valid_java_identifier(field_name) << ") {" << endl;
+        << " " << make_valid_java_identifier(field_name) << ") {" << '\n';
     indent_up();
     indent(out) << "this." << make_valid_java_identifier(field_name) << " = ";
     if (type->is_binary() && !unsafe_binaries_) {
@@ -2745,70 +2742,70 @@
     } else {
       out << make_valid_java_identifier(field_name);
     }
-    out << ";" << endl;
+    out << ";" << '\n';
     generate_isset_set(out, field, "");
     if (!bean_style_) {
-      indent(out) << "return this;" << endl;
+      indent(out) << "return this;" << '\n';
     }
 
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // Unsetter
     if (is_deprecated) {
-      indent(out) << "@Deprecated" << endl;
+      indent(out) << "@Deprecated" << '\n';
     }
-    indent(out) << "public void unset" << cap_name << "() {" << endl;
+    indent(out) << "public void unset" << cap_name << "() {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "this." << make_valid_java_identifier(field_name) << " = null;" << endl;
+      indent(out) << "this." << make_valid_java_identifier(field_name) << " = null;" << '\n';
     } else if (issetType == ISSET_PRIMITIVE) {
       indent(out)
           << "__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, "
-          << isset_field_id(field) << ");" << endl;
+          << isset_field_id(field) << ");" << '\n';
     } else {
-      indent(out) << "__isset_bit_vector.clear(" << isset_field_id(field) << ");" << endl;
+      indent(out) << "__isset_bit_vector.clear(" << isset_field_id(field) << ");" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // isSet method
     indent(out) << "/** Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise */" << endl;
+                << " is set (has been assigned a value) and false otherwise */" << '\n';
     if (is_deprecated) {
-      indent(out) << "@Deprecated" << endl;
+      indent(out) << "@Deprecated" << '\n';
     }
-    indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << endl;
+    indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "return this." << make_valid_java_identifier(field_name) << " != null;" << endl;
+      indent(out) << "return this." << make_valid_java_identifier(field_name) << " != null;" << '\n';
     } else if (issetType == ISSET_PRIMITIVE) {
       indent(out) << "return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, "
-                  << isset_field_id(field) << ");" << endl;
+                  << isset_field_id(field) << ");" << '\n';
     } else {
-      indent(out) << "return __isset_bit_vector.get(" << isset_field_id(field) << ");" << endl;
+      indent(out) << "return __isset_bit_vector.get(" << isset_field_id(field) << ");" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     if (is_deprecated) {
-      indent(out) << "@Deprecated" << endl;
+      indent(out) << "@Deprecated" << '\n';
     }
     indent(out) << "public void set" << cap_name << get_cap_name("isSet") << "(boolean value) {"
-                << endl;
+                << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "if (!value) {" << endl;
-      indent(out) << "  this." << make_valid_java_identifier(field_name) << " = null;" << endl;
-      indent(out) << "}" << endl;
+      indent(out) << "if (!value) {" << '\n';
+      indent(out) << "  this." << make_valid_java_identifier(field_name) << " = null;" << '\n';
+      indent(out) << "}" << '\n';
     } else if (issetType == ISSET_PRIMITIVE) {
       indent(out) << "__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, "
-                  << isset_field_id(field) << ", value);" << endl;
+                  << isset_field_id(field) << ", value);" << '\n';
     } else {
-      indent(out) << "__isset_bit_vector.set(" << isset_field_id(field) << ", value);" << endl;
+      indent(out) << "__isset_bit_vector.set(" << isset_field_id(field) << ", value);" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 }
 
@@ -2818,13 +2815,13 @@
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_tostring(ostream& out, t_struct* tstruct) {
-  out << indent() << java_override_annotation() << endl
-      << indent() << "public java.lang.String toString() {" << endl;
+  out << indent() << java_override_annotation() << '\n'
+      << indent() << "public java.lang.String toString() {" << '\n';
   indent_up();
 
   out << indent() << "java.lang.StringBuilder sb = new java.lang.StringBuilder(\""
-      << tstruct->get_name() << "(\");" << endl;
-  out << indent() << "boolean first = true;" << endl << endl;
+      << tstruct->get_name() << "(\");" << '\n';
+  out << indent() << "boolean first = true;" << '\n' << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -2832,55 +2829,55 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
     if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
+      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << '\n';
       indent_up();
     }
 
     t_field* field = (*f_iter);
 
     if (!first) {
-      indent(out) << "if (!first) sb.append(\", \");" << endl;
+      indent(out) << "if (!first) sb.append(\", \");" << '\n';
     }
-    indent(out) << "sb.append(\"" << (*f_iter)->get_name() << ":\");" << endl;
+    indent(out) << "sb.append(\"" << (*f_iter)->get_name() << ":\");" << '\n';
     bool can_be_null = type_can_be_null(field->get_type());
     if (can_be_null) {
-      indent(out) << "if (this." << make_valid_java_identifier((*f_iter)->get_name()) << " == null) {" << endl;
-      indent(out) << "  sb.append(\"null\");" << endl;
-      indent(out) << "} else {" << endl;
+      indent(out) << "if (this." << make_valid_java_identifier((*f_iter)->get_name()) << " == null) {" << '\n';
+      indent(out) << "  sb.append(\"null\");" << '\n';
+      indent(out) << "} else {" << '\n';
       indent_up();
     }
 
     if (get_true_type(field->get_type())->is_binary()) {
       indent(out) << "org.apache.thrift.TBaseHelper.toString(this." << make_valid_java_identifier(field->get_name()) << ", sb);"
-                  << endl;
+                  << '\n';
     } else if ((field->get_type()->is_set())
                && (get_true_type(((t_set*)field->get_type())->get_elem_type())->is_binary())) {
       indent(out) << "org.apache.thrift.TBaseHelper.toString(this." << make_valid_java_identifier(field->get_name()) << ", sb);"
-                  << endl;
+                  << '\n';
     } else if ((field->get_type()->is_list())
                && (get_true_type(((t_list*)field->get_type())->get_elem_type())->is_binary())) {
       indent(out) << "org.apache.thrift.TBaseHelper.toString(this." << make_valid_java_identifier(field->get_name()) << ", sb);"
-                  << endl;
+                  << '\n';
     } else {
-      indent(out) << "sb.append(this." << make_valid_java_identifier((*f_iter)->get_name()) << ");" << endl;
+      indent(out) << "sb.append(this." << make_valid_java_identifier((*f_iter)->get_name()) << ");" << '\n';
     }
 
     if (can_be_null) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    indent(out) << "first = false;" << endl;
+    indent(out) << "first = false;" << '\n';
 
     if (could_be_unset) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     first = false;
   }
-  out << indent() << "sb.append(\")\");" << endl << indent() << "return sb.toString();" << endl;
+  out << indent() << "sb.append(\")\");" << '\n' << indent() << "return sb.toString();" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2896,14 +2893,14 @@
   // Static Map with fieldID -> org.apache.thrift.meta_data.FieldMetaData mappings
   indent(out) << "public static final java.util.Map<_Fields, "
                  "org.apache.thrift.meta_data.FieldMetaData> metaDataMap;"
-              << endl;
-  indent(out) << "static {" << endl;
+              << '\n';
+  indent(out) << "static {" << '\n';
   indent_up();
 
   indent(out)
       << "java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new "
          "java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);"
-      << endl;
+      << '\n';
 
   // Populate map
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -2928,15 +2925,15 @@
     if (annotations_as_metadata_) {
       generate_metadata_for_field_annotations(out, field);
     }
-    out << "));" << endl;
+    out << "));" << '\n';
   }
 
-  indent(out) << "metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);" << endl;
+  indent(out) << "metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);" << '\n';
 
   indent(out) << "org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap("
-              << type_name(tstruct) << ".class, metaDataMap);" << endl;
+              << type_name(tstruct) << ".class, metaDataMap);" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -3003,19 +3000,19 @@
   if (field->annotations_.size() == 0) {
     return;
   }
-  out << ", " << endl;
+  out << ", " << '\n';
   indent_up();
   indent_up();
   indent(out) << "java.util.stream.Stream.<java.util.Map.Entry<java.lang.String, "
                  "java.lang.String>>builder()"
-              << endl;
+              << '\n';
 
   indent_up();
   indent_up();
   for (auto& annotation : field->annotations_) {
     indent(out) << ".add(new java.util.AbstractMap.SimpleImmutableEntry<>(\"" + annotation.first
                        + "\", \"" + annotation.second.back() + "\"))"
-                << endl;
+                << '\n';
   }
   indent(out) << ".build().collect(java.util.stream.Collectors.toMap(java.util.Map.Entry::getKey, "
                  "java.util.Map.Entry::getValue))";
@@ -3028,7 +3025,7 @@
 
 void t_java_generator::generate_field_value_meta_data(std::ostream& out, t_type* type) {
   t_type* ttype = get_true_type(type);
-  out << endl;
+  out << '\n';
   indent_up();
   indent_up();
   if (ttype->is_struct() || ttype->is_xception()) {
@@ -3093,7 +3090,7 @@
     generate_javax_generated_annotation(f_service_);
   }
   f_service_ << java_suppressions();
-  f_service_ << "public class " << make_valid_java_identifier(service_name_) << " {" << endl << endl;
+  f_service_ << "public class " << make_valid_java_identifier(service_name_) << " {" << '\n' << '\n';
   indent_up();
 
   // Generate the three main parts of the service
@@ -3112,7 +3109,7 @@
   generate_service_helpers(tservice);
 
   indent_down();
-  f_service_ << "}" << endl;
+  f_service_ << "}" << '\n';
   f_service_.close();
 }
 
@@ -3130,16 +3127,16 @@
   }
 
   generate_java_doc(f_service_, tservice);
-  f_service_ << indent() << "public interface Iface" << extends_iface << " {" << endl << endl;
+  f_service_ << indent() << "public interface Iface" << extends_iface << " {" << '\n' << '\n';
   indent_up();
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_service_, *f_iter);
-    indent(f_service_) << "public " << function_signature(*f_iter) << ";" << endl << endl;
+    indent(f_service_) << "public " << function_signature(*f_iter) << ";" << '\n' << '\n';
   }
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_service_async_interface(t_service* tservice) {
@@ -3150,17 +3147,17 @@
     extends_iface = " extends " + extends + ".AsyncIface";
   }
 
-  f_service_ << indent() << "public interface AsyncIface" << extends_iface << " {" << endl << endl;
+  f_service_ << indent() << "public interface AsyncIface" << extends_iface << " {" << '\n' << '\n';
   indent_up();
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "public " << function_signature_async(*f_iter, true)
-                       << " throws org.apache.thrift.TException;" << endl
-                       << endl;
+                       << " throws org.apache.thrift.TException;" << '\n'
+                       << '\n';
   }
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_service_future_interface(t_service* tservice) {
@@ -3171,15 +3168,15 @@
     extends_iface = " extends " + extends + " .FutureIface";
   }
 
-  f_service_ << indent() << "public interface FutureIface" << extends_iface << " {" << endl << endl;
+  f_service_ << indent() << "public interface FutureIface" << extends_iface << " {" << '\n' << '\n';
   indent_up();
   for (auto tfunc : tservice->get_functions()) {
     indent(f_service_) << "public " << function_signature_future(tfunc)
-                       << " throws org.apache.thrift.TException;" << endl
-                       << endl;
+                       << " throws org.apache.thrift.TException;" << '\n'
+                       << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl << endl;
+  f_service_ << '\n' << '\n';
 }
 
 /**
@@ -3209,43 +3206,43 @@
   }
 
   indent(f_service_) << "public static class Client extends " << extends_client
-                     << " implements Iface {" << endl;
+                     << " implements Iface {" << '\n';
   indent_up();
 
   indent(f_service_)
       << "public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {"
-      << endl;
+      << '\n';
   indent_up();
-  indent(f_service_) << "public Factory() {}" << endl;
-  indent(f_service_) << java_override_annotation() << endl;
+  indent(f_service_) << "public Factory() {}" << '\n';
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "public Client getClient(org.apache.thrift.protocol.TProtocol prot) {"
-                     << endl;
+                     << '\n';
   indent_up();
-  indent(f_service_) << "return new Client(prot);" << endl;
+  indent(f_service_) << "return new Client(prot);" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl;
-  indent(f_service_) << java_override_annotation() << endl;
+  indent(f_service_) << "}" << '\n';
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "public Client getClient(org.apache.thrift.protocol.TProtocol iprot, "
                         "org.apache.thrift.protocol.TProtocol oprot) {"
-                     << endl;
+                     << '\n';
   indent_up();
-  indent(f_service_) << "return new Client(iprot, oprot);" << endl;
+  indent(f_service_) << "return new Client(iprot, oprot);" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << "public Client(org.apache.thrift.protocol.TProtocol prot)" << endl;
+  indent(f_service_) << "public Client(org.apache.thrift.protocol.TProtocol prot)" << '\n';
   scope_up(f_service_);
-  indent(f_service_) << "super(prot, prot);" << endl;
+  indent(f_service_) << "super(prot, prot);" << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   indent(f_service_) << "public Client(org.apache.thrift.protocol.TProtocol iprot, "
                         "org.apache.thrift.protocol.TProtocol oprot) {"
-                     << endl;
-  indent(f_service_) << "  super(iprot, oprot);" << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "  super(iprot, oprot);" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -3260,8 +3257,8 @@
     }
 
     // Open function
-    indent(f_service_) << java_override_annotation() << endl;
-    indent(f_service_) << "public " << function_signature(*f_iter) << endl;
+    indent(f_service_) << java_override_annotation() << '\n';
+    indent(f_service_) << "public " << function_signature(*f_iter) << '\n';
     scope_up(f_service_);
     indent(f_service_) << "send" << sep << javaname << "(";
 
@@ -3280,17 +3277,17 @@
       }
       f_service_ << make_valid_java_identifier((*fld_iter)->get_name());
     }
-    f_service_ << ");" << endl;
+    f_service_ << ");" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_ << indent();
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_ << "return ";
       }
-      f_service_ << "recv" << sep << javaname << "();" << endl;
+      f_service_ << "recv" << sep << javaname << "();" << '\n';
     }
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     t_function send_function(g_type_void, string("send") + sep + javaname,
                              (*f_iter)->get_arglist());
@@ -3298,22 +3295,22 @@
     string argsname = (*f_iter)->get_name() + "_args";
 
     // Open function
-    indent(f_service_) << "public " << function_signature(&send_function) << endl;
+    indent(f_service_) << "public " << function_signature(&send_function) << '\n';
     scope_up(f_service_);
 
     // Serialize the request
-    indent(f_service_) << argsname << " args = new " << argsname << "();" << endl;
+    indent(f_service_) << argsname << " args = new " << argsname << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent(f_service_) << "args.set" << get_cap_name((*fld_iter)->get_name()) << "("
-                         << make_valid_java_identifier((*fld_iter)->get_name()) << ");" << endl;
+                         << make_valid_java_identifier((*fld_iter)->get_name()) << ");" << '\n';
     }
 
     const string sendBaseName = (*f_iter)->is_oneway() ? "sendBaseOneway" : "sendBase";
-    indent(f_service_) << sendBaseName << "(\"" << funname << "\", args);" << endl;
+    indent(f_service_) << sendBaseName << "(\"" << funname << "\", args);" << '\n';
 
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       string resultname = (*f_iter)->get_name() + "_result";
@@ -3322,47 +3319,47 @@
       t_function recv_function((*f_iter)->get_returntype(), string("recv") + sep + javaname,
                                &noargs, (*f_iter)->get_xceptions());
       // Open function
-      indent(f_service_) << "public " << function_signature(&recv_function) << endl;
+      indent(f_service_) << "public " << function_signature(&recv_function) << '\n';
       scope_up(f_service_);
 
-      f_service_ << indent() << resultname << " result = new " << resultname << "();" << endl
-                 << indent() << "receiveBase(result, \"" << funname << "\");" << endl;
+      f_service_ << indent() << resultname << " result = new " << resultname << "();" << '\n'
+                 << indent() << "receiveBase(result, \"" << funname << "\");" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << endl
-                   << indent() << "  return result.success;" << endl
-                   << indent() << "}" << endl;
+        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << '\n'
+                   << indent() << "  return result.success;" << '\n'
+                   << indent() << "}" << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (result." << make_valid_java_identifier((*x_iter)->get_name()) << " != null) {" << endl
-                   << indent() << "  throw result." << make_valid_java_identifier((*x_iter)->get_name()) << ";" << endl
-                   << indent() << "}" << endl;
+        f_service_ << indent() << "if (result." << make_valid_java_identifier((*x_iter)->get_name()) << " != null) {" << '\n'
+                   << indent() << "  throw result." << make_valid_java_identifier((*x_iter)->get_name()) << ";" << '\n'
+                   << indent() << "}" << '\n';
       }
 
       // If you get here it's an exception, unless a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "return;" << '\n';
       } else {
         f_service_ << indent()
                    << "throw new "
                       "org.apache.thrift.TApplicationException(org.apache.thrift."
                       "TApplicationException.MISSING_RESULT, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
+                   << (*f_iter)->get_name() << " failed: unknown result\");" << '\n';
       }
 
       // Close function
       scope_down(f_service_);
-      f_service_ << endl;
+      f_service_ << '\n';
     }
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
 }
 
 void t_java_generator::generate_service_future_client(t_service* tservice) {
@@ -3373,13 +3370,13 @@
 
   static string adapter_class = "org.apache.thrift.async.AsyncMethodFutureAdapter";
   indent(f_service_) << "public static class FutureClient " << extends_client
-                     << "implements FutureIface {" << endl;
+                     << "implements FutureIface {" << '\n';
   indent_up();
-  indent(f_service_) << "public FutureClient(AsyncIface delegate) {" << endl;
+  indent(f_service_) << "public FutureClient(AsyncIface delegate) {" << '\n';
   indent_up();
-  indent(f_service_) << "this.delegate = delegate;" << endl;
+  indent(f_service_) << "this.delegate = delegate;" << '\n';
   scope_down(f_service_);
-  indent(f_service_) << "private final AsyncIface delegate;" << endl;
+  indent(f_service_) << "private final AsyncIface delegate;" << '\n';
   for (auto tfunc : tservice->get_functions()) {
     string funname = tfunc->get_name();
     string sep = "_";
@@ -3396,23 +3393,23 @@
     string args_name = funname + "_args";
     string result_name = funname + "_result";
 
-    indent(f_service_) << "@Override" << endl;
+    indent(f_service_) << "@Override" << '\n';
     indent(f_service_) << "public " << function_signature_future(tfunc)
-                       << " throws org.apache.thrift.TException {" << endl;
+                       << " throws org.apache.thrift.TException {" << '\n';
     indent_up();
     auto adapter = tmp("asyncMethodFutureAdapter");
     indent(f_service_) << adapter_class << "<" << ret_type_name << "> " << adapter << " = "
-                       << adapter_class << ".<" << ret_type_name << ">create();" << endl;
+                       << adapter_class << ".<" << ret_type_name << ">create();" << '\n';
     bool empty_args = tfunc->get_arglist()->get_members().empty();
     indent(f_service_) << "delegate." << get_rpc_method_name(funname) << "("
                        << argument_list(tfunc->get_arglist(), false) << (empty_args ? "" : ", ")
-                       << adapter << ");" << endl;
-    indent(f_service_) << "return " << adapter << ".getFuture();" << endl;
+                       << adapter << ");" << '\n';
+    indent(f_service_) << "return " << adapter << ".getFuture();" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 }
 
 void t_java_generator::generate_service_async_client(t_service* tservice) {
@@ -3422,41 +3419,41 @@
   }
 
   indent(f_service_) << "public static class AsyncClient extends " << extends_client
-                     << " implements AsyncIface {" << endl;
+                     << " implements AsyncIface {" << '\n';
   indent_up();
 
   // Factory method
   indent(f_service_) << "public static class Factory implements "
                         "org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {"
-                     << endl;
+                     << '\n';
   indent(f_service_) << "  private org.apache.thrift.async.TAsyncClientManager clientManager;"
-                     << endl;
+                     << '\n';
   indent(f_service_) << "  private org.apache.thrift.protocol.TProtocolFactory protocolFactory;"
-                     << endl;
+                     << '\n';
   indent(f_service_) << "  public Factory(org.apache.thrift.async.TAsyncClientManager "
                         "clientManager, org.apache.thrift.protocol.TProtocolFactory "
                         "protocolFactory) {"
-                     << endl;
-  indent(f_service_) << "    this.clientManager = clientManager;" << endl;
-  indent(f_service_) << "    this.protocolFactory = protocolFactory;" << endl;
-  indent(f_service_) << "  }" << endl;
-  indent(f_service_) << java_override_annotation() << endl;
+                     << '\n';
+  indent(f_service_) << "    this.clientManager = clientManager;" << '\n';
+  indent(f_service_) << "    this.protocolFactory = protocolFactory;" << '\n';
+  indent(f_service_) << "  }" << '\n';
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "  public AsyncClient "
                         "getAsyncClient(org.apache.thrift.transport.TNonblockingTransport "
                         "transport) {"
-                     << endl;
+                     << '\n';
   indent(f_service_) << "    return new AsyncClient(protocolFactory, clientManager, transport);"
-                     << endl;
-  indent(f_service_) << "  }" << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "  }" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   indent(f_service_) << "public AsyncClient(org.apache.thrift.protocol.TProtocolFactory "
                         "protocolFactory, org.apache.thrift.async.TAsyncClientManager "
                         "clientManager, org.apache.thrift.transport.TNonblockingTransport "
                         "transport) {"
-                     << endl;
-  indent(f_service_) << "  super(protocolFactory, clientManager, transport);" << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "  super(protocolFactory, clientManager, transport);" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -3479,35 +3476,35 @@
     string result_name = (*f_iter)->get_name() + "_result";
 
     // Main method body
-    indent(f_service_) << java_override_annotation() << endl;
+    indent(f_service_) << java_override_annotation() << '\n';
     indent(f_service_) << "public " << function_signature_async(*f_iter, false)
-                       << " throws org.apache.thrift.TException {" << endl;
-    indent(f_service_) << "  checkReady();" << endl;
+                       << " throws org.apache.thrift.TException {" << '\n';
+    indent(f_service_) << "  checkReady();" << '\n';
     indent(f_service_) << "  " << funclassname << " method_call = new " + funclassname + "("
                        << async_argument_list(*f_iter, arg_struct, ret_type)
-                       << ", this, ___protocolFactory, ___transport);" << endl;
-    indent(f_service_) << "  this.___currentMethod = method_call;" << endl;
-    indent(f_service_) << "  ___manager.call(method_call);" << endl;
-    indent(f_service_) << "}" << endl;
+                       << ", this, ___protocolFactory, ___transport);" << '\n';
+    indent(f_service_) << "  this.___currentMethod = method_call;" << '\n';
+    indent(f_service_) << "  ___manager.call(method_call);" << '\n';
+    indent(f_service_) << "}" << '\n';
 
-    f_service_ << endl;
+    f_service_ << '\n';
 
     // TAsyncMethod object for this function call
     indent(f_service_) << "public static class " + funclassname
                               + " extends org.apache.thrift.async.TAsyncMethodCall<"
                               + type_name((*f_iter)->get_returntype(), true) + "> {"
-                       << endl;
+                       << '\n';
     indent_up();
 
     // Member variables
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent(f_service_) << "private " + type_name((*fld_iter)->get_type()) + " "
                                 + make_valid_java_identifier((*fld_iter)->get_name()) + ";"
-                         << endl;
+                         << '\n';
     }
 
     // NOTE since we use a new Client instance to deserialize, let's keep seqid to 0 for now
-    // indent(f_service_) << "private int seqid;" << endl << endl;
+    // indent(f_service_) << "private int seqid;" << '\n' << '\n';
 
     // Constructor
     indent(f_service_) << "public " + funclassname + "("
@@ -3516,22 +3513,22 @@
                           "org.apache.thrift.protocol.TProtocolFactory protocolFactory, "
                           "org.apache.thrift.transport.TNonblockingTransport transport) throws "
                           "org.apache.thrift.TException {"
-                       << endl;
+                       << '\n';
     indent(f_service_) << "  super(client, protocolFactory, transport, resultHandler, "
-                       << ((*f_iter)->is_oneway() ? "true" : "false") << ");" << endl;
+                       << ((*f_iter)->is_oneway() ? "true" : "false") << ");" << '\n';
 
     // Assign member variables
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent(f_service_) << "  this." + make_valid_java_identifier((*fld_iter)->get_name()) + " = " + make_valid_java_identifier((*fld_iter)->get_name())
                                 + ";"
-                         << endl;
+                         << '\n';
     }
 
-    indent(f_service_) << "}" << endl << endl;
-    indent(f_service_) << java_override_annotation() << endl;
+    indent(f_service_) << "}" << '\n' << '\n';
+    indent(f_service_) << java_override_annotation() << '\n';
     indent(f_service_) << "public void write_args(org.apache.thrift.protocol.TProtocol prot) "
                           "throws org.apache.thrift.TException {"
-                       << endl;
+                       << '\n';
     indent_up();
 
     // Serialize request
@@ -3539,68 +3536,68 @@
     f_service_ << indent() << "prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(\""
                << funname << "\", org.apache.thrift.protocol."
                << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL") << ", 0));"
-               << endl
-               << indent() << args_name << " args = new " << args_name << "();" << endl;
+               << '\n'
+               << indent() << args_name << " args = new " << args_name << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "args.set" << get_cap_name((*fld_iter)->get_name()) << "("
-                 << make_valid_java_identifier((*fld_iter)->get_name()) << ");" << endl;
+                 << make_valid_java_identifier((*fld_iter)->get_name()) << ");" << '\n';
     }
 
-    f_service_ << indent() << "args.write(prot);" << endl
-               << indent() << "prot.writeMessageEnd();" << endl;
+    f_service_ << indent() << "args.write(prot);" << '\n'
+               << indent() << "prot.writeMessageEnd();" << '\n';
 
     indent_down();
-    indent(f_service_) << "}" << endl << endl;
+    indent(f_service_) << "}" << '\n' << '\n';
 
     // Return method
-    indent(f_service_) << java_override_annotation() << endl;
+    indent(f_service_) << java_override_annotation() << '\n';
     indent(f_service_) << "public " + type_name(ret_type, true) + " getResult() throws ";
     vector<t_field*>::const_iterator x_iter;
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << type_name((*x_iter)->get_type(), false, false) + ", ";
     }
-    f_service_ << "org.apache.thrift.TException {" << endl;
+    f_service_ << "org.apache.thrift.TException {" << '\n';
 
     indent_up();
     f_service_
         << indent()
         << "if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {"
-        << endl
+        << '\n'
         << indent() << "  throw new java.lang.IllegalStateException(\"Method call not finished!\");"
-        << endl
-        << indent() << "}" << endl
+        << '\n'
+        << indent() << "}" << '\n'
         << indent()
         << "org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new "
            "org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());"
-        << endl
+        << '\n'
         << indent()
         << "org.apache.thrift.protocol.TProtocol prot = "
            "client.getProtocolFactory().getProtocol(memoryTransport);"
-        << endl;
+        << '\n';
     indent(f_service_);
     if (ret_type->is_void()) { // NB: Includes oneways which always return void.
       if (!(*f_iter)->is_oneway()) {
-        f_service_ << "(new Client(prot)).recv" + sep + javaname + "();" << endl;
+        f_service_ << "(new Client(prot)).recv" + sep + javaname + "();" << '\n';
         indent(f_service_);
       }
-      f_service_ << "return null;" << endl;
+      f_service_ << "return null;" << '\n';
     } else {
-      f_service_ << "return (new Client(prot)).recv" + sep + javaname + "();" << endl;
+      f_service_ << "return (new Client(prot)).recv" + sep + javaname + "();" << '\n';
     }
 
     // Close function
     indent_down();
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
 
     // Close class
     indent_down();
-    indent(f_service_) << "}" << endl << endl;
+    indent(f_service_) << "}" << '\n' << '\n';
   }
 
   // Close AsyncClient
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 }
 
 /**
@@ -3625,26 +3622,26 @@
 
   // Generate the header portion
   indent(f_service_) << "public static class Processor<I extends Iface> extends "
-                     << extends_processor << " implements org.apache.thrift.TProcessor {" << endl;
+                     << extends_processor << " implements org.apache.thrift.TProcessor {" << '\n';
   indent_up();
 
   indent(f_service_) << "private static final org.slf4j.Logger _LOGGER = "
                         "org.slf4j.LoggerFactory.getLogger(Processor.class.getName());"
-                     << endl;
+                     << '\n';
 
-  indent(f_service_) << "public Processor(I iface) {" << endl;
+  indent(f_service_) << "public Processor(I iface) {" << '\n';
   indent(f_service_) << "  super(iface, getProcessMap(new java.util.HashMap<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends "
                         "org.apache.thrift.TBase, ? extends org.apache.thrift.TBase>>()));"
-                     << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   indent(f_service_) << "protected Processor(I iface, java.util.Map<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase, ? "
                         "extends org.apache.thrift.TBase>> processMap) {"
-                     << endl;
-  indent(f_service_) << "  super(iface, getProcessMap(processMap));" << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "  super(iface, getProcessMap(processMap));" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   indent(f_service_) << "private static <I extends Iface> java.util.Map<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase, "
@@ -3652,15 +3649,15 @@
                         "getProcessMap(java.util.Map<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends "
                         " org.apache.thrift.TBase, ? extends org.apache.thrift.TBase>> processMap) {"
-                     << endl;
+                     << '\n';
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "processMap.put(\"" << (*f_iter)->get_name() << "\", new "
-                       << make_valid_java_identifier((*f_iter)->get_name()) << "());" << endl;
+                       << make_valid_java_identifier((*f_iter)->get_name()) << "());" << '\n';
   }
-  indent(f_service_) << "return processMap;" << endl;
+  indent(f_service_) << "return processMap;" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -3668,7 +3665,7 @@
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 }
 
 /**
@@ -3693,26 +3690,26 @@
 
   // Generate the header portion
   indent(f_service_) << "public static class AsyncProcessor<I extends AsyncIface> extends "
-                     << extends_processor << " {" << endl;
+                     << extends_processor << " {" << '\n';
   indent_up();
 
   indent(f_service_) << "private static final org.slf4j.Logger _LOGGER = "
                         "org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());"
-                     << endl;
+                     << '\n';
 
-  indent(f_service_) << "public AsyncProcessor(I iface) {" << endl;
+  indent(f_service_) << "public AsyncProcessor(I iface) {" << '\n';
   indent(f_service_) << "  super(iface, getProcessMap(new java.util.HashMap<java.lang.String, "
                         "org.apache.thrift.AsyncProcessFunction<I, ? extends "
                         "org.apache.thrift.TBase, ?, ? extends org.apache.thrift.TBase>>()));"
-                     << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   indent(f_service_) << "protected AsyncProcessor(I iface, java.util.Map<java.lang.String,  "
                         "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
                         "org.apache.thrift.TBase, ?, ? extends org.apache.thrift.TBase>> processMap) {"
-                     << endl;
-  indent(f_service_) << "  super(iface, getProcessMap(processMap));" << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "  super(iface, getProcessMap(processMap));" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
   indent(f_service_)
       << "private static <I extends AsyncIface> java.util.Map<java.lang.String,  "
@@ -3720,15 +3717,15 @@
          "org.apache.thrift.TBase, ?, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<java.lang.String,  "
          "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
          "org.apache.thrift.TBase, ?, ? extends org.apache.thrift.TBase>> processMap) {"
-      << endl;
+      << '\n';
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "processMap.put(\"" << (*f_iter)->get_name() << "\", new "
-                       << make_valid_java_identifier((*f_iter)->get_name()) << "());" << endl;
+                       << make_valid_java_identifier((*f_iter)->get_name()) << "());" << '\n';
   }
-  indent(f_service_) << "return processMap;" << endl;
+  indent(f_service_) << "return processMap;" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -3736,7 +3733,7 @@
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 }
 
 /**
@@ -3784,101 +3781,101 @@
   // Open class
   indent(f_service_) << "public static class " << make_valid_java_identifier(tfunction->get_name())
                      << "<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, "
-                     << argsname << ", " << resulttype << ", " << resultname << "> {" << endl;
+                     << argsname << ", " << resulttype << ", " << resultname << "> {" << '\n';
   indent_up();
 
-  indent(f_service_) << "public " << make_valid_java_identifier(tfunction->get_name()) << "() {" << endl;
-  indent(f_service_) << "  super(\"" << tfunction->get_name() << "\");" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "public " << make_valid_java_identifier(tfunction->get_name()) << "() {" << '\n';
+  indent(f_service_) << "  super(\"" << tfunction->get_name() << "\");" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public " << resultname << " getEmptyResultInstance() {" << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public " << resultname << " getEmptyResultInstance() {" << '\n';
   if (tfunction->is_oneway()) {
-    indent(f_service_) << "  return null;" << endl;
+    indent(f_service_) << "  return null;" << '\n';
   }
   else {
-    indent(f_service_) << "  return new " << resultname << "();" << endl;
+    indent(f_service_) << "  return new " << resultname << "();" << '\n';
   }
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public " << argsname << " getEmptyArgsInstance() {" << endl;
-  indent(f_service_) << "  return new " << argsname << "();" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public " << argsname << " getEmptyArgsInstance() {" << '\n';
+  indent(f_service_) << "  return new " << argsname << "();" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "public org.apache.thrift.async.AsyncMethodCallback<" << resulttype
                      << "> getResultHandler(final "
                         "org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, "
                         "final int seqid) {"
-                     << endl;
+                     << '\n';
   indent_up();
-  indent(f_service_) << "final org.apache.thrift.AsyncProcessFunction fcall = this;" << endl;
+  indent(f_service_) << "final org.apache.thrift.AsyncProcessFunction fcall = this;" << '\n';
   indent(f_service_) << "return new org.apache.thrift.async.AsyncMethodCallback<" << resulttype
-                     << ">() { " << endl;
+                     << ">() { " << '\n';
   indent_up();
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public void onComplete(" << resulttype << " o) {" << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public void onComplete(" << resulttype << " o) {" << '\n';
 
   indent_up();
   if (!tfunction->is_oneway()) {
-    indent(f_service_) << resultname << " result = new " << resultname << "();" << endl;
+    indent(f_service_) << resultname << " result = new " << resultname << "();" << '\n';
 
     if (!tfunction->get_returntype()->is_void()) {
-      indent(f_service_) << "result.success = o;" << endl;
+      indent(f_service_) << "result.success = o;" << '\n';
       // Set isset on success field
       if (!type_can_be_null(tfunction->get_returntype())) {
         indent(f_service_) << "result.set" << get_cap_name("success") << get_cap_name("isSet")
-                           << "(true);" << endl;
+                           << "(true);" << '\n';
       }
     }
 
-    indent(f_service_) << "try {" << endl;
+    indent(f_service_) << "try {" << '\n';
     indent(f_service_)
         << "  fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);"
-        << endl;
-    indent(f_service_) << "} catch (org.apache.thrift.transport.TTransportException e) {" << endl;
+        << '\n';
+    indent(f_service_) << "} catch (org.apache.thrift.transport.TTransportException e) {" << '\n';
     indent_up();
     f_service_ << indent()
                << "_LOGGER.error(\"TTransportException writing to internal frame buffer\", e);"
-               << endl
-               << indent() << "fb.close();" << endl;
+               << '\n'
+               << indent() << "fb.close();" << '\n';
     indent_down();
-    indent(f_service_) << "} catch (java.lang.Exception e) {" << endl;
+    indent(f_service_) << "} catch (java.lang.Exception e) {" << '\n';
     indent_up();
     f_service_ << indent() << "_LOGGER.error(\"Exception writing to internal frame buffer\", e);"
-               << endl
-               << indent() << "onError(e);" << endl;
+               << '\n'
+               << indent() << "onError(e);" << '\n';
     indent_down();
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   }
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public void onError(java.lang.Exception e) {" << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public void onError(java.lang.Exception e) {" << '\n';
   indent_up();
 
   if (tfunction->is_oneway()) {
     indent(f_service_) << "if (e instanceof org.apache.thrift.transport.TTransportException) {"
-                       << endl;
+                       << '\n';
     indent_up();
 
-    f_service_ << indent() << "_LOGGER.error(\"TTransportException inside handler\", e);" << endl
-               << indent() << "fb.close();" << endl;
+    f_service_ << indent() << "_LOGGER.error(\"TTransportException inside handler\", e);" << '\n'
+               << indent() << "fb.close();" << '\n';
 
     indent_down();
-    indent(f_service_) << "} else {" << endl;
+    indent(f_service_) << "} else {" << '\n';
     indent_up();
 
-    f_service_ << indent() << "_LOGGER.error(\"Exception inside oneway handler\", e);" << endl;
+    f_service_ << indent() << "_LOGGER.error(\"Exception inside oneway handler\", e);" << '\n';
 
     indent_down();
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   } else {
-    indent(f_service_) << "byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;" << endl;
-    indent(f_service_) << "org.apache.thrift.TSerializable msg;" << endl;
-    indent(f_service_) << resultname << " result = new " << resultname << "();" << endl;
+    indent(f_service_) << "byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;" << '\n';
+    indent(f_service_) << "org.apache.thrift.TSerializable msg;" << '\n';
+    indent(f_service_) << resultname << " result = new " << resultname << "();" << '\n';
 
     t_struct* xs = tfunction->get_xceptions();
     const std::vector<t_field*>& xceptions = xs->get_members();
@@ -3890,66 +3887,66 @@
           f_service_ << indent();
         string type = type_name((*x_iter)->get_type(), false, false);
         string name = (*x_iter)->get_name();
-        f_service_ << "if (e instanceof " << type << ") {" << endl;
+        f_service_ << "if (e instanceof " << type << ") {" << '\n';
         indent_up();
-        f_service_ << indent() << "result." << make_valid_java_identifier(name) << " = (" << type << ") e;" << endl
+        f_service_ << indent() << "result." << make_valid_java_identifier(name) << " = (" << type << ") e;" << '\n'
                    << indent() << "result.set" << get_cap_name(name) << get_cap_name("isSet")
-                   << "(true);" << endl
-                   << indent() << "msg = result;" << endl;
+                   << "(true);" << '\n'
+                   << indent() << "msg = result;" << '\n';
         indent_down();
         indent(f_service_) << "} else ";
       }
     } else {
       indent(f_service_);
     }
-    f_service_ << "if (e instanceof org.apache.thrift.transport.TTransportException) {" << endl;
+    f_service_ << "if (e instanceof org.apache.thrift.transport.TTransportException) {" << '\n';
     indent_up();
-    f_service_ << indent() << "_LOGGER.error(\"TTransportException inside handler\", e);" << endl
-               << indent() << "fb.close();" << endl
-               << indent() << "return;" << endl;
+    f_service_ << indent() << "_LOGGER.error(\"TTransportException inside handler\", e);" << '\n'
+               << indent() << "fb.close();" << '\n'
+               << indent() << "return;" << '\n';
     indent_down();
     indent(f_service_) << "} else if (e instanceof org.apache.thrift.TApplicationException) {"
-                       << endl;
+                       << '\n';
     indent_up();
-    f_service_ << indent() << "_LOGGER.error(\"TApplicationException inside handler\", e);" << endl
-               << indent() << "msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;" << endl
-               << indent() << "msg = (org.apache.thrift.TApplicationException)e;" << endl;
+    f_service_ << indent() << "_LOGGER.error(\"TApplicationException inside handler\", e);" << '\n'
+               << indent() << "msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;" << '\n'
+               << indent() << "msg = (org.apache.thrift.TApplicationException)e;" << '\n';
     indent_down();
-    indent(f_service_) << "} else {" << endl;
+    indent(f_service_) << "} else {" << '\n';
     indent_up();
-    f_service_ << indent() << "_LOGGER.error(\"Exception inside handler\", e);" << endl
-               << indent() << "msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;" << endl
+    f_service_ << indent() << "_LOGGER.error(\"Exception inside handler\", e);" << '\n'
+               << indent() << "msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;" << '\n'
                << indent()
                << "msg = new "
                   "org.apache.thrift.TApplicationException(org.apache.thrift."
                   "TApplicationException.INTERNAL_ERROR, e.getMessage());"
-               << endl;
+               << '\n';
     indent_down();
-    f_service_ << indent() << "}" << endl
-               << indent() << "try {" << endl
-               << indent() << "  fcall.sendResponse(fb,msg,msgType,seqid);" << endl
-               << indent() << "} catch (java.lang.Exception ex) {" << endl
+    f_service_ << indent() << "}" << '\n'
+               << indent() << "try {" << '\n'
+               << indent() << "  fcall.sendResponse(fb,msg,msgType,seqid);" << '\n'
+               << indent() << "} catch (java.lang.Exception ex) {" << '\n'
                << indent() << "  _LOGGER.error(\"Exception writing to internal frame buffer\", ex);"
-               << endl
-               << indent() << "  fb.close();" << endl
-               << indent() << "}" << endl;
+               << '\n'
+               << indent() << "  fb.close();" << '\n'
+               << indent() << "}" << '\n';
   }
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
   indent_down();
-  indent(f_service_) << "};" << endl;
+  indent(f_service_) << "};" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public boolean isOneway() {" << endl;
-  indent(f_service_) << "  return " << ((tfunction->is_oneway()) ? "true" : "false") << ";" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public boolean isOneway() {" << '\n';
+  indent(f_service_) << "  return " << ((tfunction->is_oneway()) ? "true" : "false") << ";" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "public void start(I iface, " << argsname
                      << " args, org.apache.thrift.async.AsyncMethodCallback<" << resulttype
-                     << "> resultHandler) throws org.apache.thrift.TException {" << endl;
+                     << "> resultHandler) throws org.apache.thrift.TException {" << '\n';
   indent_up();
 
   // Generate the function call
@@ -3971,17 +3968,17 @@
   if (!first)
     f_service_ << ",";
   f_service_ << "resultHandler";
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   indent_down();
   indent(f_service_) << "}";
 
   // Close function
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Close class
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -4000,45 +3997,45 @@
   // Open class
   indent(f_service_) << "public static class " << make_valid_java_identifier(tfunction->get_name())
                      << "<I extends Iface> extends org.apache.thrift.ProcessFunction<I, "
-                     << argsname << ", " << resultname << "> {" << endl;
+                     << argsname << ", " << resultname << "> {" << '\n';
   indent_up();
 
-  indent(f_service_) << "public " << make_valid_java_identifier(tfunction->get_name()) << "() {" << endl;
-  indent(f_service_) << "  super(\"" << tfunction->get_name() << "\");" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "public " << make_valid_java_identifier(tfunction->get_name()) << "() {" << '\n';
+  indent(f_service_) << "  super(\"" << tfunction->get_name() << "\");" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public " << argsname << " getEmptyArgsInstance() {" << endl;
-  indent(f_service_) << "  return new " << argsname << "();" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public " << argsname << " getEmptyArgsInstance() {" << '\n';
+  indent(f_service_) << "  return new " << argsname << "();" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public boolean isOneway() {" << endl;
-  indent(f_service_) << "  return " << ((tfunction->is_oneway()) ? "true" : "false") << ";" << endl;
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public boolean isOneway() {" << '\n';
+  indent(f_service_) << "  return " << ((tfunction->is_oneway()) ? "true" : "false") << ";" << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "protected boolean rethrowUnhandledExceptions() {" << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "protected boolean rethrowUnhandledExceptions() {" << '\n';
   indent(f_service_) << "  return " << ((rethrow_unhandled_exceptions_) ? "true" : "false") << ";"
-                     << endl;
-  indent(f_service_) << "}" << endl << endl;
+                     << '\n';
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
-  indent(f_service_) << "public " << resultname << " getEmptyResultInstance() {" << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
+  indent(f_service_) << "public " << resultname << " getEmptyResultInstance() {" << '\n';
   if (tfunction->is_oneway()) {
-    indent(f_service_) << "  return null;" << endl;
+    indent(f_service_) << "  return null;" << '\n';
   }
   else {
-    indent(f_service_) << "  return new " << resultname << "();" << endl;
+    indent(f_service_) << "  return new " << resultname << "();" << '\n';
   }
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 
-  indent(f_service_) << java_override_annotation() << endl;
+  indent(f_service_) << java_override_annotation() << '\n';
   indent(f_service_) << "public " << resultname << " getResult(I iface, " << argsname
-                     << " args) throws org.apache.thrift.TException {" << endl;
+                     << " args) throws org.apache.thrift.TException {" << '\n';
   indent_up();
   if (!tfunction->is_oneway()) {
-    indent(f_service_) << resultname << " result = getEmptyResultInstance();" << endl;
+    indent(f_service_) << resultname << " result = getEmptyResultInstance();" << '\n';
   }
 
   t_struct* xs = tfunction->get_xceptions();
@@ -4047,7 +4044,7 @@
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
+    f_service_ << indent() << "try {" << '\n';
     indent_up();
   }
 
@@ -4070,13 +4067,13 @@
     }
     f_service_ << "args." << make_valid_java_identifier((*f_iter)->get_name());
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   // Set isset on success field
   if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()
       && !type_can_be_null(tfunction->get_returntype())) {
     indent(f_service_) << "result.set" << get_cap_name("success") << get_cap_name("isSet")
-                       << "(true);" << endl;
+                       << "(true);" << '\n';
   }
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
@@ -4084,34 +4081,34 @@
     f_service_ << indent() << "}";
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << " catch (" << type_name((*x_iter)->get_type(), false, false) << " "
-                 << make_valid_java_identifier((*x_iter)->get_name()) << ") {" << endl;
+                 << make_valid_java_identifier((*x_iter)->get_name()) << ") {" << '\n';
       if (!tfunction->is_oneway()) {
         indent_up();
         f_service_ << indent() << "result." << make_valid_java_identifier((*x_iter)->get_name()) << " = "
-                   << make_valid_java_identifier((*x_iter)->get_name()) << ";" << endl;
+                   << make_valid_java_identifier((*x_iter)->get_name()) << ";" << '\n';
         indent_down();
         f_service_ << indent() << "}";
       } else {
         f_service_ << "}";
       }
     }
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   if (tfunction->is_oneway()) {
-    indent(f_service_) << "return null;" << endl;
+    indent(f_service_) << "return null;" << '\n';
   } else {
-    indent(f_service_) << "return result;" << endl;
+    indent(f_service_) << "return result;" << '\n';
   }
   indent_down();
   indent(f_service_) << "}";
 
   // Close function
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Close class
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -4175,12 +4172,12 @@
     default:
       throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_enum()) {
     indent(out) << name << " = "
                 << type_name(tfield->get_type(), true, false, false, true)
                        + ".findByValue(iprot.readI32());"
-                << endl;
+                << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n", tfield->get_name().c_str(),
            type_name(type).c_str());
@@ -4193,15 +4190,15 @@
 void t_java_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
 
   if (reuse_objects_) {
-    indent(out) << "if (" << prefix << " == null) {" << endl;
+    indent(out) << "if (" << prefix << " == null) {" << '\n';
     indent_up();
   }
-  indent(out) << prefix << " = new " << type_name(tstruct) << "();" << endl;
+  indent(out) << prefix << " = new " << type_name(tstruct) << "();" << '\n';
   if (reuse_objects_) {
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
-  indent(out) << prefix << ".read(iprot);" << endl;
+  indent(out) << prefix << ".read(iprot);" << '\n';
 }
 
 /**
@@ -4228,31 +4225,31 @@
     // Declare variables, read header
     if (ttype->is_map()) {
       indent(out) << "org.apache.thrift.protocol.TMap " << obj << " = iprot.readMapBegin();"
-                  << endl;
+                  << '\n';
     } else if (ttype->is_set()) {
       indent(out) << "org.apache.thrift.protocol.TSet " << obj << " = iprot.readSetBegin();"
-                  << endl;
+                  << '\n';
     } else if (ttype->is_list()) {
       indent(out) << "org.apache.thrift.protocol.TList " << obj << " = iprot.readListBegin();"
-                  << endl;
+                  << '\n';
     }
   } else {
     // Declare variables, read header
     if (ttype->is_map()) {
       indent(out) << "org.apache.thrift.protocol.TMap " << obj << " = iprot.readMapBegin("
                   << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                  << type_to_enum(((t_map*)ttype)->get_val_type()) << "); " << endl;
+                  << type_to_enum(((t_map*)ttype)->get_val_type()) << "); " << '\n';
     } else if (ttype->is_set()) {
       indent(out) << "org.apache.thrift.protocol.TSet " << obj << " = iprot.readSetBegin("
-                  << type_to_enum(((t_set*)ttype)->get_elem_type()) << ");" << endl;
+                  << type_to_enum(((t_set*)ttype)->get_elem_type()) << ");" << '\n';
     } else if (ttype->is_list()) {
       indent(out) << "org.apache.thrift.protocol.TList " << obj << " = iprot.readListBegin("
-                  << type_to_enum(((t_list*)ttype)->get_elem_type()) << ");" << endl;
+                  << type_to_enum(((t_list*)ttype)->get_elem_type()) << ");" << '\n';
     }
   }
 
   if (reuse_objects_) {
-    indent(out) << "if (" << prefix << " == null) {" << endl;
+    indent(out) << "if (" << prefix << " == null) {" << '\n';
     indent_up();
   }
 
@@ -4264,18 +4261,18 @@
 
   // construct the collection correctly i.e. with appropriate size/type
   if (is_enum_set(ttype) || is_enum_map(ttype)) {
-    out << "(" << inner_enum_type_name(ttype) << ");" << endl;
+    out << "(" << inner_enum_type_name(ttype) << ");" << '\n';
   } else if (sorted_containers_ && (ttype->is_map() || ttype->is_set())) {
     // TreeSet and TreeMap don't have any constructor which takes a capacity as an argument
-    out << "();" << endl;
+    out << "();" << '\n';
   } else {
     out << "(" << (ttype->is_list() ? "" : "2*") << obj << ".size"
-        << ");" << endl;
+        << ");" << '\n';
   }
 
   if (reuse_objects_) {
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
   if (ttype->is_map()) {
@@ -4291,11 +4288,11 @@
   if (has_metadata) {
     // Read container end
     if (ttype->is_map()) {
-      indent(out) << "iprot.readMapEnd();" << endl;
+      indent(out) << "iprot.readMapEnd();" << '\n';
     } else if (ttype->is_set()) {
-      indent(out) << "iprot.readSetEnd();" << endl;
+      indent(out) << "iprot.readSetEnd();" << '\n';
     } else if (ttype->is_list()) {
-      indent(out) << "iprot.readListEnd();" << endl;
+      indent(out) << "iprot.readListEnd();" << '\n';
     }
   }
   scope_down(out);
@@ -4314,14 +4311,14 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey, reuse_objects_, false) << endl;
-  indent(out) << declare_field(&fval, reuse_objects_, false) << endl;
+  indent(out) << declare_field(&fkey, reuse_objects_, false) << '\n';
+  indent(out) << declare_field(&fval, reuse_objects_, false) << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) << "for (int " << i << " = 0; " << i << " < " << obj << ".size"
               << "; "
-              << "++" << i << ")" << endl;
+              << "++" << i << ")" << '\n';
 
   scope_up(out);
 
@@ -4329,22 +4326,22 @@
   generate_deserialize_field(out, &fval, "", has_metadata);
 
   if (get_true_type(fkey.get_type())->is_enum()) {
-    indent(out) << "if (" << key << " != null)" << endl;
+    indent(out) << "if (" << key << " != null)" << '\n';
     scope_up(out);
   }
 
-  indent(out) << prefix << ".put(" << key << ", " << val << ");" << endl;
+  indent(out) << prefix << ".put(" << key << ", " << val << ");" << '\n';
 
   if (get_true_type(fkey.get_type())->is_enum()) {
     scope_down(out);
   }
 
   if (reuse_objects_ && !get_true_type(fkey.get_type())->is_base_type()) {
-    indent(out) << key << " = null;" << endl;
+    indent(out) << key << " = null;" << '\n';
   }
 
   if (reuse_objects_ && !get_true_type(fval.get_type())->is_base_type()) {
-    indent(out) << val << " = null;" << endl;
+    indent(out) << val << " = null;" << '\n';
   }
 }
 
@@ -4359,30 +4356,30 @@
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem, reuse_objects_, false) << endl;
+  indent(out) << declare_field(&felem, reuse_objects_, false) << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) << "for (int " << i << " = 0; " << i << " < " << obj << ".size"
               << "; "
-              << "++" << i << ")" << endl;
+              << "++" << i << ")" << '\n';
   scope_up(out);
 
   generate_deserialize_field(out, &felem, "", has_metadata);
 
   if (get_true_type(felem.get_type())->is_enum()) {
-    indent(out) << "if (" << elem << " != null)" << endl;
+    indent(out) << "if (" << elem << " != null)" << '\n';
     scope_up(out);
   }
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 
   if (get_true_type(felem.get_type())->is_enum()) {
     scope_down(out);
   }
 
   if (reuse_objects_ && !get_true_type(felem.get_type())->is_base_type()) {
-    indent(out) << elem << " = null;" << endl;
+    indent(out) << elem << " = null;" << '\n';
   }
 }
 
@@ -4397,30 +4394,30 @@
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem, reuse_objects_, false) << endl;
+  indent(out) << declare_field(&felem, reuse_objects_, false) << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) << "for (int " << i << " = 0; " << i << " < " << obj << ".size"
               << "; "
-              << "++" << i << ")" << endl;
+              << "++" << i << ")" << '\n';
   scope_up(out);
 
   generate_deserialize_field(out, &felem, "", has_metadata);
 
   if (get_true_type(felem.get_type())->is_enum()) {
-    indent(out) << "if (" << elem << " != null)" << endl;
+    indent(out) << "if (" << elem << " != null)" << '\n';
     scope_up(out);
   }
 
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
+  indent(out) << prefix << ".add(" << elem << ");" << '\n';
 
   if (get_true_type(felem.get_type())->is_enum()) {
     scope_down(out);
   }
 
   if (reuse_objects_ && !get_true_type(felem.get_type())->is_base_type()) {
-    indent(out) << elem << " = null;" << endl;
+    indent(out) << elem << " = null;" << '\n';
   }
 }
 
@@ -4446,7 +4443,7 @@
   } else if (type->is_container()) {
     generate_serialize_container(out, type, prefix + make_valid_java_identifier(tfield->get_name()) + postfix, has_metadata);
   } else if (type->is_enum()) {
-    indent(out) << "oprot.writeI32(" << prefix + make_valid_java_identifier(tfield->get_name()) + postfix << ".getValue());" << endl;
+    indent(out) << "oprot.writeI32(" << prefix + make_valid_java_identifier(tfield->get_name()) + postfix << ".getValue());" << '\n';
   } else if (type->is_base_type()) {
     string name = prefix + make_valid_java_identifier(tfield->get_name()) + postfix;
     indent(out) << "oprot.";
@@ -4491,7 +4488,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(struct." << name << ");";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s%s' TYPE '%s'\n", prefix.c_str(),
            tfield->get_name().c_str(), postfix.c_str(), type_name(type).c_str());
@@ -4506,7 +4503,7 @@
  */
 void t_java_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  out << indent() << prefix << ".write(oprot);" << endl;
+  out << indent() << prefix << ".write(oprot);" << '\n';
 }
 
 /**
@@ -4526,18 +4523,18 @@
       indent(out) << "oprot.writeMapBegin(new org.apache.thrift.protocol.TMap("
                   << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                   << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix << ".size()));"
-                  << endl;
+                  << '\n';
     } else if (ttype->is_set()) {
       indent(out) << "oprot.writeSetBegin(new org.apache.thrift.protocol.TSet("
                   << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " << prefix
-                  << ".size()));" << endl;
+                  << ".size()));" << '\n';
     } else if (ttype->is_list()) {
       indent(out) << "oprot.writeListBegin(new org.apache.thrift.protocol.TList("
                   << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix
-                  << ".size()));" << endl;
+                  << ".size()));" << '\n';
     }
   } else {
-    indent(out) << "oprot.writeI32(" << prefix << ".size());" << endl;
+    indent(out) << "oprot.writeI32(" << prefix << ".size());" << '\n';
   }
 
   string iter = tmp("_iter");
@@ -4554,7 +4551,7 @@
                 << prefix << ")";
   }
 
-  out << endl;
+  out << '\n';
   scope_up(out);
   if (ttype->is_map()) {
     generate_serialize_map_element(out, (t_map*)ttype, iter, prefix, has_metadata);
@@ -4567,11 +4564,11 @@
 
   if (has_metadata) {
     if (ttype->is_map()) {
-      indent(out) << "oprot.writeMapEnd();" << endl;
+      indent(out) << "oprot.writeMapEnd();" << '\n';
     } else if (ttype->is_set()) {
-      indent(out) << "oprot.writeSetEnd();" << endl;
+      indent(out) << "oprot.writeSetEnd();" << '\n';
     } else if (ttype->is_list()) {
-      indent(out) << "oprot.writeListEnd();" << endl;
+      indent(out) << "oprot.writeListEnd();" << '\n';
     }
   }
 
@@ -5101,7 +5098,7 @@
     // deep copy of base types can be done much more efficiently than iterating over all the
     // elements manually
     indent(out) << type_name(type, true, false) << " " << result_name << " = new "
-                << type_name(container, false, true) << "(" << source_name << ");" << endl;
+                << type_name(container, false, true) << "(" << source_name << ");" << '\n';
     return;
   }
 
@@ -5116,10 +5113,10 @@
   if (is_enum_set(container)) {
     indent(out) << type_name(type, true, false) << " " << result_name << " = "
                 << type_name(container, false, true, true) << ".noneOf(" << constructor_args << ");"
-                << endl;
+                << '\n';
   } else {
     indent(out) << type_name(type, true, false) << " " << result_name << " = new "
-                << type_name(container, false, true) << "(" << constructor_args << ");" << endl;
+                << type_name(container, false, true) << "(" << constructor_args << ");" << '\n';
   }
 
   std::string iterator_element_name = source_name_p1 + "_element";
@@ -5131,17 +5128,17 @@
 
     indent(out) << "for (java.util.Map.Entry<" << type_name(key_type, true, false) << ", "
                 << type_name(val_type, true, false) << "> " << iterator_element_name << " : "
-                << source_name << ".entrySet()) {" << endl;
+                << source_name << ".entrySet()) {" << '\n';
     indent_up();
 
-    out << endl;
+    out << '\n';
 
     indent(out) << type_name(key_type, true, false) << " " << iterator_element_name
-                << "_key = " << iterator_element_name << ".getKey();" << endl;
+                << "_key = " << iterator_element_name << ".getKey();" << '\n';
     indent(out) << type_name(val_type, true, false) << " " << iterator_element_name
-                << "_value = " << iterator_element_name << ".getValue();" << endl;
+                << "_value = " << iterator_element_name << ".getValue();" << '\n';
 
-    out << endl;
+    out << '\n';
 
     if (key_type->is_container()) {
       generate_deep_copy_container(out, iterator_element_name + "_key", "",
@@ -5150,10 +5147,10 @@
       indent(out) << type_name(key_type, true, false) << " " << result_element_name << "_key = ";
       generate_deep_copy_non_container(out, iterator_element_name + "_key",
                                        result_element_name + "_key", key_type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     if (val_type->is_container()) {
       generate_deep_copy_container(out, iterator_element_name + "_value", "",
@@ -5162,16 +5159,16 @@
       indent(out) << type_name(val_type, true, false) << " " << result_element_name << "_value = ";
       generate_deep_copy_non_container(out, iterator_element_name + "_value",
                                        result_element_name + "_value", val_type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     indent(out) << result_name << ".put(" << result_element_name << "_key, " << result_element_name
-                << "_value);" << endl;
+                << "_value);" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
 
   } else {
     t_type* elem_type;
@@ -5183,32 +5180,32 @@
     }
 
     indent(out) << "for (" << type_name(elem_type, true, false) << " " << iterator_element_name
-                << " : " << source_name << ") {" << endl;
+                << " : " << source_name << ") {" << '\n';
 
     indent_up();
 
     if (elem_type->is_container()) {
       // recursive deep copy
       generate_deep_copy_container(out, iterator_element_name, "", result_element_name, elem_type);
-      indent(out) << result_name << ".add(" << result_element_name << ");" << endl;
+      indent(out) << result_name << ".add(" << result_element_name << ");" << '\n';
     } else {
       // iterative copy
       if (elem_type->is_binary()) {
         indent(out) << "java.nio.ByteBuffer temp_binary_element = ";
         generate_deep_copy_non_container(out, iterator_element_name, "temp_binary_element",
                                          elem_type);
-        out << ";" << endl;
-        indent(out) << result_name << ".add(temp_binary_element);" << endl;
+        out << ";" << '\n';
+        indent(out) << result_name << ".add(temp_binary_element);" << '\n';
       } else {
         indent(out) << result_name << ".add(";
         generate_deep_copy_non_container(out, iterator_element_name, result_name, elem_type);
-        out << ");" << endl;
+        out << ");" << '\n';
       }
     }
 
     indent_down();
 
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 }
 
@@ -5245,14 +5242,14 @@
 void t_java_generator::generate_isset_set(ostream& out, t_field* field, string prefix) {
   if (!type_can_be_null(field->get_type())) {
     indent(out) << prefix << "set" << get_cap_name(field->get_name()) << get_cap_name("isSet")
-                << "(true);" << endl;
+                << "(true);" << '\n';
   }
 }
 
 void t_java_generator::generate_struct_desc(ostream& out, t_struct* tstruct) {
   indent(out) << "private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new "
                  "org.apache.thrift.protocol.TStruct(\""
-              << tstruct->get_name() << "\");" << endl;
+              << tstruct->get_name() << "\");" << '\n';
 }
 
 void t_java_generator::generate_field_descs(ostream& out, t_struct* tstruct) {
@@ -5264,24 +5261,24 @@
                 << constant_name((*m_iter)->get_name())
                 << "_FIELD_DESC = new org.apache.thrift.protocol.TField(\"" << (*m_iter)->get_name()
                 << "\", " << type_to_enum((*m_iter)->get_type()) << ", "
-                << "(short)" << (*m_iter)->get_key() << ");" << endl;
+                << "(short)" << (*m_iter)->get_key() << ");" << '\n';
   }
 }
 
 void t_java_generator::generate_scheme_map(ostream& out, t_struct* tstruct) {
   indent(out) << "private static final org.apache.thrift.scheme.SchemeFactory "
                  "STANDARD_SCHEME_FACTORY = new "
-              << tstruct->get_name() << "StandardSchemeFactory();" << endl;
+              << tstruct->get_name() << "StandardSchemeFactory();" << '\n';
   indent(out)
       << "private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new "
-      << tstruct->get_name() << "TupleSchemeFactory();" << endl;
+      << tstruct->get_name() << "TupleSchemeFactory();" << '\n';
 }
 
 void t_java_generator::generate_field_name_constants(ostream& out, t_struct* tstruct) {
   indent(out) << "/** The set of fields this struct contains, along with convenience methods for "
                  "finding and manipulating them. */"
-              << endl;
-  indent(out) << "public enum _Fields implements org.apache.thrift.TFieldIdEnum {" << endl;
+              << '\n';
+  indent(out) << "public enum _Fields implements org.apache.thrift.TFieldIdEnum {" << '\n';
 
   indent_up();
   bool first = true;
@@ -5289,7 +5286,7 @@
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     if (!first) {
-      out << "," << endl;
+      out << "," << '\n';
     }
     first = false;
     generate_java_doc(out, *m_iter);
@@ -5297,87 +5294,87 @@
                 << ", \"" << (*m_iter)->get_name() << "\")";
   }
 
-  out << ";" << endl << endl;
+  out << ";" << '\n' << '\n';
 
   indent(out) << "private static final java.util.Map<java.lang.String, _Fields> byName = new "
                  "java.util.HashMap<java.lang.String, _Fields>();"
-              << endl;
-  out << endl;
+              << '\n';
+  out << '\n';
 
-  indent(out) << "static {" << endl;
-  indent(out) << "  for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {" << endl;
-  indent(out) << "    byName.put(field.getFieldName(), field);" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "static {" << '\n';
+  indent(out) << "  for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {" << '\n';
+  indent(out) << "    byName.put(field.getFieldName(), field);" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "/**" << endl;
+  indent(out) << "/**" << '\n';
   indent(out) << " * Find the _Fields constant that matches fieldId, or null if its not found."
-              << endl;
-  indent(out) << " */" << endl;
-  indent(out) << java_nullable_annotation() << endl;
-  indent(out) << "public static _Fields findByThriftId(int fieldId) {" << endl;
+              << '\n';
+  indent(out) << " */" << '\n';
+  indent(out) << java_nullable_annotation() << '\n';
+  indent(out) << "public static _Fields findByThriftId(int fieldId) {" << '\n';
   indent_up();
-  indent(out) << "switch(fieldId) {" << endl;
+  indent(out) << "switch(fieldId) {" << '\n';
   indent_up();
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     indent(out) << "case " << (*m_iter)->get_key() << ": // "
-                << constant_name((*m_iter)->get_name()) << endl;
-    indent(out) << "  return " << constant_name((*m_iter)->get_name()) << ";" << endl;
+                << constant_name((*m_iter)->get_name()) << '\n';
+    indent(out) << "  return " << constant_name((*m_iter)->get_name()) << ";" << '\n';
   }
 
-  indent(out) << "default:" << endl;
-  indent(out) << "  return null;" << endl;
+  indent(out) << "default:" << '\n';
+  indent(out) << "  return null;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "/**" << endl;
-  indent(out) << " * Find the _Fields constant that matches fieldId, throwing an exception" << endl;
-  indent(out) << " * if it is not found." << endl;
-  indent(out) << " */" << endl;
-  indent(out) << "public static _Fields findByThriftIdOrThrow(int fieldId) {" << endl;
-  indent(out) << "  _Fields fields = findByThriftId(fieldId);" << endl;
+  indent(out) << "/**" << '\n';
+  indent(out) << " * Find the _Fields constant that matches fieldId, throwing an exception" << '\n';
+  indent(out) << " * if it is not found." << '\n';
+  indent(out) << " */" << '\n';
+  indent(out) << "public static _Fields findByThriftIdOrThrow(int fieldId) {" << '\n';
+  indent(out) << "  _Fields fields = findByThriftId(fieldId);" << '\n';
   indent(out) << "  if (fields == null) throw new java.lang.IllegalArgumentException(\"Field \" + "
                  "fieldId + "
                  "\" doesn't exist!\");"
-              << endl;
-  indent(out) << "  return fields;" << endl;
-  indent(out) << "}" << endl << endl;
+              << '\n';
+  indent(out) << "  return fields;" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "/**" << endl;
+  indent(out) << "/**" << '\n';
   indent(out) << " * Find the _Fields constant that matches name, or null if its not found."
-              << endl;
-  indent(out) << " */" << endl;
-  indent(out) << java_nullable_annotation() << endl;
-  indent(out) << "public static _Fields findByName(java.lang.String name) {" << endl;
-  indent(out) << "  return byName.get(name);" << endl;
-  indent(out) << "}" << endl << endl;
+              << '\n';
+  indent(out) << " */" << '\n';
+  indent(out) << java_nullable_annotation() << '\n';
+  indent(out) << "public static _Fields findByName(java.lang.String name) {" << '\n';
+  indent(out) << "  return byName.get(name);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "private final short _thriftId;" << endl;
-  indent(out) << "private final java.lang.String _fieldName;" << endl << endl;
+  indent(out) << "private final short _thriftId;" << '\n';
+  indent(out) << "private final java.lang.String _fieldName;" << '\n' << '\n';
 
-  indent(out) << "_Fields(short thriftId, java.lang.String fieldName) {" << endl;
-  indent(out) << "  _thriftId = thriftId;" << endl;
-  indent(out) << "  _fieldName = fieldName;" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "_Fields(short thriftId, java.lang.String fieldName) {" << '\n';
+  indent(out) << "  _thriftId = thriftId;" << '\n';
+  indent(out) << "  _fieldName = fieldName;" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public short getThriftFieldId() {" << endl;
-  indent(out) << "  return _thriftId;" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public short getThriftFieldId() {" << '\n';
+  indent(out) << "  return _thriftId;" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public java.lang.String getFieldName() {" << endl;
-  indent(out) << "  return _fieldName;" << endl;
-  indent(out) << "}" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public java.lang.String getFieldName() {" << '\n';
+  indent(out) << "  return _fieldName;" << '\n';
+  indent(out) << "}" << '\n';
 
   indent_down();
 
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 t_java_generator::isset_type t_java_generator::needs_isset(t_struct* tstruct,
@@ -5411,8 +5408,8 @@
 }
 
 void t_java_generator::generate_java_struct_clear(std::ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public void clear() {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public void clear() {" << '\n';
 
   indent_up();
   for (auto field : tstruct->get_members()) {
@@ -5425,13 +5422,13 @@
 
     if (type_can_be_null(t)) {
       if (reuse_objects_ && (t->is_container() || t->is_struct())) {
-        indent(out) << "if (this." << make_valid_java_identifier(field->get_name()) << " != null) {" << endl;
+        indent(out) << "if (this." << make_valid_java_identifier(field->get_name()) << " != null) {" << '\n';
         indent_up();
-        indent(out) << "this." << make_valid_java_identifier(field->get_name()) << ".clear();" << endl;
+        indent(out) << "this." << make_valid_java_identifier(field->get_name()) << ".clear();" << '\n';
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
       } else {
-        indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = null;" << endl;
+        indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = null;" << '\n';
       }
       continue;
     }
@@ -5439,7 +5436,7 @@
     // must be a base type
     // means it also needs to be explicitly unset
     indent(out) << "set" << get_cap_name(field->get_name()) << get_cap_name("isSet") << "(false);"
-                << endl;
+                << '\n';
     t_base_type* base_type = (t_base_type*)t;
 
     switch (base_type->get_base()) {
@@ -5447,13 +5444,13 @@
     case t_base_type::TYPE_I16:
     case t_base_type::TYPE_I32:
     case t_base_type::TYPE_I64:
-      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = 0;" << endl;
+      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = 0;" << '\n';
       break;
     case t_base_type::TYPE_DOUBLE:
-      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = 0.0;" << endl;
+      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = 0.0;" << '\n';
       break;
     case t_base_type::TYPE_BOOL:
-      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = false;" << endl;
+      indent(out) << "this." << make_valid_java_identifier(field->get_name()) << " = false;" << '\n';
       break;
     default:
       throw "unsupported type: " + base_type->get_name() + " for field " + field->get_name();
@@ -5461,7 +5458,7 @@
   }
   indent_down();
 
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 // generates java method to serialize (in the Java sense) the object
@@ -5469,24 +5466,24 @@
   (void)tstruct;
   indent(out)
       << "private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {"
-      << endl;
-  indent(out) << "  try {" << endl;
+      << '\n';
+  indent(out) << "  try {" << '\n';
   indent(out) << "    write(new org.apache.thrift.protocol.TCompactProtocol(new "
                  "org.apache.thrift.transport.TIOStreamTransport(out)));"
-              << endl;
-  indent(out) << "  } catch (org.apache.thrift.TException te) {" << endl;
+              << '\n';
+  indent(out) << "  } catch (org.apache.thrift.TException te) {" << '\n';
   indent(out) << "    throw new java.io.IOException(te" << (android_legacy_ ? ".getMessage()" : "")
-              << ");" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl << endl;
+              << ");" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 }
 
 // generates java method to serialize (in the Java sense) the object
 void t_java_generator::generate_java_struct_read_object(ostream& out, t_struct* tstruct) {
   indent(out) << "private void readObject(java.io.ObjectInputStream in) throws "
                  "java.io.IOException, java.lang.ClassNotFoundException {"
-              << endl;
-  indent(out) << "  try {" << endl;
+              << '\n';
+  indent(out) << "  try {" << '\n';
   if (!tstruct->is_union()) {
     switch (needs_isset(tstruct)) {
     case ISSET_NONE:
@@ -5494,174 +5491,174 @@
     case ISSET_PRIMITIVE:
       indent(out) << "    // it doesn't seem like you should have to do this, but java "
                      "serialization is wacky, and doesn't call the default constructor."
-                  << endl;
-      indent(out) << "    __isset_bitfield = 0;" << endl;
+                  << '\n';
+      indent(out) << "    __isset_bitfield = 0;" << '\n';
       break;
     case ISSET_BITSET:
       indent(out) << "    // it doesn't seem like you should have to do this, but java "
                      "serialization is wacky, and doesn't call the default constructor."
-                  << endl;
-      indent(out) << "    __isset_bit_vector = new java.util.BitSet(1);" << endl;
+                  << '\n';
+      indent(out) << "    __isset_bit_vector = new java.util.BitSet(1);" << '\n';
       break;
     }
   }
   indent(out) << "    read(new org.apache.thrift.protocol.TCompactProtocol(new "
                  "org.apache.thrift.transport.TIOStreamTransport(in)));"
-              << endl;
-  indent(out) << "  } catch (org.apache.thrift.TException te) {" << endl;
+              << '\n';
+  indent(out) << "  } catch (org.apache.thrift.TException te) {" << '\n';
   indent(out) << "    throw new java.io.IOException(te" << (android_legacy_ ? ".getMessage()" : "")
-              << ");" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl << endl;
+              << ");" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_standard_reader(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol iprot, "
-              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << endl;
+              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
   // Declare stack tmp variables and read struct header
-  out << indent() << "org.apache.thrift.protocol.TField schemeField;" << endl
-      << indent() << "iprot.readStructBegin();" << endl;
+  out << indent() << "org.apache.thrift.protocol.TField schemeField;" << '\n'
+      << indent() << "iprot.readStructBegin();" << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
+  indent(out) << "while (true)" << '\n';
   scope_up(out);
 
   // Read beginning field marker
-  indent(out) << "schemeField = iprot.readFieldBegin();" << endl;
+  indent(out) << "schemeField = iprot.readFieldBegin();" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { " << endl;
+  indent(out) << "if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { " << '\n';
   indent_up();
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Switch statement on the field we are reading
-  indent(out) << "switch (schemeField.id) {" << endl;
+  indent(out) << "switch (schemeField.id) {" << '\n';
 
   indent_up();
 
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     indent(out) << "case " << (*f_iter)->get_key() << ": // "
-                << constant_name((*f_iter)->get_name()) << endl;
+                << constant_name((*f_iter)->get_name()) << '\n';
     indent_up();
     indent(out) << "if (schemeField.type == " << type_to_enum((*f_iter)->get_type()) << ") {"
-                << endl;
+                << '\n';
     indent_up();
 
     generate_deserialize_field(out, *f_iter, "struct.", true);
     indent(out) << "struct."
                 << "set" << get_cap_name((*f_iter)->get_name()) << get_cap_name("isSet")
-                << "(true);" << endl;
+                << "(true);" << '\n';
     indent_down();
-    out << indent() << "} else { " << endl
+    out << indent() << "} else { " << '\n'
         << indent() << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);"
-        << endl
-        << indent() << "}" << endl
-        << indent() << "break;" << endl;
+        << '\n'
+        << indent() << "}" << '\n'
+        << indent() << "break;" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out) << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);"
-              << endl;
+              << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
+  indent(out) << "iprot.readFieldEnd();" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
-  out << indent() << "iprot.readStructEnd();" << endl;
+  out << indent() << "iprot.readStructEnd();" << '\n';
 
   // in non-beans style, check for required fields of primitive type
   // (which can be checked here but not in the general validate method)
   if (!bean_style_) {
-    out << endl
+    out << '\n'
         << indent()
         << "// check for required fields of primitive type, which can't be "
            "checked in the validate method"
-        << endl;
+        << '\n';
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
-        out << indent() << "if (!struct." << generate_isset_check(*f_iter) << ") {" << endl
+        out << indent() << "if (!struct." << generate_isset_check(*f_iter) << ") {" << '\n'
             << indent()
             << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
             << (*f_iter)->get_name()
-            << "' was not found in serialized data! Struct: \" + toString());" << endl
-            << indent() << "}" << endl;
+            << "' was not found in serialized data! Struct: \" + toString());" << '\n'
+            << indent() << "}" << '\n';
       }
     }
   }
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "struct.validate();" << endl;
+  indent(out) << "struct.validate();" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 }
 
 void t_java_generator::generate_standard_writer(ostream& out, t_struct* tstruct, bool is_result) {
   indent_up();
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot, "
-              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << endl;
+              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << '\n';
   indent_up();
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "struct.validate();" << endl << endl;
+  indent(out) << "struct.validate();" << '\n' << '\n';
 
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool null_allowed = type_can_be_null((*f_iter)->get_type());
     if (null_allowed) {
-      out << indent() << "if (struct." << make_valid_java_identifier((*f_iter)->get_name()) << " != null) {" << endl;
+      out << indent() << "if (struct." << make_valid_java_identifier((*f_iter)->get_name()) << " != null) {" << '\n';
       indent_up();
     }
     bool optional = ((*f_iter)->get_req() == t_field::T_OPTIONAL) || (is_result && !null_allowed);
     if (optional) {
       indent(out) << "if ("
-                  << "struct." << generate_isset_check((*f_iter)) << ") {" << endl;
+                  << "struct." << generate_isset_check((*f_iter)) << ") {" << '\n';
       indent_up();
     }
 
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "struct.", "", true);
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     if (optional) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     if (null_allowed) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
   // Write the struct map
-  out << indent() << "oprot.writeFieldStop();" << endl
-      << indent() << "oprot.writeStructEnd();" << endl;
+  out << indent() << "oprot.writeFieldStop();" << '\n'
+      << indent() << "oprot.writeStructEnd();" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
   indent_down();
 }
 
@@ -5670,38 +5667,38 @@
                                                             bool is_result) {
   indent(out) << "private static class " << tstruct->get_name()
               << "StandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {"
-              << endl;
+              << '\n';
   indent_up();
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public " << tstruct->get_name() << "StandardScheme getScheme() {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public " << tstruct->get_name() << "StandardScheme getScheme() {" << '\n';
   indent_up();
-  indent(out) << "return new " << tstruct->get_name() << "StandardScheme();" << endl;
+  indent(out) << "return new " << tstruct->get_name() << "StandardScheme();" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   out << indent() << "private static class " << tstruct->get_name()
       << "StandardScheme extends org.apache.thrift.scheme.StandardScheme<" << make_valid_java_identifier(tstruct->get_name())
-      << "> {" << endl
-      << endl;
+      << "> {" << '\n'
+      << '\n';
   indent_up();
   generate_standard_reader(out, tstruct);
   indent_down();
-  out << endl;
+  out << '\n';
   generate_standard_writer(out, tstruct, is_result);
 
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_java_struct_tuple_reader(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol prot, "
-              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << endl;
+              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << '\n';
   indent_up();
   indent(out) << "org.apache.thrift.protocol.TTupleProtocol iprot = "
                  "(org.apache.thrift.protocol.TTupleProtocol) prot;"
-              << endl;
+              << '\n';
   int optional_count = 0;
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -5713,39 +5710,39 @@
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       generate_deserialize_field(out, (*f_iter), "struct.", false);
       indent(out) << "struct.set" << get_cap_name((*f_iter)->get_name()) << get_cap_name("isSet")
-                  << "(true);" << endl;
+                  << "(true);" << '\n';
     }
   }
   if (optional_count > 0) {
     indent(out) << "java.util.BitSet incoming = iprot.readBitSet(" << optional_count << ");"
-                << endl;
+                << '\n';
     int i = 0;
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_OPTIONAL
           || (*f_iter)->get_req() == t_field::T_OPT_IN_REQ_OUT) {
-        indent(out) << "if (incoming.get(" << i << ")) {" << endl;
+        indent(out) << "if (incoming.get(" << i << ")) {" << '\n';
         indent_up();
         generate_deserialize_field(out, (*f_iter), "struct.", false);
         indent(out) << "struct.set" << get_cap_name((*f_iter)->get_name()) << get_cap_name("isSet")
-                    << "(true);" << endl;
+                    << "(true);" << '\n';
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
         i++;
       }
     }
   }
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_java_struct_tuple_writer(ostream& out, t_struct* tstruct) {
-  indent(out) << java_override_annotation() << endl;
+  indent(out) << java_override_annotation() << '\n';
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol prot, "
-              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << endl;
+              << make_valid_java_identifier(tstruct->get_name()) << " struct) throws org.apache.thrift.TException {" << '\n';
   indent_up();
   indent(out) << "org.apache.thrift.protocol.TTupleProtocol oprot = "
                  "(org.apache.thrift.protocol.TTupleProtocol) prot;"
-              << endl;
+              << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -5762,70 +5759,70 @@
     }
   }
   if (has_optional) {
-    indent(out) << "java.util.BitSet optionals = new java.util.BitSet();" << endl;
+    indent(out) << "java.util.BitSet optionals = new java.util.BitSet();" << '\n';
     int i = 0;
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_OPTIONAL
           || (*f_iter)->get_req() == t_field::T_OPT_IN_REQ_OUT) {
-        indent(out) << "if (struct." << generate_isset_check((*f_iter)) << ") {" << endl;
+        indent(out) << "if (struct." << generate_isset_check((*f_iter)) << ") {" << '\n';
         indent_up();
-        indent(out) << "optionals.set(" << i << ");" << endl;
+        indent(out) << "optionals.set(" << i << ");" << '\n';
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
         i++;
       }
     }
 
-    indent(out) << "oprot.writeBitSet(optionals, " << optional_count << ");" << endl;
+    indent(out) << "oprot.writeBitSet(optionals, " << optional_count << ");" << '\n';
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_OPTIONAL
           || (*f_iter)->get_req() == t_field::T_OPT_IN_REQ_OUT) {
-        indent(out) << "if (struct." << generate_isset_check(*f_iter) << ") {" << endl;
+        indent(out) << "if (struct." << generate_isset_check(*f_iter) << ") {" << '\n';
         indent_up();
         generate_serialize_field(out, (*f_iter), "struct.", "", false);
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
       }
     }
   }
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_java_struct_tuple_scheme(ostream& out, t_struct* tstruct) {
   indent(out) << "private static class " << tstruct->get_name()
-              << "TupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {" << endl;
+              << "TupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {" << '\n';
   indent_up();
-  indent(out) << java_override_annotation() << endl;
-  indent(out) << "public " << tstruct->get_name() << "TupleScheme getScheme() {" << endl;
+  indent(out) << java_override_annotation() << '\n';
+  indent(out) << "public " << tstruct->get_name() << "TupleScheme getScheme() {" << '\n';
   indent_up();
-  indent(out) << "return new " << tstruct->get_name() << "TupleScheme();" << endl;
+  indent(out) << "return new " << tstruct->get_name() << "TupleScheme();" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
   out << indent() << "private static class " << tstruct->get_name()
       << "TupleScheme extends org.apache.thrift.scheme.TupleScheme<" << make_valid_java_identifier(tstruct->get_name()) << "> {"
-      << endl
-      << endl;
+      << '\n'
+      << '\n';
   indent_up();
   generate_java_struct_tuple_writer(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_java_struct_tuple_reader(out, tstruct);
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 void t_java_generator::generate_java_scheme_lookup(ostream& out) {
   indent(out) << "private static <S extends org.apache.thrift.scheme.IScheme> S scheme("
-              << "org.apache.thrift.protocol.TProtocol proto) {" << endl;
+              << "org.apache.thrift.protocol.TProtocol proto) {" << '\n';
   indent_up();
   indent(out) << "return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) "
               << "? STANDARD_SCHEME_FACTORY "
               << ": TUPLE_SCHEME_FACTORY"
-              << ").getScheme();" << endl;
+              << ").getScheme();" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_java_generator::generate_javax_generated_annotation(ostream& out) {
@@ -5838,11 +5835,11 @@
   }
 
   if (undated_generated_annotations_) {
-    out << ")" << endl;
+    out << ")" << '\n';
   } else {
     indent(out) << ", date = \"" << (now->tm_year + 1900) << "-" << setfill('0') << setw(2)
                 << (now->tm_mon + 1) << "-" << setfill('0') << setw(2) << now->tm_mday << "\")"
-                << endl;
+                << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_javame_generator.cc b/compiler/cpp/src/thrift/generate/t_javame_generator.cc
index d8d9056..e2c3a39 100644
--- a/compiler/cpp/src/thrift/generate/t_javame_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_javame_generator.cc
@@ -37,8 +37,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Java code generator.
  *
@@ -339,7 +337,7 @@
   generate_java_doc(f_enum, tenum);
   indent(f_enum) << "public class " << tenum->get_name() << " implements org.apache.thrift.TEnum ";
   scope_up(f_enum);
-  f_enum << endl;
+  f_enum << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
@@ -347,53 +345,53 @@
     int value = (*c_iter)->get_value();
     generate_java_doc(f_enum, *c_iter);
     indent(f_enum) << "public static final " << tenum->get_name() << " " << (*c_iter)->get_name()
-                   << " = new " << tenum->get_name() << "(" << value << ");" << endl;
+                   << " = new " << tenum->get_name() << "(" << value << ");" << '\n';
   }
-  f_enum << endl;
+  f_enum << '\n';
 
   // Field for thriftCode
-  indent(f_enum) << "private final int value;" << endl << endl;
+  indent(f_enum) << "private final int value;" << '\n' << '\n';
 
-  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << endl;
-  indent(f_enum) << "  this.value = value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
+  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << '\n';
+  indent(f_enum) << "  this.value = value;" << '\n';
+  indent(f_enum) << "}" << '\n' << '\n';
 
-  indent(f_enum) << "/**" << endl;
+  indent(f_enum) << "/**" << '\n';
   indent(f_enum) << " * Get the integer value of this enum value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public int getValue() {" << endl;
-  indent(f_enum) << "  return value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
+                 << '\n';
+  indent(f_enum) << " */" << '\n';
+  indent(f_enum) << "public int getValue() {" << '\n';
+  indent(f_enum) << "  return value;" << '\n';
+  indent(f_enum) << "}" << '\n' << '\n';
 
-  indent(f_enum) << "/**" << endl;
+  indent(f_enum) << "/**" << '\n';
   indent(f_enum) << " * Find a the enum type by its integer value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " * @return null if the value is not found." << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << endl;
+                 << '\n';
+  indent(f_enum) << " * @return null if the value is not found." << '\n';
+  indent(f_enum) << " */" << '\n';
+  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << '\n';
 
   indent_up();
 
-  indent(f_enum) << "switch (value) {" << endl;
+  indent(f_enum) << "switch (value) {" << '\n';
   indent_up();
 
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    indent(f_enum) << "case " << value << ":" << endl;
-    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << endl;
+    indent(f_enum) << "case " << value << ":" << '\n';
+    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << '\n';
   }
 
-  indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;
+  indent(f_enum) << "default:" << '\n';
+  indent(f_enum) << "  return null;" << '\n';
 
   indent_down();
 
-  indent(f_enum) << "}" << endl;
+  indent(f_enum) << "}" << '\n';
 
   indent_down();
 
-  indent(f_enum) << "}" << endl;
+  indent(f_enum) << "}" << '\n';
 
   scope_down(f_enum);
 
@@ -415,7 +413,7 @@
   // Print header
   f_consts << autogen_comment() << java_package() << java_type_imports();
 
-  f_consts << "public class " << program_name_ << "Constants {" << endl << endl;
+  f_consts << "public class " << program_name_ << "Constants {" << '\n' << '\n';
   indent_up();
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
@@ -426,7 +424,7 @@
                       false);
   }
   indent_down();
-  indent(f_consts) << "}" << endl;
+  indent(f_consts) << "}" << '\n';
   f_consts.close();
 }
 
@@ -449,17 +447,17 @@
   }
   if (type->is_base_type()) {
     string v2 = render_const_value(out, name, type, value);
-    out << name << " = " << v2 << ";" << endl << endl;
+    out << name << " = " << v2 << ";" << '\n' << '\n';
   } else if (type->is_enum()) {
-    out << name << " = " << render_const_value(out, name, type, value) << ";" << endl << endl;
+    out << name << " = " << render_const_value(out, name, type, value) << ";" << '\n' << '\n';
   } else if (type->is_struct() || type->is_xception()) {
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
+    out << name << " = new " << type_name(type, false, true) << "();" << '\n';
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
@@ -475,17 +473,17 @@
       string val = render_const_value(out, name, field_type, v_iter->second);
       indent(out) << name << ".";
       std::string cap_name = get_cap_name(v_iter->first->get_string());
-      out << "set" << cap_name << "(" << val << ");" << endl;
+      out << "set" << cap_name << "(" << val << ");" << '\n';
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_map()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
+    out << name << " = new " << type_name(type, false, true) << "();" << '\n';
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     t_type* ktype = ((t_map*)type)->get_key_type();
@@ -496,17 +494,17 @@
       string key = render_const_value(out, name, ktype, v_iter->first);
       string val = render_const_value(out, name, vtype, v_iter->second);
       indent(out) << name << ".put(" << box_type(ktype, key) << ", " << box_type(vtype, val) << ");"
-                  << endl;
+                  << '\n';
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_list() || type->is_set()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
+    out << name << " = new " << type_name(type, false, true) << "();" << '\n';
     if (!in_static) {
-      indent(out) << "static {" << endl;
+      indent(out) << "static {" << '\n';
       indent_up();
     }
     t_type* etype;
@@ -520,17 +518,17 @@
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(out, name, etype, *v_iter);
       if (type->is_list()) {
-        indent(out) << name << ".addElement(" << box_type(etype, val) << ");" << endl;
+        indent(out) << name << ".addElement(" << box_type(etype, val) << ");" << '\n';
       } else {
         indent(out) << name << ".put(" << box_type(etype, val) << ", " << box_type(etype, val)
-                    << ");" << endl;
+                    << ");" << '\n';
       }
     }
     if (!in_static) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
   } else {
     throw "compiler error: no const of type " + type->get_name();
   }
@@ -673,27 +671,27 @@
   generate_struct_desc(f_struct, tstruct);
   generate_field_descs(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_constructor(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_abstract_methods(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_getters_and_setters(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_comparisons(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   generate_union_hashcode(f_struct, tstruct);
 
-  f_struct << endl;
+  f_struct << '\n';
 
   scope_down(f_struct);
 
@@ -701,33 +699,33 @@
 }
 
 void t_javame_generator::generate_union_constructor(ostream& out, t_struct* tstruct) {
-  indent(out) << "public " << type_name(tstruct) << "() {" << endl;
-  indent(out) << "  super();" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "public " << type_name(tstruct) << "() {" << '\n';
+  indent(out) << "  super();" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
-  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, Object value) {" << endl;
-  indent(out) << "  super(setField, value);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, Object value) {" << '\n';
+  indent(out) << "  super(setField, value);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   indent(out) << "public " << type_name(tstruct) << "(" << type_name(tstruct) << " other) {"
-              << endl;
-  indent(out) << "  super(other);" << endl;
-  indent(out) << "}" << endl;
+              << '\n';
+  indent(out) << "  super(other);" << '\n';
+  indent(out) << "}" << '\n';
 
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << '\n';
+  indent(out) << "  return new " << tstruct->get_name() << "(this);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   // generate "constructors" for each field
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name() << "("
-                << type_name((*m_iter)->get_type()) << " value) {" << endl;
-    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << endl;
-    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << endl;
-    indent(out) << "  return x;" << endl;
-    indent(out) << "}" << endl << endl;
+                << type_name((*m_iter)->get_type()) << " value) {" << '\n';
+    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << '\n';
+    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << '\n';
+    indent(out) << "  return x;" << '\n';
+    indent(out) << "}" << '\n' << '\n';
   }
 }
 
@@ -740,59 +738,59 @@
     if (first) {
       first = false;
     } else {
-      out << endl;
+      out << '\n';
     }
 
     t_field* field = (*m_iter);
 
     generate_java_doc(out, field);
     indent(out) << "public " << type_name(field->get_type()) << " get"
-                << get_cap_name(field->get_name()) << "() {" << endl;
+                << get_cap_name(field->get_name()) << "() {" << '\n';
     indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                << endl;
+                << '\n';
     indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();"
-                << endl;
-    indent(out) << "  } else {" << endl;
+                << '\n';
+    indent(out) << "  } else {" << '\n';
     indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
                 << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
+                << '\n';
+    indent(out) << "  }" << '\n';
+    indent(out) << "}" << '\n';
 
-    out << endl;
+    out << '\n';
 
     generate_java_doc(out, field);
     indent(out) << "public void set" << get_cap_name(field->get_name()) << "("
-                << type_name(field->get_type()) << " value) {" << endl;
+                << type_name(field->get_type()) << " value) {" << '\n';
     if (type_can_be_null(field->get_type())) {
-      indent(out) << "  if (value == null) throw new NullPointerException();" << endl;
+      indent(out) << "  if (value == null) throw new NullPointerException();" << '\n';
     }
-    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << endl;
-    indent(out) << "  value_ = value;" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << '\n';
+    indent(out) << "  value_ = value;" << '\n';
+    indent(out) << "}" << '\n';
   }
 }
 
 void t_javame_generator::generate_union_abstract_methods(ostream& out, t_struct* tstruct) {
   generate_check_type(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_read_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_write_value(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_get_field_desc(out, tstruct);
-  out << endl;
+  out << '\n';
   generate_get_struct_desc(out, tstruct);
-  out << endl;
+  out << '\n';
 }
 
 void t_javame_generator::generate_check_type(ostream& out, t_struct* tstruct) {
   indent(out)
       << "protected void checkType(_Fields setField, Object value) throws ClassCastException {"
-      << endl;
+      << '\n';
   indent_up();
 
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -801,37 +799,37 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true)
-                << ") {" << endl;
-    indent(out) << "    break;" << endl;
-    indent(out) << "  }" << endl;
+                << ") {" << '\n';
+    indent(out) << "    break;" << '\n';
+    indent(out) << "  }" << '\n';
     indent(out) << "  throw new ClassCastException(\"Was expecting value of type "
                 << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
-                << "', but got \" + value.getClass().getSimpleName());" << endl;
+                << "', but got \" + value.getClass().getSimpleName());" << '\n';
     // do the real check here
   }
 
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
+  indent(out) << "default:" << '\n';
+  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_javame_generator::generate_read_value(ostream& out, t_struct* tstruct) {
   indent(out) << "protected Object readValue(TProtocol iprot, TField field) throws TException {"
-              << endl;
+              << '\n';
 
   indent_up();
 
-  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
+  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << '\n';
+  indent(out) << "if (setField != null) {" << '\n';
   indent_up();
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -840,48 +838,48 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << "if (field.type == " << constant_name(field->get_name()) << "_FIELD_DESC.type) {"
-                << endl;
+                << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
+                << '\n';
     generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
+    indent(out) << "return " << field->get_name() << ";" << '\n';
     indent_down();
-    indent(out) << "} else {" << endl;
-    indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << endl;
-    indent(out) << "  return null;" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "} else {" << '\n';
+    indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << '\n';
+    indent(out) << "  return null;" << '\n';
+    indent(out) << "}" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out) << "  throw new IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
+                 "of the case statements!\");" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "} else {" << endl;
+  indent(out) << "} else {" << '\n';
   indent_up();
-  indent(out) << "TProtocolUtil.skip(iprot, field.type);" << endl;
-  indent(out) << "return null;" << endl;
+  indent(out) << "TProtocolUtil.skip(iprot, field.type);" << '\n';
+  indent(out) << "return null;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_javame_generator::generate_write_value(ostream& out, t_struct* tstruct) {
-  indent(out) << "protected void writeValue(TProtocol oprot) throws TException {" << endl;
+  indent(out) << "protected void writeValue(TProtocol oprot) throws TException {" << '\n';
 
   indent_up();
 
-  indent(out) << "switch (setField_) {" << endl;
+  indent(out) << "switch (setField_) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
@@ -890,100 +888,100 @@
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
 
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
+                << type_name(field->get_type(), true, false) << ")value_;" << '\n';
     generate_serialize_field(out, field, "");
-    indent(out) << "return;" << endl;
+    indent(out) << "return;" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
   indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
+                 "setField_);" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
 
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_javame_generator::generate_get_field_desc(ostream& out, t_struct* tstruct) {
-  indent(out) << "protected TField getFieldDesc(_Fields setField) {" << endl;
+  indent(out) << "protected TField getFieldDesc(_Fields setField) {" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  indent(out) << "switch (setField) {" << endl;
+  indent(out) << "switch (setField) {" << '\n';
   indent_up();
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << endl;
+    indent(out) << "case " << constant_name(field->get_name()) << ":" << '\n';
+    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << '\n';
   }
 
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
+  indent(out) << "default:" << '\n';
+  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_javame_generator::generate_get_struct_desc(ostream& out, t_struct* tstruct) {
   (void)tstruct;
-  indent(out) << "protected TStruct getStructDesc() {" << endl;
-  indent(out) << "  return STRUCT_DESC;" << endl;
-  indent(out) << "}" << endl;
+  indent(out) << "protected TStruct getStructDesc() {" << '\n';
+  indent(out) << "  return STRUCT_DESC;" << '\n';
+  indent(out) << "}" << '\n';
 }
 
 void t_javame_generator::generate_union_comparisons(ostream& out, t_struct* tstruct) {
   // equality
-  indent(out) << "public boolean equals(Object other) {" << endl;
-  indent(out) << "  if (other instanceof " << tstruct->get_name() << ") {" << endl;
-  indent(out) << "    return equals((" << tstruct->get_name() << ")other);" << endl;
-  indent(out) << "  } else {" << endl;
-  indent(out) << "    return false;" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl;
+  indent(out) << "public boolean equals(Object other) {" << '\n';
+  indent(out) << "  if (other instanceof " << tstruct->get_name() << ") {" << '\n';
+  indent(out) << "    return equals((" << tstruct->get_name() << ")other);" << '\n';
+  indent(out) << "  } else {" << '\n';
+  indent(out) << "    return false;" << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "}" << '\n';
 
-  out << endl;
+  out << '\n';
 
-  indent(out) << "public boolean equals(" << tstruct->get_name() << " other) {" << endl;
+  indent(out) << "public boolean equals(" << tstruct->get_name() << " other) {" << '\n';
   indent(out) << "  return other != null && getSetField() == other.getSetField() && "
-                 "getFieldValue().equals(other.getFieldValue());" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+                 "getFieldValue().equals(other.getFieldValue());" << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
 
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
+  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << '\n';
   indent(out) << "  int lastComparison = TBaseHelper.compareTo(getSetField(), other.getSetField());"
-              << endl;
-  indent(out) << "  if (lastComparison == 0) {" << endl;
+              << '\n';
+  indent(out) << "  if (lastComparison == 0) {" << '\n';
   indent(out) << "    return TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());"
-              << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return lastComparison;" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+              << '\n';
+  indent(out) << "  }" << '\n';
+  indent(out) << "  return lastComparison;" << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
 }
 
 void t_javame_generator::generate_union_hashcode(ostream& out, t_struct* tstruct) {
   (void)tstruct;
-  indent(out) << "/**" << endl;
+  indent(out) << "/**" << '\n';
   indent(out)
       << " * If you'd like this to perform more respectably, use the hashcode generator option."
-      << endl;
-  indent(out) << " */" << endl;
-  indent(out) << "public int hashCode() {" << endl;
-  indent(out) << "  return 0;" << endl;
-  indent(out) << "}" << endl;
+      << '\n';
+  indent(out) << " */" << '\n';
+  indent(out) << "public int hashCode() {" << '\n';
+  indent(out) << "  return 0;" << '\n';
+  indent(out) << "}" << '\n';
 }
 
 /**
@@ -1021,43 +1019,43 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  out << endl;
+  out << '\n';
 
   generate_field_descs(out, tstruct);
 
-  out << endl;
+  out << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     indent(out) << "private ";
-    out << declare_field(*m_iter, false) << endl;
+    out << declare_field(*m_iter, false) << '\n';
   }
 
   // isset data
   if (members.size() > 0) {
-    out << endl;
+    out << '\n';
 
-    indent(out) << "// isset id assignments" << endl;
+    indent(out) << "// isset id assignments" << '\n';
 
     int i = 0;
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if (!type_can_be_null((*m_iter)->get_type())) {
         indent(out) << "private static final int " << isset_field_id(*m_iter) << " = " << i << ";"
-                    << endl;
+                    << '\n';
         i++;
       }
     }
 
     if (i > 0) {
-      indent(out) << "private boolean[] __isset_vector = new boolean[" << i << "];" << endl;
+      indent(out) << "private boolean[] __isset_vector = new boolean[" << i << "];" << '\n';
     }
 
-    out << endl;
+    out << '\n';
   }
 
   bool all_optional_members = true;
 
   // Default constructor
-  indent(out) << "public " << tstruct->get_name() << "() {" << endl;
+  indent(out) << "public " << tstruct->get_name() << "() {" << '\n';
   indent_up();
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
@@ -1074,49 +1072,49 @@
     }
   }
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   if (!members.empty() && !all_optional_members) {
     // Full constructor for all fields
-    indent(out) << "public " << tstruct->get_name() << "(" << endl;
+    indent(out) << "public " << tstruct->get_name() << "(" << '\n';
     indent_up();
     bool first = true;
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
         if (!first) {
-          out << "," << endl;
+          out << "," << '\n';
         }
         first = false;
         indent(out) << type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name();
       }
     }
-    out << ")" << endl;
+    out << ")" << '\n';
     indent_down();
-    indent(out) << "{" << endl;
+    indent(out) << "{" << '\n';
     indent_up();
-    indent(out) << "this();" << endl;
+    indent(out) << "this();" << '\n';
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
         indent(out) << "this." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << ";"
-                    << endl;
+                    << '\n';
         generate_isset_set(out, (*m_iter));
       }
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 
   // copy constructor
-  indent(out) << "/**" << endl;
-  indent(out) << " * Performs a deep copy on <i>other</i>." << endl;
-  indent(out) << " */" << endl;
+  indent(out) << "/**" << '\n';
+  indent(out) << " * Performs a deep copy on <i>other</i>." << '\n';
+  indent(out) << " */" << '\n';
   indent(out) << "public " << tstruct->get_name() << "(" << tstruct->get_name() << " other) {"
-              << endl;
+              << '\n';
   indent_up();
 
   if (has_bit_vector(tstruct)) {
     indent(out) << "System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, "
-                   "other.__isset_vector.length);" << endl;
+                   "other.__isset_vector.length);" << '\n';
   }
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1126,32 +1124,32 @@
     bool can_be_null = type_can_be_null(type);
 
     if (can_be_null) {
-      indent(out) << "if (other." << generate_isset_check(field) << ") {" << endl;
+      indent(out) << "if (other." << generate_isset_check(field) << ") {" << '\n';
       indent_up();
     }
 
     if (type->is_container()) {
       generate_deep_copy_container(out, "other", field_name, "__this__" + field_name, type);
-      indent(out) << "this." << field_name << " = __this__" << field_name << ";" << endl;
+      indent(out) << "this." << field_name << " = __this__" << field_name << ";" << '\n';
     } else {
       indent(out) << "this." << field_name << " = ";
       generate_deep_copy_non_container(out, "other." + field_name, field_name, type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
     if (can_be_null) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 
   // clone method, so that you can deep copy an object when you don't know its class.
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
+  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << '\n';
+  indent(out) << "  return new " << tstruct->get_name() << "(this);" << '\n';
+  indent(out) << "}" << '\n' << '\n';
 
   generate_java_struct_clear(out, tstruct);
 
@@ -1170,7 +1168,7 @@
   generate_java_struct_tostring(out, tstruct);
   generate_java_validator(out, tstruct);
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1179,24 +1177,24 @@
  * @param tstruct The struct definition
  */
 void t_javame_generator::generate_java_struct_equality(ostream& out, t_struct* tstruct) {
-  out << indent() << "public boolean equals(Object that) {" << endl;
+  out << indent() << "public boolean equals(Object that) {" << '\n';
   indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl
-      << indent() << "if (that instanceof " << tstruct->get_name() << ")" << endl << indent()
-      << "  return this.equals((" << tstruct->get_name() << ")that);" << endl << indent()
-      << "return false;" << endl;
+  out << indent() << "if (that == null)" << '\n' << indent() << "  return false;" << '\n'
+      << indent() << "if (that instanceof " << tstruct->get_name() << ")" << '\n' << indent()
+      << "  return this.equals((" << tstruct->get_name() << ")that);" << '\n' << indent()
+      << "return false;" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  out << indent() << "public boolean equals(" << tstruct->get_name() << " that) {" << endl;
+  out << indent() << "public boolean equals(" << tstruct->get_name() << " that) {" << '\n';
   indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl
-      << indent() << "if (this == that)" << endl << indent() << "  return true;"  << endl;
+  out << indent() << "if (that == null)" << '\n' << indent() << "  return false;" << '\n'
+      << indent() << "if (this == that)" << '\n' << indent() << "  return true;"  << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
+    out << '\n';
 
     t_type* t = get_true_type((*m_iter)->get_type());
     // Most existing Thrift code does not use isset or optional/required,
@@ -1214,14 +1212,14 @@
       that_present += " && that." + generate_isset_check(*m_iter);
     }
 
-    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << endl
-        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << endl
+    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << '\n'
+        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << '\n'
         << indent() << "if ("
-        << "this_present_" << name << " || that_present_" << name << ") {" << endl;
+        << "this_present_" << name << " || that_present_" << name << ") {" << '\n';
     indent_up();
     out << indent() << "if (!("
-        << "this_present_" << name << " && that_present_" << name << "))" << endl << indent()
-        << "  return false;" << endl;
+        << "this_present_" << name << " && that_present_" << name << "))" << '\n' << indent()
+        << "  return false;" << '\n';
 
     if (t->is_binary()) {
       unequal = "TBaseHelper.compareTo(this." + name + ", that." + name + ") != 0";
@@ -1231,66 +1229,66 @@
       unequal = "this." + name + " != that." + name;
     }
 
-    out << indent() << "if (" << unequal << ")" << endl << indent() << "  return false;" << endl;
+    out << indent() << "if (" << unequal << ")" << '\n' << indent() << "  return false;" << '\n';
 
     scope_down(out);
   }
-  out << endl;
-  indent(out) << "return true;" << endl;
+  out << '\n';
+  indent(out) << "return true;" << '\n';
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  out << indent() << "public int hashCode() {" << endl;
+  out << indent() << "public int hashCode() {" << '\n';
   indent_up();
-  indent(out) << "return 0;" << endl;
+  indent(out) << "return 0;" << '\n';
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 void t_javame_generator::generate_java_struct_compare_to(ostream& out, t_struct* tstruct) {
-  indent(out) << "public int compareTo(Object otherObject) {" << endl;
-  //  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
+  indent(out) << "public int compareTo(Object otherObject) {" << '\n';
+  //  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << '\n';
   indent_up();
 
-  indent(out) << "if (!getClass().equals(otherObject.getClass())) {" << endl;
+  indent(out) << "if (!getClass().equals(otherObject.getClass())) {" << '\n';
   indent(out) << "  return getClass().getName().compareTo(otherObject.getClass().getName());"
-              << endl;
-  indent(out) << "}" << endl;
-  out << endl;
+              << '\n';
+  indent(out) << "}" << '\n';
+  out << '\n';
   indent(out) << type_name(tstruct) << " other = (" << type_name(tstruct) << ")otherObject;";
 
-  indent(out) << "int lastComparison = 0;" << endl;
-  out << endl;
+  indent(out) << "int lastComparison = 0;" << '\n';
+  out << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = *m_iter;
     indent(out) << "lastComparison = TBaseHelper.compareTo(" << generate_isset_check(field)
-                << ", other." << generate_isset_check(field) << ");" << endl;
-    indent(out) << "if (lastComparison != 0) {" << endl;
-    indent(out) << "  return lastComparison;" << endl;
-    indent(out) << "}" << endl;
+                << ", other." << generate_isset_check(field) << ");" << '\n';
+    indent(out) << "if (lastComparison != 0) {" << '\n';
+    indent(out) << "  return lastComparison;" << '\n';
+    indent(out) << "}" << '\n';
 
-    indent(out) << "if (" << generate_isset_check(field) << ") {" << endl;
+    indent(out) << "if (" << generate_isset_check(field) << ") {" << '\n';
     if (field->get_type()->is_struct() || field->get_type()->is_xception()) {
       indent(out) << "  lastComparison = this." << field->get_name() << ".compareTo(other."
-                  << field->get_name() << ");" << endl;
+                  << field->get_name() << ");" << '\n';
     } else {
       indent(out) << "  lastComparison = TBaseHelper.compareTo(this." << field->get_name()
-                  << ", other." << field->get_name() << ");" << endl;
+                  << ", other." << field->get_name() << ");" << '\n';
     }
 
-    indent(out) << "  if (lastComparison != 0) {" << endl;
-    indent(out) << "    return lastComparison;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
+    indent(out) << "  if (lastComparison != 0) {" << '\n';
+    indent(out) << "    return lastComparison;" << '\n';
+    indent(out) << "  }" << '\n';
+    indent(out) << "}" << '\n';
   }
 
-  indent(out) << "return 0;" << endl;
+  indent(out) << "return 0;" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1299,91 +1297,91 @@
  * @param tstruct The struct definition
  */
 void t_javame_generator::generate_java_struct_reader(ostream& out, t_struct* tstruct) {
-  out << indent() << "public void read(TProtocol iprot) throws TException {" << endl;
+  out << indent() << "public void read(TProtocol iprot) throws TException {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
   // Declare stack tmp variables and read struct header
-  out << indent() << "TField field;" << endl << indent() << "iprot.readStructBegin();" << endl;
+  out << indent() << "TField field;" << '\n' << indent() << "iprot.readStructBegin();" << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
+  indent(out) << "while (true)" << '\n';
   scope_up(out);
 
   // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
+  indent(out) << "field = iprot.readFieldBegin();" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if (field.type == TType.STOP) { " << endl;
+  indent(out) << "if (field.type == TType.STOP) { " << '\n';
   indent_up();
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Switch statement on the field we are reading
-  indent(out) << "switch (field.id) {" << endl;
+  indent(out) << "switch (field.id) {" << '\n';
 
   indent_up();
 
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     indent(out) << "case " << (*f_iter)->get_key() << ": // "
-                << constant_name((*f_iter)->get_name()) << endl;
+                << constant_name((*f_iter)->get_name()) << '\n';
     indent_up();
-    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
     indent_up();
 
     generate_deserialize_field(out, *f_iter, "this.");
     generate_isset_set(out, *f_iter);
     indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-        << endl << indent() << "}" << endl << indent() << "break;" << endl;
+    out << indent() << "} else { " << '\n' << indent() << "  TProtocolUtil.skip(iprot, field.type);"
+        << '\n' << indent() << "}" << '\n' << indent() << "break;" << '\n';
     indent_down();
   }
 
-  indent(out) << "default:" << endl;
-  indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << endl;
+  indent(out) << "default:" << '\n';
+  indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
+  indent(out) << "iprot.readFieldEnd();" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
-  out << indent() << "iprot.readStructEnd();" << endl;
+  out << indent() << "iprot.readStructEnd();" << '\n';
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
+  indent(out) << "validate();" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 // generates java method to perform various checks
 // (e.g. check that all required fields are set)
 void t_javame_generator::generate_java_validator(ostream& out, t_struct* tstruct) {
-  indent(out) << "public void validate() throws TException {" << endl;
+  indent(out) << "public void validate() throws TException {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out << indent() << "// check for required fields" << endl;
+  out << indent() << "// check for required fields" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl << indent()
+      out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << '\n' << indent()
           << "  throw new TProtocolException(\"Required field '" << (*f_iter)->get_name()
-          << "' is unset! Struct:\" + toString());" << endl << indent() << "}" << endl << endl;
+          << "' is unset! Struct:\" + toString());" << '\n' << indent() << "}" << '\n' << '\n';
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1392,7 +1390,7 @@
  * @param tstruct The struct definition
  */
 void t_javame_generator::generate_java_struct_writer(ostream& out, t_struct* tstruct) {
-  out << indent() << "public void write(TProtocol oprot) throws TException {" << endl;
+  out << indent() << "public void write(TProtocol oprot) throws TException {" << '\n';
   indent_up();
 
   string name = tstruct->get_name();
@@ -1400,46 +1398,46 @@
   vector<t_field*>::const_iterator f_iter;
 
   // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl << endl;
+  indent(out) << "validate();" << '\n' << '\n';
 
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool null_allowed = type_can_be_null((*f_iter)->get_type());
     if (null_allowed) {
-      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << endl;
+      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << '\n';
       indent_up();
     }
     bool optional = (*f_iter)->get_req() == t_field::T_OPTIONAL;
     if (optional) {
-      indent(out) << "if (" << generate_isset_check((*f_iter)) << ") {" << endl;
+      indent(out) << "if (" << generate_isset_check((*f_iter)) << ") {" << '\n';
       indent_up();
     }
 
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     if (optional) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     if (null_allowed) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
   // Write the struct map
-  out << indent() << "oprot.writeFieldStop();" << endl << indent() << "oprot.writeStructEnd();"
-      << endl;
+  out << indent() << "oprot.writeFieldStop();" << '\n' << indent() << "oprot.writeStructEnd();"
+      << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1451,62 +1449,62 @@
  * @param tstruct The struct definition
  */
 void t_javame_generator::generate_java_struct_result_writer(ostream& out, t_struct* tstruct) {
-  out << indent() << "public void write(TProtocol oprot) throws TException {" << endl;
+  out << indent() << "public void write(TProtocol oprot) throws TException {" << '\n';
   indent_up();
 
   string name = tstruct->get_name();
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
+  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << '\n';
 
   bool first = true;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (first) {
       first = false;
-      out << endl << indent() << "if ";
+      out << '\n' << indent() << "if ";
     } else {
       out << " else if ";
     }
 
-    out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
+    out << "(this." << generate_isset_check(*f_iter) << ") {" << '\n';
 
     indent_up();
 
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
+                << "_FIELD_DESC);" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
+    indent(out) << "oprot.writeFieldEnd();" << '\n';
 
     indent_down();
     indent(out) << "}";
   }
   // Write the struct map
-  out << endl << indent() << "oprot.writeFieldStop();" << endl << indent()
-      << "oprot.writeStructEnd();" << endl;
+  out << '\n' << indent() << "oprot.writeFieldStop();" << '\n' << indent()
+      << "oprot.writeStructEnd();" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 void t_javame_generator::generate_reflection_getters(ostringstream& out,
                                                      t_type* type,
                                                      string field_name,
                                                      string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
+  indent(out) << "case " << constant_name(field_name) << ":" << '\n';
   indent_up();
 
   if (type->is_base_type() && !type->is_string()) {
     t_base_type* base_type = (t_base_type*)type;
 
     indent(out) << "return new " << type_name(type, true, false) << "("
-                << (base_type->is_bool() ? "is" : "get") << cap_name << "());" << endl << endl;
+                << (base_type->is_bool() ? "is" : "get") << cap_name << "());" << '\n' << '\n';
   } else {
-    indent(out) << "return get" << cap_name << "();" << endl << endl;
+    indent(out) << "return get" << cap_name << "();" << '\n' << '\n';
   }
 
   indent_down();
@@ -1516,14 +1514,14 @@
                                                      t_type* type,
                                                      string field_name,
                                                      string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
+  indent(out) << "case " << constant_name(field_name) << ":" << '\n';
   indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << endl;
-  indent(out) << "}" << endl;
-  indent(out) << "break;" << endl << endl;
+  indent(out) << "if (value == null) {" << '\n';
+  indent(out) << "  unset" << get_cap_name(field_name) << "();" << '\n';
+  indent(out) << "} else {" << '\n';
+  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << '\n';
+  indent(out) << "}" << '\n';
+  indent(out) << "break;" << '\n' << '\n';
 
   indent_down();
 }
@@ -1568,13 +1566,13 @@
     if (type->is_container()) {
       // Method to return the size of the collection
       indent(out) << "public int get" << cap_name;
-      out << get_cap_name("size() {") << endl;
+      out << get_cap_name("size() {") << '\n';
 
       indent_up();
       indent(out) << "return (this." << field_name << " == null) ? 0 : "
-                  << "this." << field_name << ".size();" << endl;
+                  << "this." << field_name << ".size();" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
 
     if (type->is_set() || type->is_list()) {
@@ -1588,35 +1586,35 @@
 
       // Iterator getter for sets and lists
       indent(out) << "public Enumeration get" << cap_name;
-      out << get_cap_name("Enumeration() {") << endl;
+      out << get_cap_name("Enumeration() {") << '\n';
 
       indent_up();
       indent(out) << "return (this." << field_name << " == null) ? null : "
-                  << "this." << field_name << ".elements();" << endl;
+                  << "this." << field_name << ".elements();" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
 
       // Add to set or list, create if the set/list is null
       indent(out);
       out << "public void add" << get_cap_name("to");
-      out << cap_name << "(" << type_name(element_type) << " elem) {" << endl;
+      out << cap_name << "(" << type_name(element_type) << " elem) {" << '\n';
 
       indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
+      indent(out) << "if (this." << field_name << " == null) {" << '\n';
       indent_up();
       indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
+                  << '\n';
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
       if (type->is_set()) {
         indent(out) << "this." << field_name << ".put(" << box_type(element_type, "elem") << ", "
-                    << box_type(element_type, "elem") << ");" << endl;
+                    << box_type(element_type, "elem") << ");" << '\n';
       } else {
         indent(out) << "this." << field_name << ".addElement(" << box_type(element_type, "elem")
-                    << ");" << endl;
+                    << ");" << '\n';
       }
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
 
     } else if (type->is_map()) {
       // Put to map
@@ -1625,18 +1623,18 @@
 
       indent(out);
       out << "public void putTo" << cap_name << "(" << type_name(key_type, true) << " key, "
-          << type_name(val_type, true) << " val) {" << endl;
+          << type_name(val_type, true) << " val) {" << '\n';
 
       indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
+      indent(out) << "if (this." << field_name << " == null) {" << '\n';
       indent_up();
       indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
+                  << '\n';
       indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".put(key, val);" << endl;
+      indent(out) << "}" << '\n';
+      indent(out) << "this." << field_name << ".put(key, val);" << '\n';
       indent_down();
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
 
     // Simple getter
@@ -1647,60 +1645,60 @@
     } else {
       out << " get";
     }
-    out << cap_name << "() {" << endl;
+    out << cap_name << "() {" << '\n';
     indent_up();
-    indent(out) << "return this." << field_name << ";" << endl;
+    indent(out) << "return this." << field_name << ";" << '\n';
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // Simple setter
     generate_java_doc(out, field);
     indent(out) << "public ";
     out << "void";
-    out << " set" << cap_name << "(" << type_name(type) << " " << field_name << ") {" << endl;
+    out << " set" << cap_name << "(" << type_name(type) << " " << field_name << ") {" << '\n';
     indent_up();
-    indent(out) << "this." << field_name << " = " << field_name << ";" << endl;
+    indent(out) << "this." << field_name << " = " << field_name << ";" << '\n';
     generate_isset_set(out, field);
 
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // Unsetter
-    indent(out) << "public void unset" << cap_name << "() {" << endl;
+    indent(out) << "public void unset" << cap_name << "() {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
+      indent(out) << "this." << field_name << " = null;" << '\n';
     } else {
-      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = false;" << endl;
+      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = false;" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     // isSet method
     indent(out) << "/** Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise */" << endl;
-    indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << endl;
+                << " is set (has been assigned a value) and false otherwise */" << '\n';
+    indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "return this." << field_name << " != null;" << endl;
+      indent(out) << "return this." << field_name << " != null;" << '\n';
     } else {
-      indent(out) << "return __isset_vector[" << isset_field_id(field) << "];" << endl;
+      indent(out) << "return __isset_vector[" << isset_field_id(field) << "];" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
 
     indent(out) << "public void set" << cap_name << get_cap_name("isSet") << "(boolean value) {"
-                << endl;
+                << '\n';
     indent_up();
     if (type_can_be_null(type)) {
-      indent(out) << "if (!value) {" << endl;
-      indent(out) << "  this." << field_name << " = null;" << endl;
-      indent(out) << "}" << endl;
+      indent(out) << "if (!value) {" << '\n';
+      indent(out) << "  this." << field_name << " = null;" << '\n';
+      indent(out) << "}" << '\n';
     } else {
-      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = value;" << endl;
+      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = value;" << '\n';
     }
     indent_down();
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   }
 }
 
@@ -1710,12 +1708,12 @@
  * @param tstruct The struct definition
  */
 void t_javame_generator::generate_java_struct_tostring(ostream& out, t_struct* tstruct) {
-  out << indent() << "public String toString() {" << endl;
+  out << indent() << "public String toString() {" << '\n';
   indent_up();
 
   out << indent() << "StringBuffer sb = new StringBuffer(\"" << tstruct->get_name() << "(\");"
-      << endl;
-  out << indent() << "boolean first = true;" << endl << endl;
+      << '\n';
+  out << indent() << "boolean first = true;" << '\n' << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -1723,46 +1721,46 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
     if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
+      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << '\n';
       indent_up();
     }
 
     t_field* field = (*f_iter);
 
     if (!first) {
-      indent(out) << "if (!first) sb.append(\", \");" << endl;
+      indent(out) << "if (!first) sb.append(\", \");" << '\n';
     }
-    indent(out) << "sb.append(\"" << (*f_iter)->get_name() << ":\");" << endl;
+    indent(out) << "sb.append(\"" << (*f_iter)->get_name() << ":\");" << '\n';
     bool can_be_null = type_can_be_null(field->get_type());
     if (can_be_null) {
-      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << endl;
-      indent(out) << "  sb.append(\"null\");" << endl;
-      indent(out) << "} else {" << endl;
+      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << '\n';
+      indent(out) << "  sb.append(\"null\");" << '\n';
+      indent(out) << "} else {" << '\n';
       indent_up();
     }
 
     if (field->get_type()->is_binary()) {
-      indent(out) << "TBaseHelper.toString(this." << field->get_name() << ", sb);" << endl;
+      indent(out) << "TBaseHelper.toString(this." << field->get_name() << ", sb);" << '\n';
     } else {
-      indent(out) << "sb.append(this." << (*f_iter)->get_name() << ");" << endl;
+      indent(out) << "sb.append(this." << (*f_iter)->get_name() << ");" << '\n';
     }
 
     if (can_be_null) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
-    indent(out) << "first = false;" << endl;
+    indent(out) << "first = false;" << '\n';
 
     if (could_be_unset) {
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
     first = false;
   }
-  out << indent() << "sb.append(\")\");" << endl << indent() << "return sb.toString();" << endl;
+  out << indent() << "sb.append(\")\");" << '\n' << indent() << "return sb.toString();" << '\n';
 
   indent_down();
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 /**
@@ -1821,7 +1819,7 @@
 }
 
 void t_javame_generator::generate_field_value_meta_data(std::ostream& out, t_type* type) {
-  out << endl;
+  out << '\n';
   indent_up();
   indent_up();
   if (type->is_struct() || type->is_xception()) {
@@ -1871,7 +1869,7 @@
 
   f_service_ << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
 
-  f_service_ << "public class " << service_name_ << " {" << endl << endl;
+  f_service_ << "public class " << service_name_ << " {" << '\n' << '\n';
   indent_up();
 
   // Generate the three main parts of the service
@@ -1881,7 +1879,7 @@
   generate_service_helpers(tservice);
 
   indent_down();
-  f_service_ << "}" << endl;
+  f_service_ << "}" << '\n';
   f_service_.close();
 }
 
@@ -1892,7 +1890,7 @@
  */
 void t_javame_generator::generate_primitive_service_interface(t_service* tservice) {
   f_service_ << indent() << "public interface Iface extends " << service_name_ << "Iface { }"
-             << endl << endl;
+             << '\n' << '\n';
 
   string f_interface_name = package_dir_ + "/" + service_name_ + "Iface.java";
   ofstream_with_content_based_conditional_update f_iface;
@@ -1905,15 +1903,15 @@
 
   f_iface << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
   generate_java_doc(f_iface, tservice);
-  f_iface << "public interface " << service_name_ << "Iface" << extends_iface << " {" << endl
-          << endl;
+  f_iface << "public interface " << service_name_ << "Iface" << extends_iface << " {" << '\n'
+          << '\n';
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_iface, *f_iter);
-    f_iface << "  public " << function_signature(*f_iter) << ";" << endl << endl;
+    f_iface << "  public " << function_signature(*f_iter) << ";" << '\n' << '\n';
   }
-  f_iface << "}" << endl << endl;
+  f_iface << "}" << '\n' << '\n';
 }
 
 /**
@@ -1930,16 +1928,16 @@
   }
 
   generate_java_doc(f_service_, tservice);
-  f_service_ << indent() << "public interface Iface" << extends_iface << " {" << endl << endl;
+  f_service_ << indent() << "public interface Iface" << extends_iface << " {" << '\n' << '\n';
   indent_up();
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_java_doc(f_service_, *f_iter);
-    indent(f_service_) << "public " << function_signature(*f_iter) << ";" << endl << endl;
+    indent(f_service_) << "public " << function_signature(*f_iter) << ";" << '\n' << '\n';
   }
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -1971,41 +1969,41 @@
   }
 
   indent(f_service_) << "public static class Client" << extends_client
-                     << " implements TServiceClient, Iface {" << endl;
+                     << " implements TServiceClient, Iface {" << '\n';
   indent_up();
 
-  indent(f_service_) << "public Client(TProtocol prot)" << endl;
+  indent(f_service_) << "public Client(TProtocol prot)" << '\n';
   scope_up(f_service_);
-  indent(f_service_) << "this(prot, prot);" << endl;
+  indent(f_service_) << "this(prot, prot);" << '\n';
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
-  indent(f_service_) << "public Client(TProtocol iprot, TProtocol oprot)" << endl;
+  indent(f_service_) << "public Client(TProtocol iprot, TProtocol oprot)" << '\n';
   scope_up(f_service_);
   if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl << indent() << "oprot_ = oprot;" << endl;
+    f_service_ << indent() << "iprot_ = iprot;" << '\n' << indent() << "oprot_ = oprot;" << '\n';
   } else {
-    f_service_ << indent() << "super(iprot, oprot);" << endl;
+    f_service_ << indent() << "super(iprot, oprot);" << '\n';
   }
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   if (extends.empty()) {
-    f_service_ << indent() << "protected TProtocol iprot_;" << endl << indent()
-               << "protected TProtocol oprot_;" << endl << endl << indent()
-               << "protected int seqid_;" << endl << endl;
+    f_service_ << indent() << "protected TProtocol iprot_;" << '\n' << indent()
+               << "protected TProtocol oprot_;" << '\n' << '\n' << indent()
+               << "protected int seqid_;" << '\n' << '\n';
 
-    indent(f_service_) << "public TProtocol getInputProtocol()" << endl;
+    indent(f_service_) << "public TProtocol getInputProtocol()" << '\n';
     scope_up(f_service_);
-    indent(f_service_) << "return this.iprot_;" << endl;
+    indent(f_service_) << "return this.iprot_;" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
-    indent(f_service_) << "public TProtocol getOutputProtocol()" << endl;
+    indent(f_service_) << "public TProtocol getOutputProtocol()" << '\n';
     scope_up(f_service_);
-    indent(f_service_) << "return this.oprot_;" << endl;
+    indent(f_service_) << "return this.oprot_;" << '\n';
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
   }
 
   // Generate client method implementations
@@ -2015,7 +2013,7 @@
     string funname = (*f_iter)->get_name();
 
     // Open function
-    indent(f_service_) << "public " << function_signature(*f_iter) << endl;
+    indent(f_service_) << "public " << function_signature(*f_iter) << '\n';
     scope_up(f_service_);
     indent(f_service_) << "send_" << funname << "(";
 
@@ -2034,17 +2032,17 @@
       }
       f_service_ << (*fld_iter)->get_name();
     }
-    f_service_ << ");" << endl;
+    f_service_ << ");" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_ << indent();
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_ << "return ";
       }
-      f_service_ << "recv_" << funname << "();" << endl;
+      f_service_ << "recv_" << funname << "();" << '\n';
     }
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     t_function send_function(g_type_void,
                              string("send_") + (*f_iter)->get_name(),
@@ -2053,26 +2051,26 @@
     string argsname = (*f_iter)->get_name() + "_args";
 
     // Open function
-    indent(f_service_) << "public " << function_signature(&send_function) << endl;
+    indent(f_service_) << "public " << function_signature(&send_function) << '\n';
     scope_up(f_service_);
 
     // Serialize the request
     f_service_ << indent() << "oprot_.writeMessageBegin(new TMessage(\"" << funname << "\", "
                << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-               << ", ++seqid_));" << endl << indent() << argsname << " args = new " << argsname
-               << "();" << endl;
+               << ", ++seqid_));" << '\n' << indent() << argsname << " args = new " << argsname
+               << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "args.set" << get_cap_name((*fld_iter)->get_name()) << "("
-                 << (*fld_iter)->get_name() << ");" << endl;
+                 << (*fld_iter)->get_name() << ");" << '\n';
     }
 
-    f_service_ << indent() << "args.write(oprot_);" << endl << indent()
-               << "oprot_.writeMessageEnd();" << endl << indent()
-               << "oprot_.getTransport().flush();" << endl;
+    f_service_ << indent() << "args.write(oprot_);" << '\n' << indent()
+               << "oprot_.writeMessageEnd();" << '\n' << indent()
+               << "oprot_.getTransport().flush();" << '\n';
 
     scope_down(f_service_);
-    f_service_ << endl;
+    f_service_ << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       string resultname = (*f_iter)->get_name() + "_result";
@@ -2083,53 +2081,53 @@
                                &noargs,
                                (*f_iter)->get_xceptions());
       // Open function
-      indent(f_service_) << "public " << function_signature(&recv_function) << endl;
+      indent(f_service_) << "public " << function_signature(&recv_function) << '\n';
       scope_up(f_service_);
 
-      f_service_ << indent() << "TMessage msg = iprot_.readMessageBegin();" << endl << indent()
-                 << "if (msg.type == TMessageType.EXCEPTION) {" << endl << indent()
-                 << "  TApplicationException x = TApplicationException.read(iprot_);" << endl
-                 << indent() << "  iprot_.readMessageEnd();" << endl << indent() << "  throw x;"
-                 << endl << indent() << "}" << endl << indent() << "if (msg.seqid != seqid_) {"
-                 << endl << indent()
+      f_service_ << indent() << "TMessage msg = iprot_.readMessageBegin();" << '\n' << indent()
+                 << "if (msg.type == TMessageType.EXCEPTION) {" << '\n' << indent()
+                 << "  TApplicationException x = TApplicationException.read(iprot_);" << '\n'
+                 << indent() << "  iprot_.readMessageEnd();" << '\n' << indent() << "  throw x;"
+                 << '\n' << indent() << "}" << '\n' << indent() << "if (msg.seqid != seqid_) {"
+                 << '\n' << indent()
                  << "  throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, \""
-                 << (*f_iter)->get_name() << " failed: out of sequence response\");" << endl
-                 << indent() << "}" << endl << indent() << resultname << " result = new "
-                 << resultname << "();" << endl << indent() << "result.read(iprot_);" << endl
-                 << indent() << "iprot_.readMessageEnd();" << endl;
+                 << (*f_iter)->get_name() << " failed: out of sequence response\");" << '\n'
+                 << indent() << "}" << '\n' << indent() << resultname << " result = new "
+                 << resultname << "();" << '\n' << indent() << "result.read(iprot_);" << '\n'
+                 << indent() << "iprot_.readMessageEnd();" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << endl
-                   << indent() << "  return result.success;" << endl << indent() << "}" << endl;
+        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << '\n'
+                   << indent() << "  return result.success;" << '\n' << indent() << "}" << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (result." << (*x_iter)->get_name() << " != null) {" << endl
-                   << indent() << "  throw result." << (*x_iter)->get_name() << ";" << endl
-                   << indent() << "}" << endl;
+        f_service_ << indent() << "if (result." << (*x_iter)->get_name() << " != null) {" << '\n'
+                   << indent() << "  throw result." << (*x_iter)->get_name() << ";" << '\n'
+                   << indent() << "}" << '\n';
       }
 
       // If you get here it's an exception, unless a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "return;" << '\n';
       } else {
         f_service_ << indent()
                    << "throw new TApplicationException(TApplicationException.MISSING_RESULT, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
+                   << (*f_iter)->get_name() << " failed: unknown result\");" << '\n';
       }
 
       // Close function
       scope_down(f_service_);
-      f_service_ << endl;
+      f_service_ << '\n';
     }
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
 }
 
 /**
@@ -2152,66 +2150,66 @@
 
   // Generate the header portion
   indent(f_service_) << "public static class Processor" << extends_processor
-                     << " implements TProcessor {" << endl;
+                     << " implements TProcessor {" << '\n';
   indent_up();
 
-  indent(f_service_) << "public Processor(Iface iface)" << endl;
+  indent(f_service_) << "public Processor(Iface iface)" << '\n';
   scope_up(f_service_);
   if (!extends.empty()) {
-    f_service_ << indent() << "super(iface);" << endl;
+    f_service_ << indent() << "super(iface);" << '\n';
   }
-  f_service_ << indent() << "iface_ = iface;" << endl;
+  f_service_ << indent() << "iface_ = iface;" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ << indent() << "processMap_.put(\"" << (*f_iter)->get_name() << "\", new "
-               << (*f_iter)->get_name() << "());" << endl;
+               << (*f_iter)->get_name() << "());" << '\n';
   }
 
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   if (extends.empty()) {
     f_service_
-        << indent() << "protected static interface ProcessFunction {" << endl << indent()
+        << indent() << "protected static interface ProcessFunction {" << '\n' << indent()
         << "  public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;"
-        << endl << indent() << "}" << endl << endl;
+        << '\n' << indent() << "}" << '\n' << '\n';
   }
 
-  f_service_ << indent() << "private Iface iface_;" << endl;
+  f_service_ << indent() << "private Iface iface_;" << '\n';
 
   if (extends.empty()) {
-    f_service_ << indent() << "protected final Hashtable processMap_ = new Hashtable();" << endl;
+    f_service_ << indent() << "protected final Hashtable processMap_ = new Hashtable();" << '\n';
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the server implementation
   indent(f_service_) << "public boolean process(TProtocol iprot, TProtocol oprot) throws TException"
-                     << endl;
+                     << '\n';
   scope_up(f_service_);
 
-  f_service_ << indent() << "TMessage msg = iprot.readMessageBegin();" << endl;
+  f_service_ << indent() << "TMessage msg = iprot.readMessageBegin();" << '\n';
 
   // TODO(mcslee): validate message, was the seqid etc. legit?
 
   f_service_
-      << indent() << "ProcessFunction fn = (ProcessFunction)processMap_.get(msg.name);" << endl
-      << indent() << "if (fn == null) {" << endl << indent()
-      << "  TProtocolUtil.skip(iprot, TType.STRUCT);" << endl << indent()
-      << "  iprot.readMessageEnd();" << endl << indent()
+      << indent() << "ProcessFunction fn = (ProcessFunction)processMap_.get(msg.name);" << '\n'
+      << indent() << "if (fn == null) {" << '\n' << indent()
+      << "  TProtocolUtil.skip(iprot, TType.STRUCT);" << '\n' << indent()
+      << "  iprot.readMessageEnd();" << '\n' << indent()
       << "  TApplicationException x = new "
          "TApplicationException(TApplicationException.UNKNOWN_METHOD, \"Invalid method name: "
-         "'\"+msg.name+\"'\");" << endl << indent()
+         "'\"+msg.name+\"'\");" << '\n' << indent()
       << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));"
-      << endl << indent() << "  x.write(oprot);" << endl << indent() << "  oprot.writeMessageEnd();"
-      << endl << indent() << "  oprot.getTransport().flush();" << endl << indent()
-      << "  return true;" << endl << indent() << "}" << endl << indent()
-      << "fn.process(msg.seqid, iprot, oprot);" << endl;
+      << '\n' << indent() << "  x.write(oprot);" << '\n' << indent() << "  oprot.writeMessageEnd();"
+      << '\n' << indent() << "  oprot.getTransport().flush();" << '\n' << indent()
+      << "  return true;" << '\n' << indent() << "}" << '\n' << indent()
+      << "fn.process(msg.seqid, iprot, oprot);" << '\n';
 
-  f_service_ << indent() << "return true;" << endl;
+  f_service_ << indent() << "return true;" << '\n';
 
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -2219,7 +2217,7 @@
   }
 
   indent_down();
-  indent(f_service_) << "}" << endl << endl;
+  indent(f_service_) << "}" << '\n' << '\n';
 }
 
 /**
@@ -2257,36 +2255,36 @@
   (void)tservice;
   // Open class
   indent(f_service_) << "private class " << tfunction->get_name() << " implements ProcessFunction {"
-                     << endl;
+                     << '\n';
   indent_up();
 
   // Open function
   indent(f_service_)
       << "public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException"
-      << endl;
+      << '\n';
   scope_up(f_service_);
 
   string argsname = tfunction->get_name() + "_args";
   string resultname = tfunction->get_name() + "_result";
 
-  f_service_ << indent() << argsname << " args = new " << argsname << "();" << endl << indent()
-             << "try {" << endl;
+  f_service_ << indent() << argsname << " args = new " << argsname << "();" << '\n' << indent()
+             << "try {" << '\n';
   indent_up();
-  f_service_ << indent() << "args.read(iprot);" << endl;
+  f_service_ << indent() << "args.read(iprot);" << '\n';
   indent_down();
-  f_service_ << indent() << "} catch (TProtocolException e) {" << endl;
+  f_service_ << indent() << "} catch (TProtocolException e) {" << '\n';
   indent_up();
-  f_service_ << indent() << "iprot.readMessageEnd();" << endl << indent()
+  f_service_ << indent() << "iprot.readMessageEnd();" << '\n' << indent()
              << "TApplicationException x = new "
                 "TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());"
-             << endl << indent() << "oprot.writeMessageBegin(new TMessage(\""
-             << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << endl << indent()
-             << "x.write(oprot);" << endl << indent() << "oprot.writeMessageEnd();" << endl
-             << indent() << "oprot.getTransport().flush();" << endl << indent() << "return;"
-             << endl;
+             << '\n' << indent() << "oprot.writeMessageBegin(new TMessage(\""
+             << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << '\n' << indent()
+             << "x.write(oprot);" << '\n' << indent() << "oprot.writeMessageEnd();" << '\n'
+             << indent() << "oprot.getTransport().flush();" << '\n' << indent() << "return;"
+             << '\n';
   indent_down();
-  f_service_ << indent() << "}" << endl;
-  f_service_ << indent() << "iprot.readMessageEnd();" << endl;
+  f_service_ << indent() << "}" << '\n';
+  f_service_ << indent() << "iprot.readMessageEnd();" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -2294,12 +2292,12 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_ << indent() << resultname << " result = new " << resultname << "();" << endl;
+    f_service_ << indent() << resultname << " result = new " << resultname << "();" << '\n';
   }
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
+    f_service_ << indent() << "try {" << '\n';
     indent_up();
   }
 
@@ -2322,13 +2320,13 @@
     }
     f_service_ << "args." << (*f_iter)->get_name();
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   // Set isset on success field
   if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()
       && !type_can_be_null(tfunction->get_returntype())) {
     f_service_ << indent() << "result.set" << get_cap_name("success") << get_cap_name("isSet")
-               << "(true);" << endl;
+               << "(true);" << '\n';
   }
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
@@ -2336,54 +2334,54 @@
     f_service_ << indent() << "}";
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << " catch (" << type_name((*x_iter)->get_type(), false, false) << " "
-                 << (*x_iter)->get_name() << ") {" << endl;
+                 << (*x_iter)->get_name() << ") {" << '\n';
       if (!tfunction->is_oneway()) {
         indent_up();
         f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << ";" << endl;
+                   << (*x_iter)->get_name() << ";" << '\n';
         indent_down();
         f_service_ << indent() << "}";
       } else {
         f_service_ << "}";
       }
     }
-    f_service_ << " catch (Throwable th) {" << endl;
+    f_service_ << " catch (Throwable th) {" << '\n';
     indent_up();
     f_service_ << indent() << "TApplicationException x = new "
                               "TApplicationException(TApplicationException.INTERNAL_ERROR, "
                               "\"Internal error processing " << tfunction->get_name() << "\");"
-               << endl << indent() << "oprot.writeMessageBegin(new TMessage(\""
-               << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << endl
-               << indent() << "x.write(oprot);" << endl << indent() << "oprot.writeMessageEnd();"
-               << endl << indent() << "oprot.getTransport().flush();" << endl << indent()
-               << "return;" << endl;
+               << '\n' << indent() << "oprot.writeMessageBegin(new TMessage(\""
+               << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << '\n'
+               << indent() << "x.write(oprot);" << '\n' << indent() << "oprot.writeMessageEnd();"
+               << '\n' << indent() << "oprot.getTransport().flush();" << '\n' << indent()
+               << "return;" << '\n';
     indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << indent() << "}" << '\n';
   }
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
+    f_service_ << indent() << "return;" << '\n';
     scope_down(f_service_);
 
     // Close class
     indent_down();
-    f_service_ << indent() << "}" << endl << endl;
+    f_service_ << indent() << "}" << '\n' << '\n';
     return;
   }
 
   f_service_ << indent() << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.REPLY, seqid));" << endl << indent() << "result.write(oprot);"
-             << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-             << "oprot.getTransport().flush();" << endl;
+             << "\", TMessageType.REPLY, seqid));" << '\n' << indent() << "result.write(oprot);"
+             << '\n' << indent() << "oprot.writeMessageEnd();" << '\n' << indent()
+             << "oprot.getTransport().flush();" << '\n';
 
   // Close function
   scope_down(f_service_);
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Close class
   indent_down();
-  f_service_ << indent() << "}" << endl << endl;
+  f_service_ << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -2441,11 +2439,11 @@
     default:
       throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_enum()) {
     indent(out) << name << " = "
                 << type_name(tfield->get_type(), true, false) + ".findByValue(iprot.readI32());"
-                << endl;
+                << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -2459,8 +2457,8 @@
 void t_javame_generator::generate_deserialize_struct(ostream& out,
                                                      t_struct* tstruct,
                                                      string prefix) {
-  out << indent() << prefix << " = new " << type_name(tstruct) << "();" << endl << indent()
-      << prefix << ".read(iprot);" << endl;
+  out << indent() << prefix << " = new " << type_name(tstruct) << "();" << '\n' << indent()
+      << prefix << ".read(iprot);" << '\n';
 }
 
 /**
@@ -2483,23 +2481,23 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    indent(out) << "TMap " << obj << " = iprot.readMapBegin();" << endl;
+    indent(out) << "TMap " << obj << " = iprot.readMapBegin();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "TSet " << obj << " = iprot.readSetBegin();" << endl;
+    indent(out) << "TSet " << obj << " = iprot.readSetBegin();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "TList " << obj << " = iprot.readListBegin();" << endl;
+    indent(out) << "TList " << obj << " = iprot.readListBegin();" << '\n';
   }
 
   indent(out) << prefix << " = new " << type_name(ttype, false, true)
               // size the collection correctly
               << "(" << (ttype->is_list() ? "" : "2*") << obj << ".size"
-              << ");" << endl;
+              << ");" << '\n';
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) << "for (int " << i << " = 0; " << i << " < " << obj << ".size"
               << "; "
-              << "++" << i << ")" << endl;
+              << "++" << i << ")" << '\n';
 
   scope_up(out);
 
@@ -2515,11 +2513,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd();" << endl;
+    indent(out) << "iprot.readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd();" << endl;
+    indent(out) << "iprot.readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd();" << endl;
+    indent(out) << "iprot.readListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -2536,14 +2534,14 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
+  indent(out) << declare_field(&fkey) << '\n';
+  indent(out) << declare_field(&fval) << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
   indent(out) << prefix << ".put(" << box_type(tmap->get_key_type(), key) << ", "
-              << box_type(tmap->get_val_type(), val) << ");" << endl;
+              << box_type(tmap->get_val_type(), val) << ");" << '\n';
 }
 
 /**
@@ -2555,12 +2553,12 @@
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
   indent(out) << prefix << ".put(" << box_type(tset->get_elem_type(), elem) << ", "
-              << box_type(tset->get_elem_type(), elem) << ");" << endl;
+              << box_type(tset->get_elem_type(), elem) << ");" << '\n';
 }
 
 /**
@@ -2572,11 +2570,11 @@
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << declare_field(&felem) << endl;
+  indent(out) << declare_field(&felem) << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".addElement(" << box_type(tlist->get_elem_type(), elem) << ");" << endl;
+  indent(out) << prefix << ".addElement(" << box_type(tlist->get_elem_type(), elem) << ");" << '\n';
 }
 
 /**
@@ -2598,7 +2596,7 @@
   } else if (type->is_container()) {
     generate_serialize_container(out, type, prefix + tfield->get_name());
   } else if (type->is_enum()) {
-    indent(out) << "oprot.writeI32(" << prefix + tfield->get_name() << ".getValue());" << endl;
+    indent(out) << "oprot.writeI32(" << prefix + tfield->get_name() << ".getValue());" << '\n';
   } else if (type->is_base_type()) {
     string name = prefix + tfield->get_name();
     indent(out) << "oprot.";
@@ -2640,7 +2638,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(" << name << ");";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -2659,7 +2657,7 @@
                                                    t_struct* tstruct,
                                                    string prefix) {
   (void)tstruct;
-  out << indent() << prefix << ".write(oprot);" << endl;
+  out << indent() << prefix << ".write(oprot);" << '\n';
 }
 
 /**
@@ -2674,14 +2672,14 @@
   if (ttype->is_map()) {
     indent(out) << "oprot.writeMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
                 << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix
-                << ".size()));" << endl;
+                << ".size()));" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot.writeSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".size()));" << endl;
+                << ", " << prefix << ".size()));" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot.writeListBegin(new TList("
                 << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".size()));"
-                << endl;
+                << '\n';
   }
 
   string iter = tmp("_iter");
@@ -2692,7 +2690,7 @@
                 << ".hasMoreElements(); ) ";
     scope_up(out);
     indent(out) << key_type << " " << iter << " = (" << key_type << ")" << enumer
-                << ".nextElement();" << endl;
+                << ".nextElement();" << '\n';
   } else if (ttype->is_set()) {
     string enumer = iter + "_enum";
     string ele_type = type_name(((t_list*)ttype)->get_elem_type(), true);
@@ -2700,7 +2698,7 @@
                 << ".hasMoreElements(); ) ";
     scope_up(out);
     indent(out) << ele_type << " " << iter << " = (" << ele_type << ")" << enumer
-                << ".nextElement();" << endl;
+                << ".nextElement();" << '\n';
   } else if (ttype->is_list()) {
     string enumer = iter + "_enum";
     indent(out) << "for (Enumeration " << enumer << " = " << prefix << ".elements(); " << enumer
@@ -2708,7 +2706,7 @@
     scope_up(out);
     string ele_type = type_name(((t_list*)ttype)->get_elem_type(), true);
     indent(out) << ele_type << " " << iter << " = (" << ele_type << ")" << enumer
-                << ".nextElement();" << endl;
+                << ".nextElement();" << '\n';
   }
 
   if (ttype->is_map()) {
@@ -2721,11 +2719,11 @@
   scope_down(out);
 
   if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd();" << endl;
+    indent(out) << "oprot.writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd();" << endl;
+    indent(out) << "oprot.writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd();" << endl;
+    indent(out) << "oprot.writeListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -3056,7 +3054,7 @@
     source_name = source_name_p1 + "." + source_name_p2;
 
   indent(out) << type_name(type, true, false) << " " << result_name << " = new "
-              << type_name(container, false, true) << "();" << endl;
+              << type_name(container, false, true) << "();" << '\n';
 
   std::string iterator_element_name = source_name_p1 + "_element";
   std::string enumeration_name = source_name_p1 + "_enum";
@@ -3067,19 +3065,19 @@
     t_type* val_type = ((t_map*)container)->get_val_type();
 
     indent(out) << "for (Enumeration " << enumeration_name << " = " << source_name << ".keys(); "
-                << enumeration_name << ".hasMoreElements(); ) {" << endl;
+                << enumeration_name << ".hasMoreElements(); ) {" << '\n';
     indent_up();
 
-    out << endl;
+    out << '\n';
 
     indent(out) << type_name(key_type, true, false) << " " << iterator_element_name << "_key = ("
                 << type_name(key_type, true, false) << ")" << enumeration_name << ".nextElement();"
-                << endl;
+                << '\n';
     indent(out) << type_name(val_type, true, false) << " " << iterator_element_name << "_value = ("
                 << type_name(val_type, true, false) << ")" << source_name << ".get("
-                << iterator_element_name << "_key);" << endl;
+                << iterator_element_name << "_key);" << '\n';
 
-    out << endl;
+    out << '\n';
 
     if (key_type->is_container()) {
       generate_deep_copy_container(out,
@@ -3093,10 +3091,10 @@
                                        iterator_element_name + "_key",
                                        result_element_name + "_key",
                                        key_type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     if (val_type->is_container()) {
       generate_deep_copy_container(out,
@@ -3110,16 +3108,16 @@
                                        iterator_element_name + "_value",
                                        result_element_name + "_value",
                                        val_type);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     indent(out) << result_name << ".put(" << result_element_name << "_key, " << result_element_name
-                << "_value);" << endl;
+                << "_value);" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
 
   } else {
     t_type* elem_type;
@@ -3131,19 +3129,19 @@
     }
 
     indent(out) << "for (Enumeration " << enumeration_name << " = " << source_name
-                << ".elements(); " << enumeration_name << ".hasMoreElements(); ) {" << endl;
+                << ".elements(); " << enumeration_name << ".hasMoreElements(); ) {" << '\n';
     indent_up();
     indent(out) << type_name(elem_type, true, false) << " " << iterator_element_name << " = ("
                 << type_name(elem_type, true, false) << ")" << enumeration_name << ".nextElement();"
-                << endl;
+                << '\n';
     if (elem_type->is_container()) {
       // recursive deep copy
       generate_deep_copy_container(out, iterator_element_name, "", result_element_name, elem_type);
       if (elem_type->is_list()) {
-        indent(out) << result_name << ".addElement(" << result_element_name << ");" << endl;
+        indent(out) << result_name << ".addElement(" << result_element_name << ");" << '\n';
       } else {
         indent(out) << result_name << ".put(" << result_element_name << ", " << result_element_name
-                    << ");" << endl;
+                    << ");" << '\n';
       }
     } else {
       // iterative copy
@@ -3153,22 +3151,22 @@
                                          iterator_element_name,
                                          "temp_binary_element",
                                          elem_type);
-        out << ";" << endl;
+        out << ";" << '\n';
         if (elem_type->is_list()) {
-          indent(out) << result_name << ".addElement(temp_binary_element);" << endl;
+          indent(out) << result_name << ".addElement(temp_binary_element);" << '\n';
         } else {
-          indent(out) << result_name << ".put(temp_binary_element, temp_binary_element);" << endl;
+          indent(out) << result_name << ".put(temp_binary_element, temp_binary_element);" << '\n';
         }
       } else {
         indent(out) << result_name << ".addElement(";
         generate_deep_copy_non_container(out, iterator_element_name, result_name, elem_type);
-        out << ");" << endl;
+        out << ");" << '\n';
       }
     }
 
     indent_down();
 
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 }
 
@@ -3179,7 +3177,7 @@
   if (type->is_base_type() || type->is_enum() || type->is_typedef()) {
     // binary fields need to be copied with System.arraycopy
     if (type->is_binary()) {
-      out << "new byte[" << source_name << ".length];" << endl;
+      out << "new byte[" << source_name << ".length];" << '\n';
       indent(out) << "System.arraycopy(" << source_name << ", 0, " << dest_name << ", 0, "
                   << source_name << ".length)";
     }
@@ -3206,7 +3204,7 @@
 void t_javame_generator::generate_isset_set(ostream& out, t_field* field) {
   if (!type_can_be_null(field->get_type())) {
     indent(out) << "set" << get_cap_name(field->get_name()) << get_cap_name("isSet") << "(true);"
-                << endl;
+                << '\n';
   }
 }
 
@@ -3221,7 +3219,7 @@
 
 void t_javame_generator::generate_struct_desc(ostream& out, t_struct* tstruct) {
   indent(out) << "private static final TStruct STRUCT_DESC = new TStruct(\"" << tstruct->get_name()
-              << "\");" << endl;
+              << "\");" << '\n';
 }
 
 void t_javame_generator::generate_field_descs(ostream& out, t_struct* tstruct) {
@@ -3232,7 +3230,7 @@
     indent(out) << "private static final TField " << constant_name((*m_iter)->get_name())
                 << "_FIELD_DESC = new TField(\"" << (*m_iter)->get_name() << "\", "
                 << type_to_enum((*m_iter)->get_type()) << ", "
-                << "(short)" << (*m_iter)->get_key() << ");" << endl;
+                << "(short)" << (*m_iter)->get_key() << ");" << '\n';
   }
 }
 
@@ -3249,7 +3247,7 @@
 }
 
 void t_javame_generator::generate_java_struct_clear(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "public void clear() {" << endl;
+  indent(out) << "public void clear() {" << '\n';
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
@@ -3266,24 +3264,24 @@
                         true);
     } else {
       if (type_can_be_null(t)) {
-        indent(out) << "this." << (*m_iter)->get_name() << " = null;" << endl;
+        indent(out) << "this." << (*m_iter)->get_name() << " = null;" << '\n';
       } else {
         // must be a base type
         // means it also needs to be explicitly unset
         indent(out) << "set" << get_cap_name((*m_iter)->get_name()) << get_cap_name("isSet")
-                    << "(false);" << endl;
+                    << "(false);" << '\n';
         switch (((t_base_type*)t)->get_base()) {
         case t_base_type::TYPE_I8:
         case t_base_type::TYPE_I16:
         case t_base_type::TYPE_I32:
         case t_base_type::TYPE_I64:
-          indent(out) << "this." << (*m_iter)->get_name() << " = 0;" << endl;
+          indent(out) << "this." << (*m_iter)->get_name() << " = 0;" << '\n';
           break;
         case t_base_type::TYPE_DOUBLE:
-          indent(out) << "this." << (*m_iter)->get_name() << " = 0.0;" << endl;
+          indent(out) << "this." << (*m_iter)->get_name() << " = 0.0;" << '\n';
           break;
         case t_base_type::TYPE_BOOL:
-          indent(out) << "this." << (*m_iter)->get_name() << " = false;" << endl;
+          indent(out) << "this." << (*m_iter)->get_name() << " = false;" << '\n';
           break;
         default: // prevent gcc compiler warning
           break;
@@ -3293,7 +3291,7 @@
   }
   indent_down();
 
-  indent(out) << "}" << endl << endl;
+  indent(out) << "}" << '\n' << '\n';
 }
 
 std::string t_javame_generator::display_name() const {
diff --git a/compiler/cpp/src/thrift/generate/t_js_generator.cc b/compiler/cpp/src/thrift/generate/t_js_generator.cc
index 0e8da59..dfc334b 100644
--- a/compiler/cpp/src/thrift/generate/t_js_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_js_generator.cc
@@ -43,7 +43,6 @@
 using std::unordered_map;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
 static const string episode_file_name = "thrift.js.episode";
 // largest consecutive integer representable by a double (2 ^ 53 - 1)
 static const int64_t max_safe_integer = 0x1fffffffffffff;
@@ -339,17 +338,17 @@
    * @return string The documentation
    */
   string ts_print_doc(t_doc* tdoc) {
-    string result = endl;
+    string result = "\n";
 
     if (tdoc->has_doc()) {
       std::stringstream doc(tdoc->get_doc());
       string item;
 
-      result += ts_indent() + "/**" + endl;
+      result += ts_indent() + "/**" + "\n";
       while (std::getline(doc, item)) {
-        result += ts_indent() + " * " + item + endl;
+        result += ts_indent() + " * " + item + "\n";
       }
-      result += ts_indent() + " */" + endl;
+      result += ts_indent() + " */" + "\n";
     }
     return result;
   }
@@ -457,7 +456,7 @@
   f_types_.open(f_types_name.c_str());
   if (gen_episode_file_) {
     const auto types_module = program_->get_name() + "_types";
-    f_episode_ << types_module << ":" << thrift_package_output_directory_ << "/" << types_module << endl;
+    f_episode_ << types_module << ":" << thrift_package_output_directory_ << "/" << types_module << '\n';
   }
 
   if (gen_ts_) {
@@ -469,17 +468,17 @@
   f_types_ << autogen_comment();
 
   if ((gen_node_ || gen_es6_) && no_ns_) {
-    f_types_ << "\"use strict\";" << endl << endl;
+    f_types_ << "\"use strict\";" << '\n' << '\n';
   }
 
-  f_types_ << js_includes() << endl << render_includes() << endl;
+  f_types_ << js_includes() << '\n' << render_includes() << '\n';
 
   if (gen_ts_) {
-    f_types_ts_ << autogen_comment() << ts_includes() << endl << render_ts_includes() << endl;
+    f_types_ts_ << autogen_comment() << ts_includes() << '\n' << render_ts_includes() << '\n';
   }
 
   if (gen_node_) {
-    f_types_ << js_const_type_ << "ttypes = module.exports = {};" << endl;
+    f_types_ << js_const_type_ << "ttypes = module.exports = {};" << '\n';
   }
 
   string pns;
@@ -490,11 +489,11 @@
   if (ns_pieces.size() > 0) {
     for (size_t i = 0; i < ns_pieces.size(); ++i) {
       pns += ((i == 0) ? "" : ".") + ns_pieces[i];
-      f_types_ << "if (typeof " << pns << " === 'undefined') {" << endl;
-      f_types_ << "  " << pns << " = {};" << endl;
-      f_types_ << "}" << endl;
-      f_types_ << "" << "if (typeof module !== 'undefined' && module.exports) {" << endl;
-      f_types_ << "  module.exports." << pns << " = " << pns << ";" << endl << "}" << endl;
+      f_types_ << "if (typeof " << pns << " === 'undefined') {" << '\n';
+      f_types_ << "  " << pns << " = {};" << '\n';
+      f_types_ << "}" << '\n';
+      f_types_ << "" << "if (typeof module !== 'undefined' && module.exports) {" << '\n';
+      f_types_ << "  module.exports." << pns << " = " << pns << ";" << '\n' << "}" << '\n';
     }
     if (gen_ts_) {
       ts_module_ = pns;
@@ -639,11 +638,11 @@
  * @param tenum The enumeration
  */
 void t_js_generator::generate_enum(t_enum* tenum) {
-  f_types_ << js_type_namespace(tenum->get_program()) << tenum->get_name() << " = {" << endl;
+  f_types_ << js_type_namespace(tenum->get_program()) << tenum->get_name() << " = {" << '\n';
 
   if (gen_ts_) {
     f_types_ts_ << ts_print_doc(tenum) << ts_indent() << ts_declare() << "enum "
-                << tenum->get_name() << " {" << endl;
+                << tenum->get_name() << " {" << '\n';
   }
 
   indent_up();
@@ -653,23 +652,23 @@
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     if (gen_ts_) {
-      f_types_ts_ << ts_indent() << (*c_iter)->get_name() << " = " << value << "," << endl;
+      f_types_ts_ << ts_indent() << (*c_iter)->get_name() << " = " << value << "," << '\n';
       // add 'value: key' in addition to 'key: value' for TypeScript enums
-      f_types_ << indent() << "'" << value << "' : '" << (*c_iter)->get_name() << "'," << endl;
+      f_types_ << indent() << "'" << value << "' : '" << (*c_iter)->get_name() << "'," << '\n';
     }
     f_types_ << indent() << "'" << (*c_iter)->get_name() << "' : " << value;
     if (c_iter != constants.end() - 1) {
       f_types_ << ",";
     }
-    f_types_ << endl;
+    f_types_ << '\n';
   }
 
   indent_down();
 
-  f_types_ << "};" << endl;
+  f_types_ << "};" << '\n';
 
   if (gen_ts_) {
-    f_types_ts_ << ts_indent() << "}" << endl;
+    f_types_ts_ << ts_indent() << "}" << '\n';
   }
 }
 
@@ -682,11 +681,11 @@
   t_const_value* value = tconst->get_value();
 
   f_types_ << js_type_namespace(program_) << name << " = ";
-  f_types_ << render_const_value(type, value) << ";" << endl;
+  f_types_ << render_const_value(type, value) << ";" << '\n';
 
   if (gen_ts_) {
     f_types_ts_ << ts_print_doc(tconst) << ts_indent() << ts_declare() << js_const_type_ << name << ": "
-                << ts_get_type(type) << ";" << endl;
+                << ts_get_type(type) << ";" << '\n';
   }
 }
 
@@ -755,24 +754,24 @@
       }
       if (v_iter != val.begin())
         out << ",";
-      out << endl << indent() << render_const_value(g_type_string, v_iter->first);
+      out << '\n' << indent() << render_const_value(g_type_string, v_iter->first);
       out << " : ";
       out << render_const_value(field_type, v_iter->second);
     }
     indent_down();
-    out << endl << indent() << "})";
+    out << '\n' << indent() << "})";
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
 
     t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
+    out << "{" << '\n';
     indent_up();
 
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       if (v_iter != val.begin())
-        out << "," << endl;
+        out << "," << '\n';
 
       if (ktype->is_base_type() && ((t_base_type*)get_true_type(ktype))->get_base() == t_base_type::TYPE_I64){
         out << indent() << "\"" << v_iter->first->get_integer() << "\"";
@@ -784,7 +783,7 @@
       out << render_const_value(vtype, v_iter->second);
     }
     indent_down();
-    out << endl << indent() << "}";
+    out << '\n' << indent() << "}";
   } else if (type->is_list() || type->is_set()) {
     t_type* etype;
     if (type->is_list()) {
@@ -866,27 +865,27 @@
     if (gen_ts_) {
       f_types_ts_ << ts_print_doc(tstruct) << ts_indent() << ts_declare() << "class "
                   << tstruct->get_name() << (is_exception ? " extends Thrift.TException" : "")
-                  << " {" << endl;
+                  << " {" << '\n';
     }
   } else {
     out << js_namespace(tstruct->get_program()) << tstruct->get_name();
     if (gen_ts_) {
       f_types_ts_ << ts_print_doc(tstruct) << ts_indent() << ts_declare() << "class "
                   << tstruct->get_name() << (is_exception ? " extends Thrift.TException" : "")
-                  << " {" << endl;
+                  << " {" << '\n';
     }
   }
 
   if (gen_es6_) {
     if (gen_node_ && is_exception) {
-      out << " = class extends Thrift.TException {" << endl;
+      out << " = class extends Thrift.TException {" << '\n';
     } else {
-      out << " = class {" << endl;
+      out << " = class {" << '\n';
     }
     indent_up();
-    indent(out) << "constructor(args) {" << endl;
+    indent(out) << "constructor(args) {" << '\n';
   } else {
-    out << " = function(args) {" << endl;
+    out << " = function(args) {" << '\n';
   }
 
   indent_up();
@@ -894,13 +893,13 @@
   // Call super() method on inherited Error class
   if (gen_node_ && is_exception) {
     if (gen_es6_) {
-      indent(out) << "super(args);" << endl;
+      indent(out) << "super(args);" << '\n';
     } else {
       indent(out) << "Thrift.TException.call(this, \"" << js_namespace(tstruct->get_program())
-        << tstruct->get_name() << "\");" << endl;
+        << tstruct->get_name() << "\");" << '\n';
     }
     out << indent() << "this.name = \"" << js_namespace(tstruct->get_program())
-        << tstruct->get_name() << "\";" << endl;
+        << tstruct->get_name() << "\";" << '\n';
   }
 
   // members with arguments
@@ -909,9 +908,9 @@
     t_type* t = get_true_type((*m_iter)->get_type());
     if ((*m_iter)->get_value() != nullptr && !(t->is_struct() || t->is_xception())) {
       dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
-      out << indent() << "this." << (*m_iter)->get_name() << " = " << dval << ";" << endl;
+      out << indent() << "this." << (*m_iter)->get_name() << " = " << dval << ";" << '\n';
     } else {
-      out << indent() << dval << ";" << endl;
+      out << indent() << dval << ";" << '\n';
     }
     if (gen_ts_) {
       string ts_access = gen_node_ ? "public " : "";
@@ -919,11 +918,11 @@
 
       // Special case. Exceptions derive from Error, and error has a non optional message field.
       // Ignore the optional flag in this case, otherwise we will generate a incompatible field
-      // in the eyes of typescript. 
+      // in the eyes of typescript.
       string optional_flag = is_exception && member_name == "message" ? "" : ts_get_req(*m_iter);
- 
+
       f_types_ts_ << ts_indent() << ts_access << member_name << optional_flag << ": "
-                  << ts_get_type((*m_iter)->get_type()) << ";" << endl;
+                  << ts_get_type((*m_iter)->get_type()) << ";" << '\n';
     }
   }
 
@@ -934,7 +933,7 @@
       t_type* t = get_true_type((*m_iter)->get_type());
       if ((*m_iter)->get_value() != nullptr && (t->is_struct() || t->is_xception())) {
         indent(out) << "this." << (*m_iter)->get_name() << " = "
-                    << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
+                    << render_const_value(t, (*m_iter)->get_value()) << ";" << '\n';
       }
     }
 
@@ -943,28 +942,28 @@
       t_type* t = get_true_type((*m_iter)->get_type());
       if (t->is_xception()) {
         out << indent() << "if (args instanceof " << js_type_namespace(t->get_program())
-            << t->get_name() << ") {" << endl << indent() << indent() << "this."
-            << (*m_iter)->get_name() << " = args;" << endl << indent() << indent() << "return;"
-            << endl << indent() << "}" << endl;
+            << t->get_name() << ") {" << '\n' << indent() << indent() << "this."
+            << (*m_iter)->get_name() << " = args;" << '\n' << indent() << indent() << "return;"
+            << '\n' << indent() << "}" << '\n';
       }
     }
 
-    indent(out) << "if (args) {" << endl;
+    indent(out) << "if (args) {" << '\n';
     indent_up();
     if (gen_ts_) {
-      f_types_ts_ << endl << ts_indent() << "constructor(args?: { ";
+      f_types_ts_ << '\n' << ts_indent() << "constructor(args?: { ";
     }
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       t_type* t = get_true_type((*m_iter)->get_type());
-      indent(out) << "if (args." << (*m_iter)->get_name() << " !== undefined && args." << (*m_iter)->get_name() << " !== null) {" << endl;
+      indent(out) << "if (args." << (*m_iter)->get_name() << " !== undefined && args." << (*m_iter)->get_name() << " !== null) {" << '\n';
       indent_up();
       indent(out) << "this." << (*m_iter)->get_name();
 
       if (t->is_struct()) {
         out << (" = new " + js_type_namespace(t->get_program()) + t->get_name() +
                 "(args."+(*m_iter)->get_name() +");");
-        out << endl;
+        out << '\n';
       } else if (t->is_container()) {
         t_type* etype = get_contained_type(t);
         string copyFunc = t->is_map() ? "Thrift.copyMap" : "Thrift.copyList";
@@ -993,53 +992,53 @@
 
         out << (" = " + copyFunc + "(args." + (*m_iter)->get_name() +
                 ", [" + type_list + "]);");
-        out << endl;
+        out << '\n';
       } else {
-        out << " = args." << (*m_iter)->get_name() << ";" << endl;
+        out << " = args." << (*m_iter)->get_name() << ";" << '\n';
       }
 
       indent_down();
       if (!(*m_iter)->get_req()) {
-        indent(out) << "} else {" << endl;
+        indent(out) << "} else {" << '\n';
          indent(out)
             << "  throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, "
-               "'Required field " << (*m_iter)->get_name() << " is unset!');" << endl;
+               "'Required field " << (*m_iter)->get_name() << " is unset!');" << '\n';
       }
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
       if (gen_ts_) {
         f_types_ts_ << (*m_iter)->get_name() << ts_get_req(*m_iter) << ": "
                     << ts_get_type((*m_iter)->get_type()) << "; ";
       }
     }
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     if (gen_ts_) {
-      f_types_ts_ << "});" << endl;
+      f_types_ts_ << "});" << '\n';
     }
   }
 
   // Done with constructor
   indent_down();
   if (gen_es6_) {
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   } else {
-    indent(out) << "};" << endl;
+    indent(out) << "};" << '\n';
   }
 
   if (gen_ts_) {
-    f_types_ts_ << ts_indent() << "}" << endl;
+    f_types_ts_ << ts_indent() << "}" << '\n';
   }
 
   if (!gen_es6_) {
     if (is_exception) {
       out << "Thrift.inherits(" << js_namespace(tstruct->get_program()) << tstruct->get_name()
-          << ", Thrift.TException);" << endl;
+          << ", Thrift.TException);" << '\n';
       out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype.name = '"
-          << tstruct->get_name() << "';" << endl;
+          << tstruct->get_name() << "';" << '\n';
     } else {
       // init prototype manually if we aren't using es6
       out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype = {};"
-          << endl;
+          << '\n';
     }
 
   }
@@ -1050,7 +1049,7 @@
   // Close out the class definition
   if (gen_es6_) {
     indent_down();
-    indent(out) << "};" << endl;
+    indent(out) << "};" << '\n';
   }
 }
 
@@ -1062,84 +1061,84 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (gen_es6_) {
-    indent(out) << "read (input) {" << endl;
+    indent(out) << "read (input) {" << '\n';
   } else {
     indent(out) << js_namespace(tstruct->get_program()) << tstruct->get_name()
-        << ".prototype.read = function(input) {" << endl;
+        << ".prototype.read = function(input) {" << '\n';
   }
 
   indent_up();
 
-  indent(out) << "input.readStructBegin();" << endl;
+  indent(out) << "input.readStructBegin();" << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (true) {" << endl;
+  indent(out) << "while (true) {" << '\n';
 
   indent_up();
 
-  indent(out) << js_const_type_ << "ret = input.readFieldBegin();" << endl;
-  indent(out) << js_const_type_ << "ftype = ret.ftype;" << endl;
+  indent(out) << js_const_type_ << "ret = input.readFieldBegin();" << '\n';
+  indent(out) << js_const_type_ << "ftype = ret.ftype;" << '\n';
   if (!fields.empty()) {
-    indent(out) << js_const_type_ << "fid = ret.fid;" << endl;
+    indent(out) << js_const_type_ << "fid = ret.fid;" << '\n';
   }
 
   // Check for field STOP marker and break
-  indent(out) << "if (ftype == Thrift.Type.STOP) {" << endl;
+  indent(out) << "if (ftype == Thrift.Type.STOP) {" << '\n';
   indent_up();
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
   if (!fields.empty()) {
     // Switch statement on the field we are reading
-    indent(out) << "switch (fid) {" << endl;
+    indent(out) << "switch (fid) {" << '\n';
 
     indent_up();
 
     // Generate deserialization code for known cases
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
 
-      indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+      indent(out) << "case " << (*f_iter)->get_key() << ":" << '\n';
+      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
 
       indent_up();
       generate_deserialize_field(out, *f_iter, "this.");
       indent_down();
 
-      indent(out) << "} else {" << endl;
+      indent(out) << "} else {" << '\n';
 
-      indent(out) << "  input.skip(ftype);" << endl;
+      indent(out) << "  input.skip(ftype);" << '\n';
 
-      out << indent() << "}" << endl << indent() << "break;" << endl;
+      out << indent() << "}" << '\n' << indent() << "break;" << '\n';
     }
     if (fields.size() == 1) {
       // pseudo case to make jslint happy
-      indent(out) << "case 0:" << endl;
-      indent(out) << "  input.skip(ftype);" << endl;
-      indent(out) << "  break;" << endl;
+      indent(out) << "case 0:" << '\n';
+      indent(out) << "  input.skip(ftype);" << '\n';
+      indent(out) << "  break;" << '\n';
     }
     // In the default case we skip the field
-    indent(out) << "default:" << endl;
-    indent(out) << "  input.skip(ftype);" << endl;
+    indent(out) << "default:" << '\n';
+    indent(out) << "  input.skip(ftype);" << '\n';
 
     scope_down(out);
   } else {
-    indent(out) << "input.skip(ftype);" << endl;
+    indent(out) << "input.skip(ftype);" << '\n';
   }
 
-  indent(out) << "input.readFieldEnd();" << endl;
+  indent(out) << "input.readFieldEnd();" << '\n';
 
   scope_down(out);
 
-  indent(out) << "input.readStructEnd();" << endl;
+  indent(out) << "input.readStructEnd();" << '\n';
 
-  indent(out) << "return;" << endl;
+  indent(out) << "return;" << '\n';
 
   indent_down();
 
   if (gen_es6_) {
-    indent(out) << "}" << endl << endl;
+    indent(out) << "}" << '\n' << '\n';
   } else {
-    indent(out) << "};" << endl << endl;
+    indent(out) << "};" << '\n' << '\n';
   }
 }
 
@@ -1152,44 +1151,44 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (gen_es6_) {
-    indent(out) << "write (output) {" << endl;
+    indent(out) << "write (output) {" << '\n';
   } else {
     indent(out) << js_namespace(tstruct->get_program()) << tstruct->get_name()
-        << ".prototype.write = function(output) {" << endl;
+        << ".prototype.write = function(output) {" << '\n';
   }
 
   indent_up();
 
-  indent(out) << "output.writeStructBegin('" << name << "');" << endl;
+  indent(out) << "output.writeStructBegin('" << name << "');" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     out << indent() << "if (this." << (*f_iter)->get_name() << " !== null && this."
-        << (*f_iter)->get_name() << " !== undefined) {" << endl;
+        << (*f_iter)->get_name() << " !== undefined) {" << '\n';
     indent_up();
 
     indent(out) << "output.writeFieldBegin("
                 << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ");" << endl;
+                << ", " << (*f_iter)->get_key() << ");" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "this.");
 
-    indent(out) << "output.writeFieldEnd();" << endl;
+    indent(out) << "output.writeFieldEnd();" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
-  out << indent() << "output.writeFieldStop();" << endl << indent() << "output.writeStructEnd();"
-      << endl;
+  out << indent() << "output.writeFieldStop();" << '\n' << indent() << "output.writeStructEnd();"
+      << '\n';
 
-  out << indent() << "return;" << endl;
+  out << indent() << "return;" << '\n';
 
   indent_down();
   if (gen_es6_) {
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
   } else {
-    out << indent() << "};" << endl << endl;
+    out << indent() << "};" << '\n' << '\n';
   }
 }
 
@@ -1202,7 +1201,7 @@
   string f_service_name = get_out_dir() + service_name_ + ".js";
   f_service_.open(f_service_name.c_str());
   if (gen_episode_file_) {
-    f_episode_ << service_name_ << ":" << thrift_package_output_directory_ << "/" << service_name_ << endl;
+    f_episode_ << service_name_ << ":" << thrift_package_output_directory_ << "/" << service_name_ << '\n';
   }
 
   if (gen_ts_) {
@@ -1213,58 +1212,58 @@
   f_service_ << autogen_comment();
 
   if ((gen_node_ || gen_es6_) && no_ns_) {
-    f_service_ << "\"use strict\";" << endl << endl;
+    f_service_ << "\"use strict\";" << '\n' << '\n';
   }
 
-  f_service_ << js_includes() << endl << render_includes() << endl;
+  f_service_ << js_includes() << '\n' << render_includes() << '\n';
 
   if (gen_ts_) {
     if (tservice->get_extends() != nullptr) {
       f_service_ts_ << "/// <reference path=\"" << tservice->get_extends()->get_name()
-                    << ".d.ts\" />" << endl;
+                    << ".d.ts\" />" << '\n';
     }
-    f_service_ts_ << autogen_comment() << endl << ts_includes() << endl << render_ts_includes() << endl;
+    f_service_ts_ << autogen_comment() << '\n' << ts_includes() << '\n' << render_ts_includes() << '\n';
     if (gen_node_) {
-      f_service_ts_ << "import ttypes = require('./" + program_->get_name() + "_types');" << endl;
+      f_service_ts_ << "import ttypes = require('./" + program_->get_name() + "_types');" << '\n';
       // Generate type aliases
       // enum
       vector<t_enum*> const& enums = program_->get_enums();
       vector<t_enum*>::const_iterator e_iter;
       for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
         f_service_ts_ << "import " << (*e_iter)->get_name() << " = ttypes."
-                  << js_namespace(program_) << (*e_iter)->get_name() << endl;
+                  << js_namespace(program_) << (*e_iter)->get_name() << '\n';
       }
       // const
       vector<t_const*> const& consts = program_->get_consts();
       vector<t_const*>::const_iterator c_iter;
       for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
         f_service_ts_ << "import " << (*c_iter)->get_name() << " = ttypes."
-                  << js_namespace(program_) << (*c_iter)->get_name() << endl;
+                  << js_namespace(program_) << (*c_iter)->get_name() << '\n';
       }
       // exception
       vector<t_struct*> const& exceptions = program_->get_xceptions();
       vector<t_struct*>::const_iterator x_iter;
       for (x_iter = exceptions.begin(); x_iter != exceptions.end(); ++x_iter) {
         f_service_ts_ << "import " << (*x_iter)->get_name() << " = ttypes."
-                  << js_namespace(program_) << (*x_iter)->get_name() << endl;
+                  << js_namespace(program_) << (*x_iter)->get_name() << '\n';
       }
       // structs
       vector<t_struct*> const& structs = program_->get_structs();
       vector<t_struct*>::const_iterator s_iter;
       for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
         f_service_ts_ << "import " << (*s_iter)->get_name() << " = ttypes."
-                  << js_namespace(program_) << (*s_iter)->get_name() << endl;
+                  << js_namespace(program_) << (*s_iter)->get_name() << '\n';
       }
     } else {
-      f_service_ts_ << "import { " << program_->get_name() << " } from \"./" << program_->get_name() << "_types\";" << endl << endl;
+      f_service_ts_ << "import { " << program_->get_name() << " } from \"./" << program_->get_name() << "_types\";" << '\n' << '\n';
     }
     if (!ts_module_.empty()) {
       if (gen_node_) {
         f_service_ts_ << "declare module " << ts_module_ << " {";
       } else {
-        f_service_ts_ << "declare module \"./" << program_->get_name() << "_types\" {" << endl;
+        f_service_ts_ << "declare module \"./" << program_->get_name() << "_types\" {" << '\n';
         indent_up();
-        f_service_ts_ << ts_indent() << "module " << program_->get_name() << " {" << endl;
+        f_service_ts_ << ts_indent() << "module " << program_->get_name() << " {" << '\n';
         indent_up();
       }
     }
@@ -1273,17 +1272,17 @@
   if (gen_node_) {
     if (tservice->get_extends() != nullptr) {
       f_service_ << js_const_type_ <<  tservice->get_extends()->get_name() << " = require('./"
-                 << tservice->get_extends()->get_name() << "');" << endl << js_const_type_
+                 << tservice->get_extends()->get_name() << "');" << '\n' << js_const_type_
                  << tservice->get_extends()->get_name()
-                 << "Client = " << tservice->get_extends()->get_name() << ".Client;" << endl
+                 << "Client = " << tservice->get_extends()->get_name() << ".Client;" << '\n'
                  << js_const_type_ << tservice->get_extends()->get_name()
-                 << "Processor = " << tservice->get_extends()->get_name() << ".Processor;" << endl;
+                 << "Processor = " << tservice->get_extends()->get_name() << ".Processor;" << '\n';
 
       f_service_ts_ << "import " << tservice->get_extends()->get_name() << " = require('./"
-                    << tservice->get_extends()->get_name() << "');" << endl;
+                    << tservice->get_extends()->get_name() << "');" << '\n';
     }
 
-    f_service_ << js_const_type_ << "ttypes = require('./" + program_->get_name() + "_types');" << endl;
+    f_service_ << js_const_type_ << "ttypes = require('./" + program_->get_name() + "_types');" << '\n';
   }
 
   generate_service_helpers(tservice);
@@ -1298,11 +1297,11 @@
   if (gen_ts_) {
     if (!ts_module_.empty()) {
       if (gen_node_) {
-        f_service_ts_ << "}" << endl;
+        f_service_ts_ << "}" << '\n';
       } else {
         indent_down();
-        f_service_ts_ << ts_indent() << "}" << endl;
-        f_service_ts_ << "}" << endl;
+        f_service_ts_ << ts_indent() << "}" << '\n';
+        f_service_ts_ << "}" << '\n';
       }
     }
     f_service_ts_.close();
@@ -1322,18 +1321,18 @@
     string prefix = has_js_namespace(tservice->get_program()) ? js_namespace(tservice->get_program()) : js_const_type_;
     f_service_ << prefix << service_name_ << "Processor = " << "exports.Processor";
     if (gen_ts_) {
-      f_service_ts_ << endl << "declare class Processor ";
+      f_service_ts_ << '\n' << "declare class Processor ";
       if (tservice->get_extends() != nullptr) {
         f_service_ts_ << "extends " << tservice->get_extends()->get_name() << ".Processor ";
       }
-      f_service_ts_ << "{" << endl;
+      f_service_ts_ << "{" << '\n';
       indent_up();
 
       if(tservice->get_extends() == nullptr) {
-        f_service_ts_ << ts_indent() << "private _handler: object;" << endl << endl;
+        f_service_ts_ << ts_indent() << "private _handler: object;" << '\n' << '\n';
       }
-      f_service_ts_ << ts_indent() << "constructor(handler: object);" << endl;
-      f_service_ts_ << ts_indent() << "process(input: thrift.TProtocol, output: thrift.TProtocol): void;" << endl;
+      f_service_ts_ << ts_indent() << "constructor(handler: object);" << '\n';
+      f_service_ts_ << ts_indent() << "process(input: thrift.TProtocol, output: thrift.TProtocol): void;" << '\n';
       indent_down();
     }
   } else {
@@ -1346,65 +1345,65 @@
   // ES6 Constructor
   if (gen_es6_) {
     if (is_subclass_service) {
-      f_service_ << " = class " << service_name_ << "Processor extends " << tservice->get_extends()->get_name() << "Processor {" << endl;
+      f_service_ << " = class " << service_name_ << "Processor extends " << tservice->get_extends()->get_name() << "Processor {" << '\n';
     } else {
-      f_service_ << " = class " << service_name_ << "Processor {" << endl;
+      f_service_ << " = class " << service_name_ << "Processor {" << '\n';
     }
     indent_up();
-    indent(f_service_) << "constructor(handler) {" << endl;
+    indent(f_service_) << "constructor(handler) {" << '\n';
   } else {
-    f_service_ << " = function(handler) {" << endl;
+    f_service_ << " = function(handler) {" << '\n';
   }
 
   indent_up();
   if (gen_es6_ && is_subclass_service) {
-    indent(f_service_) << "super(handler);" << endl;
+    indent(f_service_) << "super(handler);" << '\n';
   }
-  indent(f_service_) << "this._handler = handler;" << endl;
+  indent(f_service_) << "this._handler = handler;" << '\n';
   indent_down();
 
   // Done with constructor
   if (gen_es6_) {
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   } else {
-    indent(f_service_) << "};" << endl;
+    indent(f_service_) << "};" << '\n';
   }
 
   // ES5 service inheritance
   if (!gen_es6_ && is_subclass_service) {
     indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program())
                        << service_name_ << "Processor, " << tservice->get_extends()->get_name()
-                       << "Processor);" << endl;
+                       << "Processor);" << '\n';
   }
 
   // Generate the server implementation
   if (gen_es6_) {
-    indent(f_service_) << "process (input, output) {" << endl;
+    indent(f_service_) << "process (input, output) {" << '\n';
   } else {
     indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                      << "Processor.prototype.process = function(input, output) {" << endl;
+                      << "Processor.prototype.process = function(input, output) {" << '\n';
   }
 
   indent_up();
 
-  indent(f_service_) << js_const_type_ << "r = input.readMessageBegin();" << endl << indent()
-             << "if (this['process_' + r.fname]) {" << endl << indent()
-             << "  return this['process_' + r.fname].call(this, r.rseqid, input, output);" << endl
-             << indent() << "} else {" << endl << indent() << "  input.skip(Thrift.Type.STRUCT);"
-             << endl << indent() << "  input.readMessageEnd();" << endl << indent()
+  indent(f_service_) << js_const_type_ << "r = input.readMessageBegin();" << '\n' << indent()
+             << "if (this['process_' + r.fname]) {" << '\n' << indent()
+             << "  return this['process_' + r.fname].call(this, r.rseqid, input, output);" << '\n'
+             << indent() << "} else {" << '\n' << indent() << "  input.skip(Thrift.Type.STRUCT);"
+             << '\n' << indent() << "  input.readMessageEnd();" << '\n' << indent()
              << "  " << js_const_type_ << "x = new "
                 "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, "
-                "'Unknown function ' + r.fname);" << endl << indent()
+                "'Unknown function ' + r.fname);" << '\n' << indent()
              << "  output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);"
-             << endl << indent() << "  x.write(output);" << endl << indent()
-             << "  output.writeMessageEnd();" << endl << indent() << "  output.flush();" << endl
-             << indent() << "}" << endl;
+             << '\n' << indent() << "  x.write(output);" << '\n' << indent()
+             << "  output.writeMessageEnd();" << '\n' << indent() << "  output.flush();" << '\n'
+             << indent() << "}" << '\n';
 
   indent_down();
   if (gen_es6_) {
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   } else {
-    indent(f_service_) << "};" << endl;
+    indent(f_service_) << "};" << '\n';
   }
 
   // Generate the process subfunctions
@@ -1415,10 +1414,10 @@
   // Close off the processor class definition
   if (gen_es6_) {
     indent_down();
-    indent(f_service_) << "};" << endl;
+    indent(f_service_) << "};" << '\n';
   }
   if (gen_node_ && gen_ts_) {
-    f_service_ts_ << "}" << endl;
+    f_service_ts_ << "}" << '\n';
   }
 }
 
@@ -1429,15 +1428,15 @@
  */
 void t_js_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
   if (gen_es6_) {
-    indent(f_service_) << "process_" + tfunction->get_name() + " (seqid, input, output) {" << endl;
+    indent(f_service_) << "process_" + tfunction->get_name() + " (seqid, input, output) {" << '\n';
   } else {
     indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
                       << "Processor.prototype.process_" + tfunction->get_name()
-                          + " = function(seqid, input, output) {" << endl;
+                          + " = function(seqid, input, output) {" << '\n';
   }
   if (gen_ts_) {
     indent_up();
-    f_service_ts_ << ts_indent() << "process_" << tfunction->get_name() << "(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;" << endl;
+    f_service_ts_ << ts_indent() << "process_" << tfunction->get_name() << "(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;" << '\n';
     indent_down();
   }
 
@@ -1447,8 +1446,8 @@
   string resultname = js_namespace(program_) + service_name_ + "_" + tfunction->get_name()
                       + "_result";
 
-  indent(f_service_) << js_const_type_ << "args = new " << argsname << "();" << endl << indent()
-             << "args.read(input);" << endl << indent() << "input.readMessageEnd();" << endl;
+  indent(f_service_) << js_const_type_ << "args = new " << argsname << "();" << '\n' << indent()
+             << "args.read(input);" << '\n' << indent() << "input.readMessageEnd();" << '\n';
 
   // Generate the function call
   t_struct* arg_struct = tfunction->get_arglist();
@@ -1469,58 +1468,58 @@
       f_service_ << "args." << (*f_iter)->get_name();
     }
 
-    f_service_ << ");" << endl;
+    f_service_ << ");" << '\n';
     indent_down();
 
     if (gen_es6_) {
-      indent(f_service_) << "}" << endl;
+      indent(f_service_) << "}" << '\n';
     } else {
-      indent(f_service_) << "};" << endl;
+      indent(f_service_) << "};" << '\n';
     }
     return;
   }
 
   // Promise style invocation
   indent(f_service_) << "if (this._handler." << tfunction->get_name()
-             << ".length === " << fields.size() << ") {" << endl;
+             << ".length === " << fields.size() << ") {" << '\n';
   indent_up();
 
   if (gen_es6_) {
-    indent(f_service_) << "new Promise((resolve) => resolve(this._handler." << tfunction->get_name() << ".bind(this._handler)(" << endl;
+    indent(f_service_) << "new Promise((resolve) => resolve(this._handler." << tfunction->get_name() << ".bind(this._handler)(" << '\n';
   } else {
     string maybeComma = (fields.size() > 0 ? "," : "");
     indent(f_service_) << "Q.fcall(this._handler." << tfunction->get_name() << ".bind(this._handler)"
-                       << maybeComma << endl;
+                       << maybeComma << '\n';
   }
 
   indent_up();
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     string maybeComma = (f_iter != fields.end() - 1 ? "," : "");
-    indent(f_service_) << "args." << (*f_iter)->get_name() << maybeComma << endl;
+    indent(f_service_) << "args." << (*f_iter)->get_name() << maybeComma << '\n';
   }
   indent_down();
 
   if (gen_es6_) {
-    indent(f_service_) << "))).then(result => {" << endl;
+    indent(f_service_) << "))).then(result => {" << '\n';
   } else {
-    indent(f_service_) << ").then(function(result) {" << endl;
+    indent(f_service_) << ").then(function(result) {" << '\n';
   }
 
   indent_up();
-  f_service_ << indent() << js_const_type_ << "result_obj = new " << resultname << "({success: result});" << endl
+  f_service_ << indent() << js_const_type_ << "result_obj = new " << resultname << "({success: result});" << '\n'
              << indent() << "output.writeMessageBegin(\"" << tfunction->get_name()
-             << "\", Thrift.MessageType.REPLY, seqid);" << endl << indent()
-             << "result_obj.write(output);" << endl << indent() << "output.writeMessageEnd();" << endl
-             << indent() << "output.flush();" << endl;
+             << "\", Thrift.MessageType.REPLY, seqid);" << '\n' << indent()
+             << "result_obj.write(output);" << '\n' << indent() << "output.writeMessageEnd();" << '\n'
+             << indent() << "output.flush();" << '\n';
   indent_down();
 
   if (gen_es6_) {
-    indent(f_service_) << "}).catch(err => {" << endl;
+    indent(f_service_) << "}).catch(err => {" << '\n';
   } else {
-    indent(f_service_) << "}).catch(function (err) {" << endl;
+    indent(f_service_) << "}).catch(function (err) {" << '\n';
   }
   indent_up();
-  indent(f_service_) << js_let_type_ << "result;" << endl;
+  indent(f_service_) << js_let_type_ << "result;" << '\n';
 
   bool has_exception = false;
   t_struct* exceptions = tfunction->get_xceptions();
@@ -1542,36 +1541,36 @@
   }
 
   if (has_exception) {
-    f_service_ << ") {" << endl;
+    f_service_ << ") {" << '\n';
     indent_up();
-    f_service_ << indent() << "result = new " << resultname << "(err);" << endl << indent()
+    f_service_ << indent() << "result = new " << resultname << "(err);" << '\n' << indent()
                << "output.writeMessageBegin(\"" << tfunction->get_name()
-               << "\", Thrift.MessageType.REPLY, seqid);" << endl;
+               << "\", Thrift.MessageType.REPLY, seqid);" << '\n';
 
     indent_down();
-    indent(f_service_) << "} else {" << endl;
+    indent(f_service_) << "} else {" << '\n';
     indent_up();
   }
 
   f_service_ << indent() << "result = new "
                             "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN,"
-                            " err.message);" << endl << indent() << "output.writeMessageBegin(\""
-             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << endl;
+                            " err.message);" << '\n' << indent() << "output.writeMessageBegin(\""
+             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << '\n';
 
   if (has_exception) {
     indent_down();
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   }
 
-  f_service_ << indent() << "result.write(output);" << endl << indent()
-             << "output.writeMessageEnd();" << endl << indent() << "output.flush();" << endl;
+  f_service_ << indent() << "result.write(output);" << '\n' << indent()
+             << "output.writeMessageEnd();" << '\n' << indent() << "output.flush();" << '\n';
   indent_down();
-  indent(f_service_) << "});" << endl;
+  indent(f_service_) << "});" << '\n';
   indent_down();
   // End promise style invocation
 
   // Callback style invocation
-  indent(f_service_) << "} else {" << endl;
+  indent(f_service_) << "} else {" << '\n';
   indent_up();
   indent(f_service_) << "this._handler." << tfunction->get_name() << "(";
 
@@ -1580,12 +1579,12 @@
   }
 
   if (gen_es6_) {
-    f_service_ << "(err, result) => {" << endl;
+    f_service_ << "(err, result) => {" << '\n';
   } else {
-    f_service_ << "function (err, result) {" << endl;
+    f_service_ << "function (err, result) {" << '\n';
   }
   indent_up();
-  indent(f_service_) << js_let_type_ << "result_obj;" << endl;
+  indent(f_service_) << js_let_type_ << "result_obj;" << '\n';
 
   indent(f_service_) << "if ((err === null || typeof err === 'undefined')";
   if (has_exception) {
@@ -1597,35 +1596,35 @@
       }
     }
   }
-  f_service_ << ") {" << endl;
+  f_service_ << ") {" << '\n';
   indent_up();
   f_service_ << indent() << "result_obj = new " << resultname
-             << "((err !== null || typeof err === 'undefined') ? err : {success: result});" << endl << indent()
+             << "((err !== null || typeof err === 'undefined') ? err : {success: result});" << '\n' << indent()
              << "output.writeMessageBegin(\"" << tfunction->get_name()
-             << "\", Thrift.MessageType.REPLY, seqid);" << endl;
+             << "\", Thrift.MessageType.REPLY, seqid);" << '\n';
   indent_down();
-  indent(f_service_) << "} else {" << endl;
+  indent(f_service_) << "} else {" << '\n';
   indent_up();
   f_service_ << indent() << "result_obj = new "
                             "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN,"
-                            " err.message);" << endl << indent() << "output.writeMessageBegin(\""
-             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << endl;
+                            " err.message);" << '\n' << indent() << "output.writeMessageBegin(\""
+             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << '\n';
   indent_down();
-  f_service_ << indent() << "}" << endl << indent() << "result_obj.write(output);" << endl << indent()
-             << "output.writeMessageEnd();" << endl << indent() << "output.flush();" << endl;
+  f_service_ << indent() << "}" << '\n' << indent() << "result_obj.write(output);" << '\n' << indent()
+             << "output.writeMessageEnd();" << '\n' << indent() << "output.flush();" << '\n';
 
   indent_down();
-  indent(f_service_) << "});" << endl;
+  indent(f_service_) << "});" << '\n';
   indent_down();
-  indent(f_service_) << "}" << endl;
+  indent(f_service_) << "}" << '\n';
   // End callback style invocation
 
   indent_down();
 
   if (gen_es6_) {
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   } else {
-    indent(f_service_) << "};" << endl;
+    indent(f_service_) << "};" << '\n';
   }
 }
 
@@ -1642,7 +1641,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  f_service_ << "//HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+  f_service_ << "//HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -1712,7 +1711,7 @@
       if (tservice->get_extends() != nullptr) {
         f_service_ts_ << "extends " << tservice->get_extends()->get_name() << ".Client ";
       }
-      f_service_ts_ << "{" << endl;
+      f_service_ts_ << "{" << '\n';
     }
   } else {
     f_service_ << js_namespace(tservice->get_program()) << service_name_
@@ -1723,7 +1722,7 @@
       if (is_subclass_service) {
         f_service_ts_ << "extends " << tservice->get_extends()->get_name() << "Client ";
       }
-      f_service_ts_ << "{" << endl;
+      f_service_ts_ << "{" << '\n';
     }
   }
 
@@ -1732,21 +1731,21 @@
 
     if (is_subclass_service) {
       f_service_ << " = class " << service_name_ << "Client extends " << js_namespace(tservice->get_extends()->get_program())
-                       << tservice->get_extends()->get_name() << "Client {" << endl;
+                       << tservice->get_extends()->get_name() << "Client {" << '\n';
     } else {
-      f_service_ << " = class " << service_name_ << "Client {" << endl;
+      f_service_ << " = class " << service_name_ << "Client {" << '\n';
     }
     indent_up();
     if (gen_node_) {
-      indent(f_service_) << "constructor(output, pClass) {" << endl;
+      indent(f_service_) << "constructor(output, pClass) {" << '\n';
     } else {
-      indent(f_service_) << "constructor(input, output) {" << endl;
+      indent(f_service_) << "constructor(input, output) {" << '\n';
     }
   } else {
     if (gen_node_) {
-      f_service_ << " = function(output, pClass) {" << endl;
+      f_service_ << " = function(output, pClass) {" << '\n';
     } else {
-      f_service_ << " = function(input, output) {" << endl;
+      f_service_ << " = function(input, output) {" << '\n';
     }
   }
 
@@ -1754,65 +1753,65 @@
 
   if (gen_node_) {
     if (gen_es6_ && is_subclass_service) {
-      indent(f_service_) << "super(output, pClass);" << endl;
+      indent(f_service_) << "super(output, pClass);" << '\n';
     }
-    indent(f_service_) << "this.output = output;" << endl;
-    indent(f_service_) << "this.pClass = pClass;" << endl;
-    indent(f_service_) << "this._seqid = 0;" << endl;
-    indent(f_service_) << "this._reqs = {};" << endl;
+    indent(f_service_) << "this.output = output;" << '\n';
+    indent(f_service_) << "this.pClass = pClass;" << '\n';
+    indent(f_service_) << "this._seqid = 0;" << '\n';
+    indent(f_service_) << "this._reqs = {};" << '\n';
     if (gen_ts_) {
       if(!is_subclass_service) {
-        f_service_ts_ << ts_indent() << "private output: thrift.TTransport;" << endl
-                      << ts_indent() << "private pClass: thrift.TProtocol;" << endl
-                      << ts_indent() << "private _seqid: number;" << endl
-                      << endl;
+        f_service_ts_ << ts_indent() << "private output: thrift.TTransport;" << '\n'
+                      << ts_indent() << "private pClass: thrift.TProtocol;" << '\n'
+                      << ts_indent() << "private _seqid: number;" << '\n'
+                      << '\n';
       }
 
       f_service_ts_ << ts_indent() << "constructor(output: thrift.TTransport, pClass: { new(trans: thrift.TTransport): thrift.TProtocol });"
-                    << endl;
+                    << '\n';
     }
   } else {
-    indent(f_service_) << "this.input = input;" << endl;
-    indent(f_service_) << "this.output = (!output) ? input : output;" << endl;
-    indent(f_service_) << "this.seqid = 0;" << endl;
+    indent(f_service_) << "this.input = input;" << '\n';
+    indent(f_service_) << "this.output = (!output) ? input : output;" << '\n';
+    indent(f_service_) << "this.seqid = 0;" << '\n';
     if (gen_ts_) {
-      f_service_ts_ << ts_indent() << "input: Thrift.TJSONProtocol;" << endl << ts_indent()
-                    << "output: Thrift.TJSONProtocol;" << endl << ts_indent() << "seqid: number;"
-                    << endl << endl << ts_indent()
+      f_service_ts_ << ts_indent() << "input: Thrift.TJSONProtocol;" << '\n' << ts_indent()
+                    << "output: Thrift.TJSONProtocol;" << '\n' << ts_indent() << "seqid: number;"
+                    << '\n' << '\n' << ts_indent()
                     << "constructor(input: Thrift.TJSONProtocol, output?: Thrift.TJSONProtocol);"
-                    << endl;
+                    << '\n';
     }
   }
 
   indent_down();
 
   if (gen_es6_) {
-    indent(f_service_) << "}" << endl;
+    indent(f_service_) << "}" << '\n';
   } else {
-    indent(f_service_) << "};" << endl;
+    indent(f_service_) << "};" << '\n';
     if (is_subclass_service) {
       indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program())
                         << service_name_ << "Client, "
                         << js_namespace(tservice->get_extends()->get_program())
-                        << tservice->get_extends()->get_name() << "Client);" << endl;
+                        << tservice->get_extends()->get_name() << "Client);" << '\n';
     } else {
       // init prototype
       indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                        << "Client.prototype = {};" << endl;
+                        << "Client.prototype = {};" << '\n';
     }
   }
 
   // utils for multiplexed services
   if (gen_node_) {
     if (gen_es6_) {
-      indent(f_service_) << "seqid () { return this._seqid; }" << endl;
-      indent(f_service_) << "new_seqid () { return this._seqid += 1; }" << endl;
+      indent(f_service_) << "seqid () { return this._seqid; }" << '\n';
+      indent(f_service_) << "new_seqid () { return this._seqid += 1; }" << '\n';
     } else {
       indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                        << "Client.prototype.seqid = function() { return this._seqid; };" << endl
+                        << "Client.prototype.seqid = function() { return this._seqid; };" << '\n'
                         << js_namespace(tservice->get_program()) << service_name_
                         << "Client.prototype.new_seqid = function() { return this._seqid += 1; };"
-                        << endl;
+                        << '\n';
     }
   }
 
@@ -1827,144 +1826,144 @@
     string arglist = argument_list(arg_struct);
 
     // Open function
-    f_service_ << endl;
+    f_service_ << '\n';
     if (gen_es6_) {
-      indent(f_service_) << funname << " (" << arglist << ") {" << endl;
+      indent(f_service_) << funname << " (" << arglist << ") {" << '\n';
     } else {
       indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype."
-                << function_signature(*f_iter, "", !gen_es6_) << " {" << endl;
+                << function_signature(*f_iter, "", !gen_es6_) << " {" << '\n';
     }
 
     indent_up();
 
     if (gen_ts_) {
       // function definition without callback
-      f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false) << endl;
+      f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false) << '\n';
       if (!gen_es6_) {
         // overload with callback
-        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
+        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << '\n';
       } else {
         // overload with callback
-        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
+        f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << '\n';
       }
     }
 
     if (gen_es6_ && gen_node_) {
-      indent(f_service_) << "this._seqid = this.new_seqid();" << endl;
-      indent(f_service_) << js_const_type_ << "self = this;" << endl << indent()
-                 << "return new Promise((resolve, reject) => {" << endl;
+      indent(f_service_) << "this._seqid = this.new_seqid();" << '\n';
+      indent(f_service_) << js_const_type_ << "self = this;" << '\n' << indent()
+                 << "return new Promise((resolve, reject) => {" << '\n';
       indent_up();
-      indent(f_service_) << "self._reqs[self.seqid()] = (error, result) => {" << endl;
+      indent(f_service_) << "self._reqs[self.seqid()] = (error, result) => {" << '\n';
       indent_up();
-      indent(f_service_) << "return error ? reject(error) : resolve(result);" << endl;
+      indent(f_service_) << "return error ? reject(error) : resolve(result);" << '\n';
       indent_down();
-      indent(f_service_) << "};" << endl;
-      indent(f_service_) << "self.send_" << funname << "(" << arglist << ");" << endl;
+      indent(f_service_) << "};" << '\n';
+      indent(f_service_) << "self.send_" << funname << "(" << arglist << ");" << '\n';
       indent_down();
-      indent(f_service_) << "});" << endl;
+      indent(f_service_) << "});" << '\n';
     } else if (gen_node_) { // Node.js output      ./gen-nodejs
-      f_service_ << indent() << "this._seqid = this.new_seqid();" << endl << indent()
-                 << "if (callback === undefined) {" << endl;
+      f_service_ << indent() << "this._seqid = this.new_seqid();" << '\n' << indent()
+                 << "if (callback === undefined) {" << '\n';
       indent_up();
-      f_service_ << indent() << js_const_type_ << "_defer = Q.defer();" << endl << indent()
-                 << "this._reqs[this.seqid()] = function(error, result) {" << endl;
+      f_service_ << indent() << js_const_type_ << "_defer = Q.defer();" << '\n' << indent()
+                 << "this._reqs[this.seqid()] = function(error, result) {" << '\n';
       indent_up();
-      indent(f_service_) << "if (error) {" << endl;
+      indent(f_service_) << "if (error) {" << '\n';
       indent_up();
-      indent(f_service_) << "_defer.reject(error);" << endl;
+      indent(f_service_) << "_defer.reject(error);" << '\n';
       indent_down();
-      indent(f_service_) << "} else {" << endl;
+      indent(f_service_) << "} else {" << '\n';
       indent_up();
-      indent(f_service_) << "_defer.resolve(result);" << endl;
+      indent(f_service_) << "_defer.resolve(result);" << '\n';
       indent_down();
-      indent(f_service_) << "}" << endl;
+      indent(f_service_) << "}" << '\n';
       indent_down();
-      indent(f_service_) << "};" << endl;
-      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << endl
-                 << indent() << "return _defer.promise;" << endl;
+      indent(f_service_) << "};" << '\n';
+      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << '\n'
+                 << indent() << "return _defer.promise;" << '\n';
       indent_down();
-      indent(f_service_) << "} else {" << endl;
+      indent(f_service_) << "} else {" << '\n';
       indent_up();
-      f_service_ << indent() << "this._reqs[this.seqid()] = callback;" << endl << indent()
-                 << "this.send_" << funname << "(" << arglist << ");" << endl;
+      f_service_ << indent() << "this._reqs[this.seqid()] = callback;" << '\n' << indent()
+                 << "this.send_" << funname << "(" << arglist << ");" << '\n';
       indent_down();
-      indent(f_service_) << "}" << endl;
+      indent(f_service_) << "}" << '\n';
     } else if (gen_es6_) {
-      f_service_ << indent() << js_const_type_ << "self = this;" << endl << indent()
-                 << "return new Promise((resolve, reject) => {" << endl;
+      f_service_ << indent() << js_const_type_ << "self = this;" << '\n' << indent()
+                 << "return new Promise((resolve, reject) => {" << '\n';
       indent_up();
       f_service_ << indent() << "self.send_" << funname << "(" << arglist
-                 << (arglist.empty() ? "" : ", ") << "(error, result) => {" << endl;
+                 << (arglist.empty() ? "" : ", ") << "(error, result) => {" << '\n';
       indent_up();
-      indent(f_service_) << "return error ? reject(error) : resolve(result);" << endl;
+      indent(f_service_) << "return error ? reject(error) : resolve(result);" << '\n';
       indent_down();
-      f_service_ << indent() << "});" << endl;
+      f_service_ << indent() << "});" << '\n';
       indent_down();
-      f_service_ << indent() << "});" << endl;
+      f_service_ << indent() << "});" << '\n';
 
     } else if (gen_jquery_) { // jQuery output       ./gen-js
-      f_service_ << indent() << "if (callback === undefined) {" << endl;
+      f_service_ << indent() << "if (callback === undefined) {" << '\n';
       indent_up();
-      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << endl;
+      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << '\n';
       if (!(*f_iter)->is_oneway()) {
         f_service_ << indent();
         if (!(*f_iter)->get_returntype()->is_void()) {
           f_service_ << "return ";
         }
-        f_service_ << "this.recv_" << funname << "();" << endl;
+        f_service_ << "this.recv_" << funname << "();" << '\n';
       }
       indent_down();
-      f_service_ << indent() << "} else {" << endl;
+      f_service_ << indent() << "} else {" << '\n';
       indent_up();
       f_service_ << indent() << js_const_type_ << "postData = this.send_" << funname << "(" << arglist
-                 << (arglist.empty() ? "" : ", ") << "true);" << endl;
-      f_service_ << indent() << "return this.output.getTransport()" << endl;
+                 << (arglist.empty() ? "" : ", ") << "true);" << '\n';
+      f_service_ << indent() << "return this.output.getTransport()" << '\n';
       indent_up();
       f_service_ << indent() << ".jqRequest(this, postData, arguments, this.recv_" << funname
-                 << ");" << endl;
+                 << ");" << '\n';
       indent_down();
       indent_down();
-      f_service_ << indent() << "}" << endl;
+      f_service_ << indent() << "}" << '\n';
     } else { // Standard JavaScript ./gen-js
       f_service_ << indent() << "this.send_" << funname << "(" << arglist
-                 << (arglist.empty() ? "" : ", ") << "callback); " << endl;
+                 << (arglist.empty() ? "" : ", ") << "callback); " << '\n';
       if (!(*f_iter)->is_oneway()) {
-        f_service_ << indent() << "if (!callback) {" << endl;
+        f_service_ << indent() << "if (!callback) {" << '\n';
         f_service_ << indent();
         if (!(*f_iter)->get_returntype()->is_void()) {
           f_service_ << "  return ";
         }
-        f_service_ << "this.recv_" << funname << "();" << endl;
-        f_service_ << indent() << "}" << endl;
+        f_service_ << "this.recv_" << funname << "();" << '\n';
+        f_service_ << indent() << "}" << '\n';
       }
     }
 
     indent_down();
 
     if (gen_es6_) {
-      indent(f_service_) << "}" << endl << endl;
+      indent(f_service_) << "}" << '\n' << '\n';
     } else {
-      indent(f_service_) << "};" << endl << endl;
+      indent(f_service_) << "};" << '\n' << '\n';
     }
 
     // Send function
     if (gen_es6_) {
       if (gen_node_) {
-        indent(f_service_) << "send_" << funname << " (" << arglist << ") {" << endl;
+        indent(f_service_) << "send_" << funname << " (" << arglist << ") {" << '\n';
       } else {
         // ES6 js still uses callbacks here. Should refactor this to promise style later..
-        indent(f_service_) << "send_" << funname << " (" << argument_list(arg_struct, true) << ") {" << endl;
+        indent(f_service_) << "send_" << funname << " (" << argument_list(arg_struct, true) << ") {" << '\n';
       }
     } else {
       indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype.send_"
-                << function_signature(*f_iter, "", !gen_node_) << " {" << endl;
+                << function_signature(*f_iter, "", !gen_node_) << " {" << '\n';
     }
 
     indent_up();
 
     std::string outputVar;
     if (gen_node_) {
-      f_service_ << indent() << js_const_type_ << "output = new this.pClass(this.output);" << endl;
+      f_service_ << indent() << js_const_type_ << "output = new this.pClass(this.output);" << '\n';
       outputVar = "output";
     } else {
       outputVar = "this.output";
@@ -1980,127 +1979,127 @@
       // It is possible that a method argument is named "params", we need to ensure the locally
       // generated identifier "params" is uniquely named
       std::string params_identifier = this->next_identifier_name(fields, "params");
-      f_service_ << indent() << js_const_type_ << params_identifier << " = {" << endl;
+      f_service_ << indent() << js_const_type_ << params_identifier << " = {" << '\n';
       indent_up();
       for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
         indent(f_service_) << (*fld_iter)->get_name() << ": " << (*fld_iter)->get_name();
         if (fld_iter != fields.end()-1) {
-          f_service_ << "," << endl;
+          f_service_ << "," << '\n';
         } else {
-          f_service_ << endl;
+          f_service_ << '\n';
         }
       }
       indent_down();
-      indent(f_service_) << "};" << endl;
+      indent(f_service_) << "};" << '\n';
 
       // NOTE: "args" is a reserved keyword, so no need to generate a unique identifier
-      indent(f_service_) << js_const_type_ << "args = new " << argsname << "(" << params_identifier << ");" << endl;
+      indent(f_service_) << js_const_type_ << "args = new " << argsname << "(" << params_identifier << ");" << '\n';
     } else {
-      indent(f_service_) << js_const_type_ << "args = new " << argsname << "();" << endl;
+      indent(f_service_) << js_const_type_ << "args = new " << argsname << "();" << '\n';
     }
 
 
     // Serialize the request header within try/catch
-    indent(f_service_) << "try {" << endl;
+    indent(f_service_) << "try {" << '\n';
     indent_up();
 
     if (gen_node_) {
       f_service_ << indent() << outputVar << ".writeMessageBegin('" << (*f_iter)->get_name()
-                 << "', " << messageType << ", this.seqid());" << endl;
+                 << "', " << messageType << ", this.seqid());" << '\n';
     } else {
       f_service_ << indent() << outputVar << ".writeMessageBegin('" << (*f_iter)->get_name()
-                 << "', " << messageType << ", this.seqid);" << endl;
+                 << "', " << messageType << ", this.seqid);" << '\n';
     }
 
 
     // Write to the stream
-    f_service_ << indent() << "args.write(" << outputVar << ");" << endl << indent() << outputVar
-               << ".writeMessageEnd();" << endl;
+    f_service_ << indent() << "args.write(" << outputVar << ");" << '\n' << indent() << outputVar
+               << ".writeMessageEnd();" << '\n';
 
     if (gen_node_) {
       if((*f_iter)->is_oneway()) {
-        f_service_ << indent() << "this.output.flush();" << endl;
-        f_service_ << indent() << js_const_type_ << "callback = this._reqs[this.seqid()] || function() {};" << endl;
-        f_service_ << indent() << "delete this._reqs[this.seqid()];" << endl;
-        f_service_ << indent() << "callback(null);" << endl;
+        f_service_ << indent() << "this.output.flush();" << '\n';
+        f_service_ << indent() << js_const_type_ << "callback = this._reqs[this.seqid()] || function() {};" << '\n';
+        f_service_ << indent() << "delete this._reqs[this.seqid()];" << '\n';
+        f_service_ << indent() << "callback(null);" << '\n';
       } else {
-        f_service_ << indent() << "return this.output.flush();" << endl;
+        f_service_ << indent() << "return this.output.flush();" << '\n';
       }
     } else {
       if (gen_jquery_) {
-        f_service_ << indent() << "return this.output.getTransport().flush(callback);" << endl;
+        f_service_ << indent() << "return this.output.getTransport().flush(callback);" << '\n';
       } else if (gen_es6_) {
-        f_service_ << indent() << js_const_type_ << "self = this;" << endl;
+        f_service_ << indent() << js_const_type_ << "self = this;" << '\n';
         if((*f_iter)->is_oneway()) {
-          f_service_ << indent() << "this.output.getTransport().flush(true, null);" << endl;
-          f_service_ << indent() << "callback();" << endl;
+          f_service_ << indent() << "this.output.getTransport().flush(true, null);" << '\n';
+          f_service_ << indent() << "callback();" << '\n';
         } else {
-          f_service_ << indent() << "this.output.getTransport().flush(true, () => {" << endl;
+          f_service_ << indent() << "this.output.getTransport().flush(true, () => {" << '\n';
           indent_up();
-          f_service_ << indent() << js_let_type_ << "error = null, result = null;" << endl;
-          f_service_ << indent() << "try {" << endl;
-          f_service_ << indent() << "  result = self.recv_" << funname << "();" << endl;
-          f_service_ << indent() << "} catch (e) {" << endl;
-          f_service_ << indent() << "  error = e;" << endl;
-          f_service_ << indent() << "}" << endl;
-          f_service_ << indent() << "callback(error, result);" << endl;
+          f_service_ << indent() << js_let_type_ << "error = null, result = null;" << '\n';
+          f_service_ << indent() << "try {" << '\n';
+          f_service_ << indent() << "  result = self.recv_" << funname << "();" << '\n';
+          f_service_ << indent() << "} catch (e) {" << '\n';
+          f_service_ << indent() << "  error = e;" << '\n';
+          f_service_ << indent() << "}" << '\n';
+          f_service_ << indent() << "callback(error, result);" << '\n';
           indent_down();
-          f_service_ << indent() << "});" << endl;
+          f_service_ << indent() << "});" << '\n';
         }
       } else {
-        f_service_ << indent() << "if (callback) {" << endl;
+        f_service_ << indent() << "if (callback) {" << '\n';
         indent_up();
         if((*f_iter)->is_oneway()) {
-          f_service_ << indent() << "this.output.getTransport().flush(true, null);" << endl;
-          f_service_ << indent() << "callback();" << endl;
+          f_service_ << indent() << "this.output.getTransport().flush(true, null);" << '\n';
+          f_service_ << indent() << "callback();" << '\n';
         } else {
-          f_service_ << indent() << js_const_type_ << "self = this;" << endl;
-          f_service_ << indent() << "this.output.getTransport().flush(true, function() {" << endl;
+          f_service_ << indent() << js_const_type_ << "self = this;" << '\n';
+          f_service_ << indent() << "this.output.getTransport().flush(true, function() {" << '\n';
           indent_up();
-          f_service_ << indent() << js_let_type_ << "result = null;" << endl;
-          f_service_ << indent() << "try {" << endl;
-          f_service_ << indent() << "  result = self.recv_" << funname << "();" << endl;
-          f_service_ << indent() << "} catch (e) {" << endl;
-          f_service_ << indent() << "  result = e;" << endl;
-          f_service_ << indent() << "}" << endl;
-          f_service_ << indent() << "callback(result);" << endl;
+          f_service_ << indent() << js_let_type_ << "result = null;" << '\n';
+          f_service_ << indent() << "try {" << '\n';
+          f_service_ << indent() << "  result = self.recv_" << funname << "();" << '\n';
+          f_service_ << indent() << "} catch (e) {" << '\n';
+          f_service_ << indent() << "  result = e;" << '\n';
+          f_service_ << indent() << "}" << '\n';
+          f_service_ << indent() << "callback(result);" << '\n';
           indent_down();
-          f_service_ << indent() << "});" << endl;
+          f_service_ << indent() << "});" << '\n';
         }
         indent_down();
-        f_service_ << indent() << "} else {" << endl;
-        f_service_ << indent() << "  return this.output.getTransport().flush();" << endl;
-        f_service_ << indent() << "}" << endl;
+        f_service_ << indent() << "} else {" << '\n';
+        f_service_ << indent() << "  return this.output.getTransport().flush();" << '\n';
+        f_service_ << indent() << "}" << '\n';
       }
     }
 
     indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << indent() << "}" << '\n';
 
     // Reset the transport and delete registered callback if there was a serialization error
-    f_service_ << indent() << "catch (e) {" << endl;
+    f_service_ << indent() << "catch (e) {" << '\n';
     indent_up();
     if (gen_node_) {
-      f_service_ << indent() << "delete this._reqs[this.seqid()];" << endl;
-      f_service_ << indent() << "if (typeof " << outputVar << ".reset === 'function') {" << endl;
-      f_service_ << indent() << "  " << outputVar << ".reset();" << endl;
-      f_service_ << indent() << "}" << endl;
+      f_service_ << indent() << "delete this._reqs[this.seqid()];" << '\n';
+      f_service_ << indent() << "if (typeof " << outputVar << ".reset === 'function') {" << '\n';
+      f_service_ << indent() << "  " << outputVar << ".reset();" << '\n';
+      f_service_ << indent() << "}" << '\n';
     } else {
-      f_service_ << indent() << "if (typeof " << outputVar << ".getTransport().reset === 'function') {" << endl;
-      f_service_ << indent() << "  " << outputVar << ".getTransport().reset();" << endl;
-      f_service_ << indent() << "}" << endl;
+      f_service_ << indent() << "if (typeof " << outputVar << ".getTransport().reset === 'function') {" << '\n';
+      f_service_ << indent() << "  " << outputVar << ".getTransport().reset();" << '\n';
+      f_service_ << indent() << "}" << '\n';
     }
-    f_service_ << indent() << "throw e;" << endl;
+    f_service_ << indent() << "throw e;" << '\n';
     indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << indent() << "}" << '\n';
 
     indent_down();
 
     // Close send function
     if (gen_es6_) {
-      indent(f_service_) << "}" << endl;
+      indent(f_service_) << "}" << '\n';
     } else {
-      indent(f_service_) << "};" << endl;
+      indent(f_service_) << "};" << '\n';
     }
 
     // Receive function
@@ -2108,19 +2107,19 @@
       std::string resultname = js_namespace(tservice->get_program()) + service_name_ + "_"
                                + (*f_iter)->get_name() + "_result";
 
-      f_service_ << endl;
+      f_service_ << '\n';
       // Open receive function
       if (gen_node_) {
         if (gen_es6_) {
-          indent(f_service_) << "recv_" << (*f_iter)->get_name() << " (input, mtype, rseqid) {" << endl;
+          indent(f_service_) << "recv_" << (*f_iter)->get_name() << " (input, mtype, rseqid) {" << '\n';
         } else {
           indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
                       << "Client.prototype.recv_" << (*f_iter)->get_name()
-                      << " = function(input,mtype,rseqid) {" << endl;
+                      << " = function(input,mtype,rseqid) {" << '\n';
         }
       } else {
         if (gen_es6_) {
-          indent(f_service_) << "recv_" << (*f_iter)->get_name() << " () {" << endl;
+          indent(f_service_) << "recv_" << (*f_iter)->get_name() << " () {" << '\n';
         } else {
           t_struct noargs(program_);
 
@@ -2128,7 +2127,7 @@
                                   string("recv_") + (*f_iter)->get_name(),
                                   &noargs);
           indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                    << "Client.prototype." << function_signature(&recv_function) << " {" << endl;
+                    << "Client.prototype." << function_signature(&recv_function) << " {" << '\n';
         }
       }
 
@@ -2142,68 +2141,68 @@
       }
 
       if (gen_node_) {
-        f_service_ << indent() << js_const_type_ << "callback = this._reqs[rseqid] || function() {};" << endl
-                   << indent() << "delete this._reqs[rseqid];" << endl;
+        f_service_ << indent() << js_const_type_ << "callback = this._reqs[rseqid] || function() {};" << '\n'
+                   << indent() << "delete this._reqs[rseqid];" << '\n';
       } else {
-        f_service_ << indent() << js_const_type_ << "ret = this.input.readMessageBegin();" << endl
-                   << indent() << js_const_type_ << "mtype = ret.mtype;" << endl;
+        f_service_ << indent() << js_const_type_ << "ret = this.input.readMessageBegin();" << '\n'
+                   << indent() << js_const_type_ << "mtype = ret.mtype;" << '\n';
       }
 
-      f_service_ << indent() << "if (mtype == Thrift.MessageType.EXCEPTION) {" << endl;
+      f_service_ << indent() << "if (mtype == Thrift.MessageType.EXCEPTION) {" << '\n';
 
       indent_up();
-      f_service_ << indent() << js_const_type_ << "x = new Thrift.TApplicationException();" << endl
-                 << indent() << "x.read(" << inputVar << ");" << endl
-                 << indent() << inputVar << ".readMessageEnd();" << endl
-                 << indent() << render_recv_throw("x") << endl;
+      f_service_ << indent() << js_const_type_ << "x = new Thrift.TApplicationException();" << '\n'
+                 << indent() << "x.read(" << inputVar << ");" << '\n'
+                 << indent() << inputVar << ".readMessageEnd();" << '\n'
+                 << indent() << render_recv_throw("x") << '\n';
       scope_down(f_service_);
 
-      f_service_ << indent() << js_const_type_ << "result = new " << resultname << "();" << endl << indent()
-                 << "result.read(" << inputVar << ");" << endl;
+      f_service_ << indent() << js_const_type_ << "result = new " << resultname << "();" << '\n' << indent()
+                 << "result.read(" << inputVar << ");" << '\n';
 
-      f_service_ << indent() << inputVar << ".readMessageEnd();" << endl << endl;
+      f_service_ << indent() << inputVar << ".readMessageEnd();" << '\n' << '\n';
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (null !== result." << (*x_iter)->get_name() << ") {" << endl
+        f_service_ << indent() << "if (null !== result." << (*x_iter)->get_name() << ") {" << '\n'
                    << indent() << "  " << render_recv_throw("result." + (*x_iter)->get_name())
-                   << endl << indent() << "}" << endl;
+                   << '\n' << indent() << "}" << '\n';
       }
 
       // Careful, only return result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (null !== result.success) {" << endl << indent() << "  "
-                   << render_recv_return("result.success") << endl << indent() << "}" << endl;
+        f_service_ << indent() << "if (null !== result.success) {" << '\n' << indent() << "  "
+                   << render_recv_return("result.success") << '\n' << indent() << "}" << '\n';
         f_service_ << indent()
                    << render_recv_throw("'" + (*f_iter)->get_name() + " failed: unknown result'")
-                   << endl;
+                   << '\n';
       } else {
         if (gen_node_) {
-          indent(f_service_) << "callback(null);" << endl;
+          indent(f_service_) << "callback(null);" << '\n';
         } else {
-          indent(f_service_) << "return;" << endl;
+          indent(f_service_) << "return;" << '\n';
         }
       }
 
       // Close receive function
       indent_down();
       if (gen_es6_) {
-        indent(f_service_) << "}" << endl;
+        indent(f_service_) << "}" << '\n';
       } else {
-        indent(f_service_) << "};" << endl;
+        indent(f_service_) << "};" << '\n';
       }
     }
   }
 
   // Finish class definitions
   if (gen_ts_) {
-    f_service_ts_ << ts_indent() << "}" << endl;
+    f_service_ts_ << ts_indent() << "}" << '\n';
   }
   if (gen_es6_) {
     indent_down();
-    f_service_ << "};" << endl;
+    f_service_ << "};" << '\n';
   }
 }
 
@@ -2284,7 +2283,7 @@
       out << ".value";
     }
 
-    out << ";" << endl;
+    out << ";" << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -2300,7 +2299,7 @@
  */
 void t_js_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   out << indent() << prefix << " = new " << js_type_namespace(tstruct->get_program())
-      << tstruct->get_name() << "();" << endl << indent() << prefix << ".read(input);" << endl;
+      << tstruct->get_name() << "();" << '\n' << indent() << prefix << ".read(input);" << '\n';
 }
 
 void t_js_generator::generate_deserialize_container(ostream& out, t_type* ttype, string prefix) {
@@ -2311,36 +2310,36 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << prefix << " = {};" << endl;
+    out << indent() << prefix << " = {};" << '\n';
 
-    out << indent() << js_const_type_ << rtmp3 << " = input.readMapBegin();" << endl;
-    out << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << endl;
+    out << indent() << js_const_type_ << rtmp3 << " = input.readMapBegin();" << '\n';
+    out << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << '\n';
 
   } else if (ttype->is_set()) {
 
-    out << indent() << prefix << " = [];" << endl
-        << indent() << js_const_type_ << rtmp3 << " = input.readSetBegin();" << endl
-        << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << endl;
+    out << indent() << prefix << " = [];" << '\n'
+        << indent() << js_const_type_ << rtmp3 << " = input.readSetBegin();" << '\n'
+        << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << '\n';
 
   } else if (ttype->is_list()) {
 
-    out << indent() << prefix << " = [];" << endl
-        << indent() << js_const_type_ << rtmp3 << " = input.readListBegin();" << endl
-        << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << endl;
+    out << indent() << prefix << " = [];" << '\n'
+        << indent() << js_const_type_ << rtmp3 << " = input.readListBegin();" << '\n'
+        << indent() << js_const_type_ << size << " = " << rtmp3 << ".size || 0;" << '\n';
   }
 
   // For loop iterates over elements
   string i = tmp("_i");
-  indent(out) << "for (" << js_let_type_ << i << " = 0; " << i << " < " << size << "; ++" << i << ") {" << endl;
+  indent(out) << "for (" << js_let_type_ << i << " = 0; " << i << " < " << size << "; ++" << i << ") {" << '\n';
 
   indent_up();
 
   if (ttype->is_map()) {
     if (!gen_node_) {
-      out << indent() << "if (" << i << " > 0 ) {" << endl << indent()
-          << "  if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {" << endl
-          << indent() << "    input.rstack.pop();" << endl << indent() << "  }" << endl << indent()
-          << "}" << endl;
+      out << indent() << "if (" << i << " > 0 ) {" << '\n' << indent()
+          << "  if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {" << '\n'
+          << indent() << "    input.rstack.pop();" << '\n' << indent() << "  }" << '\n' << indent()
+          << "}" << '\n';
     }
 
     generate_deserialize_map_element(out, (t_map*)ttype, prefix);
@@ -2354,11 +2353,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "input.readMapEnd();" << endl;
+    indent(out) << "input.readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "input.readSetEnd();" << endl;
+    indent(out) << "input.readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "input.readListEnd();" << endl;
+    indent(out) << "input.readListEnd();" << '\n';
   }
 }
 
@@ -2371,24 +2370,24 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey, false, false) << ";" << endl;
-  indent(out) << declare_field(&fval, false, false) << ";" << endl;
+  indent(out) << declare_field(&fkey, false, false) << ";" << '\n';
+  indent(out) << declare_field(&fval, false, false) << ";" << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << prefix << "[" << key << "] = " << val << ";" << endl;
+  indent(out) << prefix << "[" << key << "] = " << val << ";" << '\n';
 }
 
 void t_js_generator::generate_deserialize_set_element(ostream& out, t_set* tset, string prefix) {
   string elem = tmp("elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << js_let_type_ << elem << " = null;" << endl;
+  indent(out) << js_let_type_ << elem << " = null;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".push(" << elem << ");" << endl;
+  indent(out) << prefix << ".push(" << elem << ");" << '\n';
 }
 
 void t_js_generator::generate_deserialize_list_element(ostream& out,
@@ -2397,11 +2396,11 @@
   string elem = tmp("elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << js_let_type_ << elem << " = null;" << endl;
+  indent(out) << js_let_type_ << elem << " = null;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".push(" << elem << ");" << endl;
+  indent(out) << prefix << ".push(" << elem << ");" << '\n';
 }
 
 /**
@@ -2465,7 +2464,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(" << name << ")";
     }
-    out << ";" << endl;
+    out << ";" << '\n';
 
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
@@ -2483,7 +2482,7 @@
  */
 void t_js_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << prefix << ".write(output);" << endl;
+  indent(out) << prefix << ".write(output);" << '\n';
 }
 
 /**
@@ -2493,58 +2492,58 @@
   if (ttype->is_map()) {
     indent(out) << "output.writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                 << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "Thrift.objectLength(" << prefix << "));" << endl;
+                << "Thrift.objectLength(" << prefix << "));" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "output.writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << prefix << ".length);" << endl;
+                << prefix << ".length);" << '\n';
 
   } else if (ttype->is_list()) {
 
     indent(out) << "output.writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                << ", " << prefix << ".length);" << endl;
+                << ", " << prefix << ".length);" << '\n';
   }
 
   if (ttype->is_map()) {
     string kiter = tmp("kiter");
     string viter = tmp("viter");
-    indent(out) << "for (" << js_let_type_ << kiter << " in " << prefix << ") {" << endl;
+    indent(out) << "for (" << js_let_type_ << kiter << " in " << prefix << ") {" << '\n';
     indent_up();
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << kiter << ")) {" << endl;
+    indent(out) << "if (" << prefix << ".hasOwnProperty(" << kiter << ")) {" << '\n';
     indent_up();
-    indent(out) << js_let_type_ << viter << " = " << prefix << "[" << kiter << "];" << endl;
+    indent(out) << js_let_type_ << viter << " = " << prefix << "[" << kiter << "];" << '\n';
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
     scope_down(out);
     scope_down(out);
 
   } else if (ttype->is_set()) {
     string iter = tmp("iter");
-    indent(out) << "for (" << js_let_type_ << iter << " in " << prefix << ") {" << endl;
+    indent(out) << "for (" << js_let_type_ << iter << " in " << prefix << ") {" << '\n';
     indent_up();
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << ")) {" << endl;
+    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << ")) {" << '\n';
     indent_up();
-    indent(out) << iter << " = " << prefix << "[" << iter << "];" << endl;
+    indent(out) << iter << " = " << prefix << "[" << iter << "];" << '\n';
     generate_serialize_set_element(out, (t_set*)ttype, iter);
     scope_down(out);
     scope_down(out);
 
   } else if (ttype->is_list()) {
     string iter = tmp("iter");
-    indent(out) << "for (" << js_let_type_ << iter << " in " << prefix << ") {" << endl;
+    indent(out) << "for (" << js_let_type_ << iter << " in " << prefix << ") {" << '\n';
     indent_up();
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << ")) {" << endl;
+    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << ")) {" << '\n';
     indent_up();
-    indent(out) << iter << " = " << prefix << "[" << iter << "];" << endl;
+    indent(out) << iter << " = " << prefix << "[" << iter << "];" << '\n';
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     scope_down(out);
     scope_down(out);
   }
 
   if (ttype->is_map()) {
-    indent(out) << "output.writeMapEnd();" << endl;
+    indent(out) << "output.writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "output.writeSetEnd();" << endl;
+    indent(out) << "output.writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "output.writeListEnd();" << endl;
+    indent(out) << "output.writeListEnd();" << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_json_generator.cc b/compiler/cpp/src/thrift/generate/t_json_generator.cc
index e91d65a..3fb973a 100644
--- a/compiler/cpp/src/thrift/generate/t_json_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_json_generator.cc
@@ -42,8 +42,6 @@
 using std::vector;
 using std::stack;
 
-static const string endl = "\n";
-static const string quot = "\"";
 static const bool NO_INDENT = false;
 static const bool FORCE_STRING = true;
 
@@ -182,20 +180,20 @@
 }
 
 void t_json_generator::start_object(bool should_indent) {
-  f_json_ << (should_indent ? indent() : "") << "{" << endl;
+  f_json_ << (should_indent ? indent() : "") << "{" << '\n';
   indent_up();
   comma_needed_.push(false);
 }
 
 void t_json_generator::start_array() {
-  f_json_ << "[" << endl;
+  f_json_ << "[" << '\n';
   indent_up();
   comma_needed_.push(false);
 }
 
 void t_json_generator::write_comma_if_needed() {
   if (comma_needed_.top()) {
-    f_json_ << "," << endl;
+    f_json_ << "," << '\n';
   }
 }
 
@@ -230,14 +228,14 @@
 
 void t_json_generator::end_object() {
   indent_down();
-  f_json_ << endl << indent() << "}";
+  f_json_ << '\n' << indent() << "}";
   comma_needed_.pop();
 }
 
 void t_json_generator::end_array() {
   indent_down();
   if (comma_needed_.top()) {
-    f_json_ << endl;
+    f_json_ << '\n';
   }
   indent(f_json_) << "]";
   comma_needed_.pop();
@@ -296,7 +294,7 @@
 }
 
 void t_json_generator::close_generator() {
-  f_json_ << endl;
+  f_json_ << '\n';
   f_json_.close();
 }
 
@@ -471,7 +469,7 @@
 }
 
 void t_json_generator::write_string(const string& value) {
-  f_json_ << quot << escape_json_string(value) << quot;
+  f_json_ << '\"' << escape_json_string(value) << '\"';
 }
 
 void t_json_generator::write_const_value(t_const_value* value, bool should_force_string) {
@@ -537,7 +535,7 @@
 }
 
 string t_json_generator::json_str(const string& str) {
-  return quot + escape_json_string(str) + quot;
+  return string("\"") + escape_json_string(str) + string("\"");
 }
 
 void t_json_generator::generate_constant(t_const* con) {
diff --git a/compiler/cpp/src/thrift/generate/t_kotlin_generator.cc b/compiler/cpp/src/thrift/generate/t_kotlin_generator.cc
index 78917d9..2e81909 100644
--- a/compiler/cpp/src/thrift/generate/t_kotlin_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_kotlin_generator.cc
@@ -45,8 +45,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 static const string KOTLIN_RESERVED_WORDS[] = {
     "as",      "as?",      "break",    "class",   "continue",  "do",          "else",
     "false",   "for",      "fun",      "if",      "in",        "!in",         "interface",
@@ -209,7 +207,7 @@
  * Nothing in Kotlin generator
  */
 void t_kotlin_generator::close_generator() {
-  f_types_ << endl;
+  f_types_ << '\n';
   f_types_.close();
 }
 
@@ -222,7 +220,7 @@
  */
 void t_kotlin_generator::generate_typedef(t_typedef* ttypedef) {
   f_types_ << "typealias " << ttypedef->get_symbolic() << " = "
-           << type_name(ttypedef->get_type(), true) << endl;
+           << type_name(ttypedef->get_type(), true) << '\n';
 }
 
 void t_kotlin_generator::generate_enum(t_enum* tenum) {
@@ -241,32 +239,32 @@
   auto first = true;
   auto enum_values = tenum->get_constants();
   for (auto& enum_value : enum_values) {
-    f_enum << (first ? "" : ",") << endl;
+    f_enum << (first ? "" : ",") << '\n';
     first = false;
     indent(f_enum) << enum_value->get_name() << "(" << enum_value->get_value() << ")";
   }
   if (first) {
     indent(f_enum);
   }
-  f_enum << ";" << endl << endl;
-  indent(f_enum) << "override fun getValue() = value" << endl << endl;
+  f_enum << ";" << '\n' << '\n';
+  indent(f_enum) << "override fun getValue() = value" << '\n' << '\n';
   {
-    indent(f_enum) << "companion object {" << endl;
+    indent(f_enum) << "companion object {" << '\n';
     indent_up();
     {
-      indent(f_enum) << "@kotlin.jvm.JvmStatic" << endl;
+      indent(f_enum) << "@kotlin.jvm.JvmStatic" << '\n';
       indent(f_enum) << "fun findByValue(i: kotlin.Int): " << kotlin_safe_name(tenum->get_name())
-                     << "? {" << endl;
+                     << "? {" << '\n';
       indent_up();
       {
-        indent(f_enum) << "return when (i) {" << endl;
+        indent(f_enum) << "return when (i) {" << '\n';
         indent_up();
         {
           auto enum_values = tenum->get_constants();
           for (auto& enum_value : enum_values) {
-            indent(f_enum) << enum_value->get_value() << " -> " << enum_value->get_name() << endl;
+            indent(f_enum) << enum_value->get_value() << " -> " << enum_value->get_name() << '\n';
           }
-          indent(f_enum) << "else -> null" << endl;
+          indent(f_enum) << "else -> null" << '\n';
         }
         scope_down(f_enum);
       }
@@ -322,7 +320,7 @@
     } else {
       // TODO
     }
-    f_types_ << endl;
+    f_types_ << '\n';
   }
 }
 
@@ -442,7 +440,7 @@
                                                               t_struct* tstruct) {
   indent(out) << "enum class _Fields(private val thriftFieldId: kotlin.Short, private val "
                  "fieldName: kotlin.String) : org.apache.thrift.TFieldIdEnum {"
-              << endl;
+              << '\n';
   indent_up();
   {
     // fields
@@ -450,7 +448,7 @@
       bool first = true;
       for (auto& field : tstruct->get_members()) {
         if (!first) {
-          out << "," << endl;
+          out << "," << '\n';
         }
         first = false;
         indent(out) << constant_name(field->get_name()) << "(" << field->get_key() << ", \""
@@ -459,49 +457,49 @@
       if (first) {
         indent(out);
       }
-      out << ";" << endl << endl;
+      out << ";" << '\n' << '\n';
     }
 
     // methods
-    indent(out) << "override fun getThriftFieldId() = thriftFieldId" << endl << endl;
-    indent(out) << "override fun getFieldName() = fieldName" << endl << endl;
+    indent(out) << "override fun getThriftFieldId() = thriftFieldId" << '\n' << '\n';
+    indent(out) << "override fun getFieldName() = fieldName" << '\n' << '\n';
 
     // companion object
-    indent(out) << "companion object {" << endl;
+    indent(out) << "companion object {" << '\n';
     indent_up();
     {
-      indent(out) << "@kotlin.jvm.JvmStatic" << endl;
-      indent(out) << "fun findByValue(value: kotlin.Int): _Fields? {" << endl;
+      indent(out) << "@kotlin.jvm.JvmStatic" << '\n';
+      indent(out) << "fun findByValue(value: kotlin.Int): _Fields? {" << '\n';
       indent_up();
       {
-        indent(out) << "return when (value) {" << endl;
+        indent(out) << "return when (value) {" << '\n';
         indent_up();
         {
           for (auto& field : tstruct->get_members()) {
-            indent(out) << field->get_key() << " -> " << constant_name(field->get_name()) << endl;
+            indent(out) << field->get_key() << " -> " << constant_name(field->get_name()) << '\n';
           }
-          indent(out) << "else -> null" << endl;
+          indent(out) << "else -> null" << '\n';
         }
         scope_down(out);
       }
       scope_down(out);
     }
 
-    out << endl;
+    out << '\n';
 
     {
-      indent(out) << "@kotlin.jvm.JvmStatic" << endl;
-      indent(out) << "fun findByName(name: kotlin.String): _Fields? {" << endl;
+      indent(out) << "@kotlin.jvm.JvmStatic" << '\n';
+      indent(out) << "fun findByName(name: kotlin.String): _Fields? {" << '\n';
       indent_up();
       {
-        indent(out) << "return when (name) {" << endl;
+        indent(out) << "return when (name) {" << '\n';
         indent_up();
         {
           for (auto& field : tstruct->get_members()) {
             indent(out) << "\"" << field->get_name() << "\""
-                        << " -> " << constant_name(field->get_name()) << endl;
+                        << " -> " << constant_name(field->get_name()) << '\n';
           }
-          indent(out) << "else -> null" << endl;
+          indent(out) << "else -> null" << '\n';
         }
         scope_down(out);
       }
@@ -511,16 +509,16 @@
     scope_down(out);
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_companion_object(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "companion object {" << endl;
+  indent(out) << "companion object {" << '\n';
   indent_up();
   {
     indent(out) << "private val STRUCT_DESC: org.apache.thrift.protocol.TStruct = "
                    "org.apache.thrift.protocol.TStruct(\""
-                << tstruct->get_name() << "\")" << endl;
+                << tstruct->get_name() << "\")" << '\n';
     {
       for (auto& field : tstruct->get_members()) {
         // field desc
@@ -528,15 +526,15 @@
                     << "_FIELD_DESC: org.apache.thrift.protocol.TField = "
                        "org.apache.thrift.protocol.TField(\""
                     << field->get_name() << "\", " << type_to_enum(field->get_type()) << ", "
-                    << field->get_key() << ")" << endl;
+                    << field->get_key() << ")" << '\n';
         // field metadata
         indent(out) << "private val " << constant_name(field->get_name())
                     << "_FIELD_META_DATA: org.apache.thrift.meta_data.FieldMetaData = "
                        "org.apache.thrift.meta_data.FieldMetaData("
-                    << endl;
+                    << '\n';
         indent_up();
         {
-          indent(out) << '"' << field->get_name() << '"' << ',' << endl;
+          indent(out) << '"' << field->get_name() << '"' << ',' << '\n';
           indent(out) << "org.apache.thrift.TFieldRequirementType.";
           if (field->get_req() == t_field::T_REQUIRED) {
             out << "REQUIRED";
@@ -545,12 +543,12 @@
           } else {
             out << "DEFAULT";
           }
-          out << ',' << endl;
+          out << ',' << '\n';
           generate_field_value_meta_data(indent(out), field->get_type());
-          out << ',' << endl;
+          out << ',' << '\n';
           generate_metadata_for_field_annotations(indent(out), field);
         }
-        out << ")" << endl;
+        out << ")" << '\n';
         indent_down();
       }
     }
@@ -558,23 +556,23 @@
     // all fields in a map
     indent(out)
         << "private val metadata: Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> = mapOf("
-        << endl;
+        << '\n';
     indent_up();
     for (auto& field : tstruct->get_members()) {
       indent(out) << "_Fields." << constant_name(field->get_name()) << " to "
-                  << constant_name(field->get_name()) << "_FIELD_META_DATA," << endl;
+                  << constant_name(field->get_name()) << "_FIELD_META_DATA," << '\n';
     }
     indent_down();
-    indent(out) << ")" << endl;
+    indent(out) << ")" << '\n';
 
-    indent(out) << "init {" << endl;
+    indent(out) << "init {" << '\n';
     indent_up();
     indent(out) << "org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap("
-                << tstruct->get_name() << "::class.java, metadata)" << endl;
+                << tstruct->get_name() << "::class.java, metadata)" << '\n';
     scope_down(out);
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_metadata_for_field_annotations(std::ostream& out,
@@ -582,10 +580,10 @@
   if (field->annotations_.size() == 0) {
     out << "emptyMap()";
   } else {
-    out << "mapOf(" << endl;
+    out << "mapOf(" << '\n';
     indent_up();
     for (auto& annotation : field->annotations_) {
-      indent(out) << "\"" + annotation.first + "\" to \"" + annotation.second.back() + "\"," << endl;
+      indent(out) << "\"" + annotation.first + "\" to \"" + annotation.second.back() + "\"," << '\n';
     }
     indent_down();
     indent(out) << ")";
@@ -600,24 +598,24 @@
     out << "StructMetaData(" << ttype_class << "STRUCT, " << type_name(type) << "::class.java";
   } else if (type->is_container()) {
     if (type->is_list()) {
-      out << "ListMetaData(" << ttype_class << "LIST," << endl;
+      out << "ListMetaData(" << ttype_class << "LIST," << '\n';
       indent_up();
       t_type* elem_type = ((t_list*)type)->get_elem_type();
       generate_field_value_meta_data(indent(out), elem_type);
       indent_down();
     } else if (type->is_set()) {
-      out << "SetMetaData(" << ttype_class << "SET," << endl;
+      out << "SetMetaData(" << ttype_class << "SET," << '\n';
       indent_up();
       t_type* elem_type = ((t_set*)type)->get_elem_type();
       generate_field_value_meta_data(indent(out), elem_type);
       indent_down();
     } else {
-      out << "MapMetaData(" << ttype_class << "MAP," << endl;
+      out << "MapMetaData(" << ttype_class << "MAP," << '\n';
       indent_up();
       t_type* key_type = ((t_map*)type)->get_key_type();
       t_type* val_type = ((t_map*)type)->get_val_type();
       generate_field_value_meta_data(indent(out), key_type);
-      out << "," << endl;
+      out << "," << '\n';
       generate_field_value_meta_data(indent(out), val_type);
       indent_down();
     }
@@ -635,30 +633,30 @@
 }
 
 void t_kotlin_generator::generate_struct_method_deep_copy(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "override fun deepCopy(): " << tstruct->get_name() << " {" << endl;
+  indent(out) << "override fun deepCopy(): " << tstruct->get_name() << " {" << '\n';
   indent_up();
   {
-    indent(out) << "return " << tstruct->get_name() << " (" << endl;
+    indent(out) << "return " << tstruct->get_name() << " (" << '\n';
     indent_up();
     {
       for (auto& field : tstruct->get_members()) {
-        indent(out) << kotlin_safe_name(field->get_name()) << "," << endl;
+        indent(out) << kotlin_safe_name(field->get_name()) << "," << '\n';
       }
     }
     indent_down();
-    indent(out) << ")" << endl;
+    indent(out) << ")" << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_compare_to(std::ostream& out, t_struct* tstruct) {
   indent(out) << "override fun compareTo(other: " << tstruct->get_name() << "?): kotlin.Int {"
-              << endl;
+              << '\n';
   indent_up();
   {
     indent(out) << "val comparator = compareBy<" << tstruct->get_name()
-                << "> { it::class.java.name }" << endl;
+                << "> { it::class.java.name }" << '\n';
     indent_up();
     for (auto& field : tstruct->get_members()) {
       indent(out) << ".thenBy";
@@ -667,33 +665,33 @@
           || field_type->is_binary()) {
         out << "(org.apache.thrift.TBaseHelper::compareTo)";
       }
-      out << " { it." << kotlin_safe_name(field->get_name()) << " } " << endl;
+      out << " { it." << kotlin_safe_name(field->get_name()) << " } " << '\n';
     }
     indent_down();
-    indent(out) << "return nullsFirst(comparator).compare(this, other)" << endl;
+    indent(out) << "return nullsFirst(comparator).compare(this, other)" << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_field_for_id(std::ostream& out,
                                                              t_struct* /*tstruct*/) {
-  indent(out) << "override fun fieldForId(fieldId: kotlin.Int): _Fields {" << endl;
+  indent(out) << "override fun fieldForId(fieldId: kotlin.Int): _Fields {" << '\n';
   indent_up();
   {
     indent(out) << "return _Fields.findByValue(fieldId) ?: throw "
                    "kotlin.IllegalArgumentException(\"invalid fieldId $fieldId\")"
-                << endl;
+                << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_is_set(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "override fun isSet(field: _Fields): kotlin.Boolean {" << endl;
+  indent(out) << "override fun isSet(field: _Fields): kotlin.Boolean {" << '\n';
   indent_up();
   {
-    indent(out) << "return when (field) {" << endl;
+    indent(out) << "return when (field) {" << '\n';
     indent_up();
     {
       auto members = tstruct->get_members();
@@ -705,67 +703,67 @@
           } else {
             out << "this." << kotlin_safe_name(field->get_name()) << " != null";
           }
-          out << endl;
+          out << '\n';
         }
       } else {
-        indent(out) << "else -> false" << endl;
+        indent(out) << "else -> false" << '\n';
       }
     }
     scope_down(out);
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_clear(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "override fun clear(): kotlin.Unit {" << endl;
+  indent(out) << "override fun clear(): kotlin.Unit {" << '\n';
   indent_up();
   {
     for (auto& field : tstruct->get_members()) {
       auto is_required = field->get_req() == t_field::T_REQUIRED;
       indent(out) << (is_required ? "_" + field->get_name() : kotlin_safe_name(field->get_name()))
-                  << " = null" << endl;
+                  << " = null" << '\n';
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_validate(std::ostream& out, t_struct* tstruct) {
-  indent(out) << "@kotlin.jvm.Throws(org.apache.thrift.TException::class)" << endl;
-  indent(out) << "fun validate(): kotlin.Unit {" << endl;
+  indent(out) << "@kotlin.jvm.Throws(org.apache.thrift.TException::class)" << '\n';
+  indent(out) << "fun validate(): kotlin.Unit {" << '\n';
   indent_up();
   {
     for (auto& field : tstruct->get_members()) {
       bool is_required = field->get_req() == t_field::T_REQUIRED;
       if (is_required) {
-        indent(out) << "if (_" << field->get_name() << " == null) {" << endl;
+        indent(out) << "if (_" << field->get_name() << " == null) {" << '\n';
         indent_up();
         {
           indent(out) << "throw org.apache.thrift.TException(\"Required field `"
                       << field->get_name()
                       << "' is null, "
                          "struct is: $this\")"
-                      << endl;
+                      << '\n';
         }
         scope_down(out);
       }
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_set_field_value(std::ostream& out,
                                                                 t_struct* tstruct) {
-  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << endl;
+  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << '\n';
   indent(out) << "override fun setFieldValue(field: _Fields, value: kotlin.Any?): kotlin.Unit {"
-              << endl;
+              << '\n';
   indent_up();
   {
     const vector<t_field*>& members = tstruct->get_members();
     if (members.size() > 0) {
-      indent(out) << "when (field) {" << endl;
+      indent(out) << "when (field) {" << '\n';
       indent_up();
       {
         for (auto& field : tstruct->get_members()) {
@@ -773,155 +771,155 @@
           indent(out) << "_Fields." << constant_name(field->get_name()) << " -> this."
                       << (is_required ? "_" + field->get_name()
                                       : kotlin_safe_name(field->get_name()))
-                      << " = value as " << type_name(field->get_type()) << "?" << endl;
+                      << " = value as " << type_name(field->get_type()) << "?" << '\n';
         }
       }
       scope_down(out);
     } else {
-      indent(out) << "return" << endl;
+      indent(out) << "return" << '\n';
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_get_field_value(std::ostream& out,
                                                                 t_struct* tstruct) {
-  indent(out) << "override fun getFieldValue(field: _Fields): kotlin.Any? {" << endl;
+  indent(out) << "override fun getFieldValue(field: _Fields): kotlin.Any? {" << '\n';
   indent_up();
   {
     auto members = tstruct->get_members();
     if (members.size() > 0) {
-      indent(out) << "return when (field) {" << endl;
+      indent(out) << "return when (field) {" << '\n';
       indent_up();
       {
         for (auto& field : tstruct->get_members()) {
           indent(out) << "_Fields." << constant_name(field->get_name()) << " -> this."
-                      << kotlin_safe_name(field->get_name()) << endl;
+                      << kotlin_safe_name(field->get_name()) << '\n';
         }
       }
       scope_down(out);
     } else {
-      indent(out) << "return null" << endl;
+      indent(out) << "return null" << '\n';
     }
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_method_read(std::ostream& out, t_struct* tstruct) {
   indent(out) << "override fun read(iproto: org.apache.thrift.protocol.TProtocol): kotlin.Unit {"
-              << endl;
+              << '\n';
   indent_up();
   {
     indent(out)
         << "require(org.apache.thrift.scheme.StandardScheme::class.java == iproto.scheme) { "
            "\"only standard scheme is "
            "supported for now\" }"
-        << endl;
-    indent(out) << tstruct->get_name() << "StandardScheme.read(iproto, this)" << endl;
+        << '\n';
+    indent(out) << tstruct->get_name() << "StandardScheme.read(iproto, this)" << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 void t_kotlin_generator::generate_struct_method_write(std::ostream& out, t_struct* tstruct) {
   indent(out) << "override fun write(oproto: org.apache.thrift.protocol.TProtocol): kotlin.Unit {"
-              << endl;
+              << '\n';
   indent_up();
   {
     indent(out)
         << "require(org.apache.thrift.scheme.StandardScheme::class.java == oproto.scheme) { "
            "\"only standard scheme is "
            "supported for now\" }"
-        << endl;
-    indent(out) << tstruct->get_name() << "StandardScheme.write(oproto, this)" << endl;
+        << '\n';
+    indent(out) << tstruct->get_name() << "StandardScheme.write(oproto, this)" << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_standard_scheme_read(std::ostream& out,
                                                               t_struct* tstruct) {
   indent(out) << "override fun read(iproto: org.apache.thrift.protocol.TProtocol, struct: "
-              << tstruct->get_name() << ") {" << endl;
+              << tstruct->get_name() << ") {" << '\n';
   indent_up();
   {
-    indent(out) << "iproto.apply {" << endl;
+    indent(out) << "iproto.apply {" << '\n';
     indent_up();
     {
-      indent(out) << "readStruct {" << endl;
+      indent(out) << "readStruct {" << '\n';
       indent_up();
       {
-        indent(out) << "var stopped = false" << endl;
-        indent(out) << "while (!stopped) {" << endl;
+        indent(out) << "var stopped = false" << '\n';
+        indent(out) << "while (!stopped) {" << '\n';
         indent_up();
         {
-          indent(out) << "stopped = readField {" << endl;
+          indent(out) << "stopped = readField {" << '\n';
           indent_up();
           {
             indent(out) << "val skipNext = { "
                            "org.apache.thrift.protocol.TProtocolUtil.skip(iproto, it.type) }"
-                        << endl;
+                        << '\n';
 
-            indent(out) << "when (it.id.toInt()) {" << endl;
+            indent(out) << "when (it.id.toInt()) {" << '\n';
             indent_up();
             {
               for (auto& field : tstruct->get_members()) {
-                indent(out) << field->get_key() << " -> {" << endl;
+                indent(out) << field->get_key() << " -> {" << '\n';
                 indent_up();
                 {
                   indent(out) << "if (it.type == " << type_to_enum(field->get_type()) << ") {"
-                              << endl;
+                              << '\n';
                   indent_up();
                   generate_deserialize_field(out, field, "struct.");
                   indent_down();
-                  indent(out) << "} else {" << endl;
+                  indent(out) << "} else {" << '\n';
                   indent_up();
-                  indent(out) << "skipNext()" << endl;
+                  indent(out) << "skipNext()" << '\n';
                   indent_down();
-                  indent(out) << "}" << endl;
+                  indent(out) << "}" << '\n';
                 }
                 scope_down(out);
               }
-              indent(out) << "else -> skipNext()" << endl;
+              indent(out) << "else -> skipNext()" << '\n';
             }
             scope_down(out);
           }
           scope_down(out);
         }
         scope_down(out);
-        indent(out) << "struct.validate()" << endl;
+        indent(out) << "struct.validate()" << '\n';
       }
       scope_down(out);
     }
     scope_down(out);
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_standard_scheme_write(std::ostream& out,
                                                                t_struct* tstruct) {
   indent(out) << "override fun write(oproto: org.apache.thrift.protocol.TProtocol, struct: "
-              << tstruct->get_name() << ") {" << endl;
+              << tstruct->get_name() << ") {" << '\n';
   indent_up();
   {
-    indent(out) << "struct.validate()" << endl;
-    indent(out) << "oproto.apply {" << endl;
+    indent(out) << "struct.validate()" << '\n';
+    indent(out) << "oproto.apply {" << '\n';
     indent_up();
     {
-      indent(out) << "writeStruct(STRUCT_DESC) {" << endl;
+      indent(out) << "writeStruct(STRUCT_DESC) {" << '\n';
       indent_up();
       {
         for (auto& field : tstruct->get_members()) {
           auto is_required = field->get_req() == t_field::T_REQUIRED;
           indent(out) << "struct." << kotlin_safe_name(field->get_name())
                       << (is_required ? "" : "?") << ".let { "
-                      << kotlin_safe_name(field->get_name()) << " ->" << endl;
+                      << kotlin_safe_name(field->get_name()) << " ->" << '\n';
           indent_up();
           {
             indent(out) << "writeField(" << constant_name(field->get_name()) << "_FIELD_DESC) {"
-                        << endl;
+                        << '\n';
             indent_up();
             generate_serialize_field(out, field);
             scope_down(out);
@@ -929,36 +927,36 @@
           scope_down(out);
         }
       }
-      indent(out) << "writeFieldStop()" << endl;
+      indent(out) << "writeFieldStop()" << '\n';
       scope_down(out);
     }
     scope_down(out);
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_struct_standard_scheme(std::ostream& out, t_struct* tstruct) {
   indent(out) << "private object " << tstruct->get_name()
               << "StandardScheme : org.apache.thrift.scheme.StandardScheme<" << tstruct->get_name()
-              << ">() {" << endl;
+              << ">() {" << '\n';
   indent_up();
   generate_struct_standard_scheme_read(out, tstruct);
   generate_struct_standard_scheme_write(out, tstruct);
   scope_down(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_kotlin_generator::generate_union_tuple_scheme(std::ostream& out, t_struct* /*tunion*/) {
   indent(out) << "override fun tupleSchemeReadValue(iproto: org.apache.thrift.protocol.TProtocol, "
                  "fieldID: kotlin.Short) = throw kotlin.UnsupportedOperationException(\"only "
                  "standard scheme is supported for now\")"
-              << endl;
+              << '\n';
   indent(out)
       << "override fun tupleSchemeWriteValue(oproto: org.apache.thrift.protocol.TProtocol) = "
          "throw kotlin.UnsupportedOperationException(\"only standard scheme is supported for "
          "now\")"
-      << endl;
+      << '\n';
 }
 
 void t_kotlin_generator::generate_union_standard_scheme(std::ostream& out, t_struct* tunion) {
@@ -970,61 +968,61 @@
   indent(out)
       << "override fun standardSchemeReadValue(iproto: org.apache.thrift.protocol.TProtocol, "
          "field: org.apache.thrift.protocol.TField): Any? ="
-      << endl;
+      << '\n';
   indent_up();
-  indent(out) << "when (_Fields.findByValue(field.id.toInt())) {" << endl;
+  indent(out) << "when (_Fields.findByValue(field.id.toInt())) {" << '\n';
   indent_up();
   for (auto& member : tunion->get_members()) {
     auto expect_type = type_name(member->get_type());
-    indent(out) << "_Fields." << constant_name(member->get_name()) << " -> {" << endl;
+    indent(out) << "_Fields." << constant_name(member->get_name()) << " -> {" << '\n';
     indent_up();
     {
       indent(out) << "if (field.type == " << constant_name(member->get_name())
-                  << "_FIELD_DESC.type) {" << endl;
+                  << "_FIELD_DESC.type) {" << '\n';
       indent_up();
-      indent(out) << "iproto.run {" << endl;
+      indent(out) << "iproto.run {" << '\n';
       indent_up();
       indent(out);
       generate_deserialize_value(out, member->get_type());
-      out << endl;
+      out << '\n';
       scope_down(out);
       indent_down();
-      indent(out) << "} else {" << endl;
+      indent(out) << "} else {" << '\n';
       indent_up();
-      indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iproto, field.type)" << endl;
-      indent(out) << "null" << endl;
+      indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iproto, field.type)" << '\n';
+      indent(out) << "null" << '\n';
       scope_down(out);
     }
     scope_down(out);
   }
-  indent(out) << "null -> {" << endl;
+  indent(out) << "null -> {" << '\n';
   indent_up();
-  indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iproto, field.type)" << endl;
-  indent(out) << "null" << endl;
+  indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iproto, field.type)" << '\n';
+  indent(out) << "null" << '\n';
   scope_down(out);
   scope_down(out);
   indent_down();
 }
 
 void t_kotlin_generator::generate_union_standard_scheme_write(std::ostream& out, t_struct* tunion) {
-  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << endl;
+  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << '\n';
   indent(out)
       << "override fun standardSchemeWriteValue(oproto: org.apache.thrift.protocol.TProtocol) {"
-      << endl;
+      << '\n';
   indent_up();
-  indent(out) << "when (setField_) {" << endl;
+  indent(out) << "when (setField_) {" << '\n';
   indent_up();
   for (auto& member : tunion->get_members()) {
-    indent(out) << "_Fields." << constant_name(member->get_name()) << " -> {" << endl;
+    indent(out) << "_Fields." << constant_name(member->get_name()) << " -> {" << '\n';
     indent_up();
     {
-      indent(out) << "val it = value_ as " << type_name(member->get_type()) << endl;
-      indent(out) << "oproto.apply {" << endl;
+      indent(out) << "val it = value_ as " << type_name(member->get_type()) << '\n';
+      indent(out) << "oproto.apply {" << '\n';
       indent_up();
       {
         indent(out);
         generate_serialize_value(out, member->get_type());
-        out << endl;
+        out << '\n';
       }
       scope_down(out);
     }
@@ -1032,7 +1030,7 @@
   }
   indent(out) << "null -> throw kotlin.IllegalStateException(\"Cannot write union with unknown "
                  "field $setField_\")"
-              << endl;
+              << '\n';
   scope_down(out);
   scope_down(out);
 }
@@ -1052,25 +1050,25 @@
   }
 
   auto union_class_name = kotlin_safe_name(tunion->get_name());
-  { indent(out) << "override fun deepCopy() = " << union_class_name << "(this)" << endl; }
-  { indent(out) << "override fun enumForId(id: kotlin.Short) = fieldForId(id.toInt())" << endl; }
-  { indent(out) << "override fun getStructDesc() = STRUCT_DESC" << endl; }
+  { indent(out) << "override fun deepCopy() = " << union_class_name << "(this)" << '\n'; }
+  { indent(out) << "override fun enumForId(id: kotlin.Short) = fieldForId(id.toInt())" << '\n'; }
+  { indent(out) << "override fun getStructDesc() = STRUCT_DESC" << '\n'; }
   {
-    indent(out) << "override fun getFieldDesc(setField: _Fields) = when (setField) {" << endl;
+    indent(out) << "override fun getFieldDesc(setField: _Fields) = when (setField) {" << '\n';
     indent_up();
     for (auto& member : tunion->get_members()) {
       indent(out) << "_Fields." << constant_name(member->get_name()) << " -> "
-                  << constant_name(member->get_name()) << "_FIELD_DESC" << endl;
+                  << constant_name(member->get_name()) << "_FIELD_DESC" << '\n';
     }
     scope_down(out);
   }
 }
 
 void t_kotlin_generator::generate_union_method_check_type(std::ostream& out, t_struct* tunion) {
-  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << endl;
-  indent(out) << "override fun checkType(setField: _Fields, value: kotlin.Any?) {" << endl;
+  indent(out) << "@Suppress(\"UNCHECKED_CAST\")" << '\n';
+  indent(out) << "override fun checkType(setField: _Fields, value: kotlin.Any?) {" << '\n';
   indent_up();
-  indent(out) << "when (setField) {" << endl;
+  indent(out) << "when (setField) {" << '\n';
   indent_up();
   for (auto& member : tunion->get_members()) {
     auto expect_type = type_name(member->get_type());
@@ -1078,7 +1076,7 @@
                 << expect_type
                 << " ?: throw kotlin.ClassCastException(\"Was expecting value of type `"
                 << expect_type << "' for field `" << member->get_name()
-                << "', but got ${value?.javaClass}\")" << endl;
+                << "', but got ${value?.javaClass}\")" << '\n';
   }
   scope_down(out);
   scope_down(out);
@@ -1089,12 +1087,12 @@
                                                    string /*additional interface*/) {
   auto union_class_name = kotlin_safe_name(tunion->get_name());
   indent(out) << "class " << union_class_name << " : org.apache.thrift.TUnion<" << union_class_name
-              << ", " << union_class_name << "._Fields> {" << endl;
+              << ", " << union_class_name << "._Fields> {" << '\n';
   indent_up();
   indent(out) << "constructor(setField: _Fields, value: kotlin.Any) : super(setField, value)"
-              << endl;
-  indent(out) << "constructor(other: " << union_class_name << ") : super(other)" << endl;
-  indent(out) << "constructor() : super()" << endl;
+              << '\n';
+  indent(out) << "constructor(other: " << union_class_name << ") : super(other)" << '\n';
+  indent(out) << "constructor() : super()" << '\n';
 
   generate_struct_field_name_constants(out, tunion);
   generate_struct_companion_object(out, tunion);
@@ -1104,7 +1102,7 @@
   generate_union_standard_scheme(out, tunion);
   generate_union_tuple_scheme(out, tunion);
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_kotlin_generator::generate_struct_definition(std::ostream& out,
@@ -1123,7 +1121,7 @@
   indent_up();
   auto sep = "";
   for (auto field : members) {
-    out << sep << endl;
+    out << sep << '\n';
     sep = ",";
     generate_kdoc_comment(out, field);
     auto is_required = field->get_req() == t_field::T_REQUIRED;
@@ -1141,7 +1139,7 @@
     out << ": " << type_name(field->get_type()) << "? = null";
   }
   indent_down();
-  out << endl;
+  out << '\n';
   indent(out) << ") : ";
   if (is_exception) {
     out << "org.apache.thrift.TException(), ";
@@ -1150,7 +1148,7 @@
     additional_interface = ", " + additional_interface;
   }
   out << "org.apache.thrift.TBase<" << tstruct->get_name() << ", " << tstruct->get_name()
-      << "._Fields>" << additional_interface << " {" << endl;
+      << "._Fields>" << additional_interface << " {" << '\n';
 
   indent_up();
 
@@ -1162,7 +1160,7 @@
         out << "override ";
       }
       out << "val " << kotlin_safe_name(field->get_name()) << ": " << type_name(field->get_type())
-          << " get() = _" + kotlin_safe_name(field->get_name()) << "!!" << endl;
+          << " get() = _" + kotlin_safe_name(field->get_name()) << "!!" << '\n';
     }
   }
 
@@ -1181,7 +1179,7 @@
   generate_struct_method_write(out, tstruct);
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 string t_kotlin_generator::base_type_write_expression(t_base_type* tbase, string it) {
@@ -1286,7 +1284,7 @@
   }
   indent(out);
   generate_serialize_value(out, type, kotlin_safe_name(tfield->get_name()));
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1305,7 +1303,7 @@
       = prefix + (is_required ? "_" + tfield->get_name() : kotlin_safe_name(tfield->get_name()));
   indent(out) << name << " = ";
   generate_deserialize_value(out, type);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1315,33 +1313,33 @@
   if (ttype->is_map()) {
     out << "writeMap(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
         << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << it << ") { (key, value) ->"
-        << endl;
+        << '\n';
     indent_up();
     {
       generate_serialize_value(indent(out), ((t_map*)ttype)->get_key_type(), "key");
-      out << endl;
+      out << '\n';
       generate_serialize_value(indent(out), ((t_map*)ttype)->get_val_type(), "value");
-      out << endl;
+      out << '\n';
       indent_down();
     }
     indent(out) << "}";
   } else if (ttype->is_set()) {
     out << "writeSet(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " << it << ") {"
-        << endl;
+        << '\n';
     indent_up();
     {
       generate_serialize_value(indent(out), ((t_set*)ttype)->get_elem_type());
-      out << endl;
+      out << '\n';
       indent_down();
     }
     indent(out) << "}";
   } else if (ttype->is_list()) {
     out << "writeList(" << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << it << ") {"
-        << endl;
+        << '\n';
     {
       indent_up();
       generate_serialize_value(indent(out), ((t_list*)ttype)->get_elem_type());
-      out << endl;
+      out << '\n';
       indent_down();
     }
     indent(out) << "}";
@@ -1355,41 +1353,41 @@
  */
 void t_kotlin_generator::generate_deserialize_container(ostream& out, t_type* ttype) {
   if (ttype->is_map()) {
-    out << "readMap { tmap ->" << endl;
+    out << "readMap { tmap ->" << '\n';
     indent_up();
-    indent(out) << "kotlin.collections.List(tmap.size) {" << endl;
+    indent(out) << "kotlin.collections.List(tmap.size) {" << '\n';
     indent_up();
     indent(out);
     generate_deserialize_value(out, ((t_map*)ttype)->get_key_type());
     out << " to ";
     generate_deserialize_value(out, ((t_map*)ttype)->get_val_type());
-    out << endl;
+    out << '\n';
     indent_down();
-    indent(out) << "}.associate { it }" << endl;
+    indent(out) << "}.associate { it }" << '\n';
     indent_down();
     indent(out) << "}";
   } else if (ttype->is_set()) {
-    out << "readSet { tset ->" << endl;
+    out << "readSet { tset ->" << '\n';
     indent_up();
-    indent(out) << "kotlin.collections.List(tset.size) {" << endl;
+    indent(out) << "kotlin.collections.List(tset.size) {" << '\n';
     indent_up();
     indent(out);
     generate_deserialize_value(out, ((t_set*)ttype)->get_elem_type());
-    out << endl;
+    out << '\n';
     indent_down();
-    indent(out) << "}.toSet()" << endl;
+    indent(out) << "}.toSet()" << '\n';
     indent_down();
     indent(out) << "}";
   } else if (ttype->is_list()) {
-    out << "readList { tlist ->" << endl;
+    out << "readList { tlist ->" << '\n';
     indent_up();
-    indent(out) << "kotlin.collections.List(tlist.size) {" << endl;
+    indent(out) << "kotlin.collections.List(tlist.size) {" << '\n';
     indent_up();
     indent(out);
     generate_deserialize_value(out, ((t_list*)ttype)->get_elem_type());
-    out << endl;
+    out << '\n';
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
     indent_down();
     indent(out) << "}";
   } else {
@@ -1419,14 +1417,14 @@
   ofstream_with_content_based_conditional_update out;
   out.open(f_service_name.c_str());
   out << autogen_comment() << kotlin_package();
-  out << "interface " << tservice->get_name() << " {" << endl;
+  out << "interface " << tservice->get_name() << " {" << '\n';
   indent_up();
   for (auto tfunc : tservice->get_functions()) {
     generate_kdoc_comment(out, tfunc);
-    indent(out) << function_signature(tfunc) << endl;
+    indent(out) << function_signature(tfunc) << '\n';
   }
   scope_down(out);
-  out << endl << endl;
+  out << '\n' << '\n';
   out.close();
 }
 
@@ -1437,22 +1435,22 @@
   out << autogen_comment() << warning_surpressions() << kotlin_package();
   generate_docstring_comment(out, "/**\n", " * ",
                              "client implementation for [" + tservice->get_name() + "]", " */\n");
-  indent(out) << "class " << tservice->get_name() << "Client(" << endl;
+  indent(out) << "class " << tservice->get_name() << "Client(" << '\n';
   indent_up();
-  indent(out) << "protocolFactory: org.apache.thrift.protocol.TProtocolFactory," << endl;
-  indent(out) << "clientManager: org.apache.thrift.async.TAsyncClientManager," << endl;
-  indent(out) << "transport: org.apache.thrift.transport.TNonblockingTransport" << endl;
+  indent(out) << "protocolFactory: org.apache.thrift.protocol.TProtocolFactory," << '\n';
+  indent(out) << "clientManager: org.apache.thrift.async.TAsyncClientManager," << '\n';
+  indent(out) << "transport: org.apache.thrift.transport.TNonblockingTransport" << '\n';
   indent_down();
   out << "): org.apache.thrift.async.TAsyncClient(protocolFactory, clientManager, transport), "
-      << tservice->get_name() << " {" << endl
-      << endl;
+      << tservice->get_name() << " {" << '\n'
+      << '\n';
 
   indent_up();
   {
-    indent(out) << "private val seqId = java.util.concurrent.atomic.AtomicInteger()" << endl
-                << endl;
+    indent(out) << "private val seqId = java.util.concurrent.atomic.AtomicInteger()" << '\n'
+                << '\n';
     for (auto tfunc : tservice->get_functions()) {
-      indent(out) << "override " << function_signature(tfunc) << " {" << endl;
+      indent(out) << "override " << function_signature(tfunc) << " {" << '\n';
       indent_up();
       {
         string args_name = tservice->get_name() + "FunctionArgs." + tfunc->get_name() + "_args";
@@ -1465,16 +1463,16 @@
           first = false;
           out << tfield->get_name();
         }
-        out << ")" << endl;
-        indent(out) << "return transformCallback {" << endl;
+        out << ")" << '\n';
+        indent(out) << "return transformCallback {" << '\n';
         indent_up();
         {
-          indent(out) << "checkReady()" << endl;
+          indent(out) << "checkReady()" << '\n';
           indent(out)
               << "___currentMethod = ProcessCall." << tfunc->get_name()
               << "Call(args, seqId.getAndIncrement(), this, ___protocolFactory, ___transport, it)"
-              << endl;
-          indent(out) << "___manager.call(___currentMethod)" << endl;
+              << '\n';
+          indent(out) << "___manager.call(___currentMethod)" << '\n';
         }
         scope_down(out);
       }
@@ -1484,22 +1482,22 @@
     indent(out) << "private suspend fun <R> "
                    "org.apache.thrift.async.TAsyncClient.transformCallback(action: "
                    "(org.apache.thrift.async.AsyncMethodCallback<R>) -> Unit): R {"
-                << endl;
+                << '\n';
     indent_up();
-    indent(out) << "val deferred = kotlinx.coroutines.CompletableDeferred<R>()" << endl;
+    indent(out) << "val deferred = kotlinx.coroutines.CompletableDeferred<R>()" << '\n';
     indent(out) << "val callback = object : org.apache.thrift.async.AsyncMethodCallback<R> {"
-                << endl;
+                << '\n';
     indent_up();
-    indent(out) << "override fun onComplete(response: R) { deferred.complete(response) }" << endl;
+    indent(out) << "override fun onComplete(response: R) { deferred.complete(response) }" << '\n';
     indent(out) << "override fun onError(exception: java.lang.Exception) { "
                    "deferred.completeExceptionally(exception) }"
-                << endl;
+                << '\n';
     scope_down(out);
-    indent(out) << "action(callback)" << endl;
-    indent(out) << "return deferred.await()" << endl;
+    indent(out) << "action(callback)" << '\n';
+    indent(out) << "return deferred.await()" << '\n';
     scope_down(out);
 
-    indent(out) << "sealed interface ProcessCall {" << endl;
+    indent(out) << "sealed interface ProcessCall {" << '\n';
     indent_up();
     for (auto tfunc : tservice->get_functions()) {
       generate_client_call(out, tservice, tfunc);
@@ -1507,7 +1505,7 @@
     scope_down(out);
   }
   scope_down(out);
-  out << endl << endl;
+  out << '\n' << '\n';
   out.close();
 }
 
@@ -1518,74 +1516,74 @@
   string funclassname = funname + "Call";
   string rtype = type_name(tfunc->get_returntype(), true);
 
-  indent(out) << "class " + funclassname + "(" << endl;
+  indent(out) << "class " + funclassname + "(" << '\n';
   indent_up();
   string args_name = tservice->get_name() + "FunctionArgs." + tfunc->get_name() + "_args";
-  indent(out) << "val args: " << args_name << "," << endl;
-  indent(out) << "val seqId: kotlin.Int," << endl;
-  indent(out) << "client: org.apache.thrift.async.TAsyncClient," << endl;
-  indent(out) << "protocolFactory: org.apache.thrift.protocol.TProtocolFactory," << endl;
-  indent(out) << "transport: org.apache.thrift.transport.TNonblockingTransport," << endl;
+  indent(out) << "val args: " << args_name << "," << '\n';
+  indent(out) << "val seqId: kotlin.Int," << '\n';
+  indent(out) << "client: org.apache.thrift.async.TAsyncClient," << '\n';
+  indent(out) << "protocolFactory: org.apache.thrift.protocol.TProtocolFactory," << '\n';
+  indent(out) << "transport: org.apache.thrift.transport.TNonblockingTransport," << '\n';
   indent(out) << "resultHandler: org.apache.thrift.async.AsyncMethodCallback<" << rtype << ">,"
-              << endl;
+              << '\n';
   indent_down();
   indent(out) << ") : org.apache.thrift.async.TAsyncMethodCall<" << rtype
               << ">(client, protocolFactory, transport, resultHandler, "
-              << (tfunc->is_oneway() ? "true" : "false") << "), ProcessCall {" << endl;
+              << (tfunc->is_oneway() ? "true" : "false") << "), ProcessCall {" << '\n';
 
   indent_up();
   indent(out) << "override fun write_args(protocol: org.apache.thrift.protocol.TProtocol) {"
-              << endl;
+              << '\n';
   indent_up();
   indent(out) << "val marker = org.apache.thrift.protocol.TMessage(\"" << tfunc->get_name()
-              << "\", org.apache.thrift.protocol.TMessageType.CALL, seqId)" << endl;
-  indent(out) << "protocol.writeMessage(marker) { args.write(protocol) }" << endl;
+              << "\", org.apache.thrift.protocol.TMessageType.CALL, seqId)" << '\n';
+  indent(out) << "protocol.writeMessage(marker) { args.write(protocol) }" << '\n';
   scope_down(out);
 
-  indent(out) << "override fun getResult(): " << rtype << " {" << endl;
+  indent(out) << "override fun getResult(): " << rtype << " {" << '\n';
   indent_up();
   indent(out) << "check(state == org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { "
                  "\"Method call not finished!\" }"
-              << endl;
+              << '\n';
   indent(out) << "val memoryTransport = "
                  "org.apache.thrift.transport.TMemoryInputTransport(frameBuffer.array())"
-              << endl;
-  indent(out) << "val protocol = client.protocolFactory.getProtocol(memoryTransport)" << endl;
+              << '\n';
+  indent(out) << "val protocol = client.protocolFactory.getProtocol(memoryTransport)" << '\n';
 
   if (tfunc->is_oneway()) {
-    indent(out) << "// one way function, nothing to read" << endl;
+    indent(out) << "// one way function, nothing to read" << '\n';
   } else {
-    indent(out) << "return protocol.readMessage {" << endl;
+    indent(out) << "return protocol.readMessage {" << '\n';
     indent_up();
     {
-      indent(out) << "if (it.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) {" << endl;
+      indent(out) << "if (it.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) {" << '\n';
       indent_up();
       indent(out) << "val ex = org.apache.thrift.TApplicationException().apply { read(protocol) }"
-                  << endl;
-      indent(out) << "throw ex" << endl;
+                  << '\n';
+      indent(out) << "throw ex" << '\n';
       scope_down(out);
-      indent(out) << "if (it.seqid != seqId) {" << endl;
+      indent(out) << "if (it.seqid != seqId) {" << '\n';
       indent_up();
-      indent(out) << "throw org.apache.thrift.TApplicationException(" << endl;
+      indent(out) << "throw org.apache.thrift.TApplicationException(" << '\n';
       indent_up();
-      indent(out) << "org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID," << endl;
+      indent(out) << "org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID," << '\n';
       indent(out) << "\"" << funname
                   << " failed: out of sequence response: expected $seqId but got ${it.seqid}\""
-                  << endl;
+                  << '\n';
       indent_down();
-      indent(out) << ")" << endl;
+      indent(out) << ")" << '\n';
       scope_down(out);
       string result_name = tservice->get_name() + "FunctionResult." + tfunc->get_name() + "_result";
-      indent(out) << "val result = " << result_name << "().apply { read(protocol) }" << endl;
+      indent(out) << "val result = " << result_name << "().apply { read(protocol) }" << '\n';
       for (auto xception : tfunc->get_xceptions()->get_members()) {
-        indent(out) << "result." << xception->get_name() << "?.let { throw it }" << endl;
+        indent(out) << "result." << xception->get_name() << "?.let { throw it }" << '\n';
       }
       if (!tfunc->get_returntype()->is_void()) {
         indent(out)
             << "result.success ?: throw "
                "org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException."
                "MISSING_RESULT, \"returnString failed: unknown result\")"
-            << endl;
+            << '\n';
       }
     }
     scope_down(out);
@@ -1601,43 +1599,43 @@
   out << autogen_comment() << warning_surpressions() << kotlin_package();
   auto service_imports = {"import kotlinx.coroutines.future.future"};
   for (auto service_import : service_imports) {
-    out << service_import << endl;
+    out << service_import << '\n';
   }
-  out << endl;
+  out << '\n';
 
   generate_docstring_comment(out, "/**\n", " * ",
                              "server implementation for [" + tservice->get_name() + "]", " */\n");
-  indent(out) << "class " << tservice->get_name() << "Processor(" << endl;
+  indent(out) << "class " << tservice->get_name() << "Processor(" << '\n';
   indent_up();
-  indent(out) << "handler: " << tservice->get_name() << "," << endl;
-  indent(out) << "private val scope: kotlinx.coroutines.CoroutineScope," << endl;
+  indent(out) << "handler: " << tservice->get_name() << "," << '\n';
+  indent(out) << "private val scope: kotlinx.coroutines.CoroutineScope," << '\n';
   indent(out) << "private val processMap: kotlin.collections.Map<kotlin.String, "
                  "org.apache.thrift.AsyncProcessFunction<"
               << tservice->get_name()
               << ", out org.apache.thrift.TBase<*, "
                  "*>, out kotlin.Any, out org.apache.thrift.TBase<*, *>>> = mapOf("
-              << endl;
+              << '\n';
   indent_up();
   {
     for (auto tfunc : tservice->get_functions()) {
       indent(out) << '"' << tfunc->get_name() << '"' << " to ProcessFunction." << tfunc->get_name()
-                  << "(scope)," << endl;
+                  << "(scope)," << '\n';
     }
   }
   indent_down();
-  indent(out) << ")" << endl;
+  indent(out) << ")" << '\n';
   indent_down();
   out << "): org.apache.thrift.TBaseAsyncProcessor<" << tservice->get_name()
-      << ">(handler, processMap) {" << endl;
+      << ">(handler, processMap) {" << '\n';
   indent_up();
-  indent(out) << "companion object {" << endl;
+  indent(out) << "companion object {" << '\n';
   indent_up();
   indent(out) << "internal val logger: org.slf4j.Logger = "
                  "org.slf4j.LoggerFactory.getLogger("
-              << tservice->get_name() << "Processor::class.java)" << endl;
+              << tservice->get_name() << "Processor::class.java)" << '\n';
   scope_down(out);
 
-  indent(out) << "sealed interface ProcessFunction {" << endl;
+  indent(out) << "sealed interface ProcessFunction {" << '\n';
   indent_up();
 
   {
@@ -1647,7 +1645,7 @@
   }
   scope_down(out);
   scope_down(out);
-  out << endl << endl;
+  out << '\n' << '\n';
   out.close();
 }
 
@@ -1663,25 +1661,25 @@
                  "org.apache.thrift.AsyncProcessFunction<I, "
               << args_name << ", " << rtype << ", "
               << (tfunc->is_oneway() ? "org.apache.thrift.TBase<*, *>" : resultname)
-              << ">(\"" << tfunc->get_name() << "\"), ProcessFunction {" 
-              << endl;
+              << ">(\"" << tfunc->get_name() << "\"), ProcessFunction {"
+              << '\n';
   indent_up();
   {
-    indent(out) << "override fun isOneway() = " << (tfunc->is_oneway() ? "true" : "false") << endl;
-    indent(out) << "override fun getEmptyArgsInstance() = " << args_name << "()" << endl;
+    indent(out) << "override fun isOneway() = " << (tfunc->is_oneway() ? "true" : "false") << '\n';
+    indent(out) << "override fun getEmptyArgsInstance() = " << args_name << "()" << '\n';
     indent(out) << "override fun getEmptyResultInstance() = ";
     if (tfunc->is_oneway()) {
-      out << "null" << endl;
+      out << "null" << '\n';
     }
     else {
-      out << resultname << "()" << endl;
+      out << resultname << "()" << '\n';
     }
-    indent(out) << endl;
+    indent(out) << '\n';
     indent(out) << "override fun start(iface: I, args: " << args_name
                 << ", resultHandler: org.apache.thrift.async.AsyncMethodCallback<" << rtype
-                << ">) {" << endl;
+                << ">) {" << '\n';
     indent_up();
-    indent(out) << "scope.future {" << endl;
+    indent(out) << "scope.future {" << '\n';
     indent_up();
     indent(out) << "iface." << tfunc->get_name() << "(";
     {
@@ -1696,18 +1694,18 @@
         out << "args." << tfield->get_name() << "!!";
       }
     }
-    out << ")" << endl;
+    out << ")" << '\n';
     indent_down();
-    indent(out) << "}.whenComplete { r, t ->" << endl;
+    indent(out) << "}.whenComplete { r, t ->" << '\n';
     {
       indent_up();
-      indent(out) << "if (t != null) {" << endl;
+      indent(out) << "if (t != null) {" << '\n';
       indent_up();
-      indent(out) << "resultHandler.onError(t as java.lang.Exception)" << endl;
+      indent(out) << "resultHandler.onError(t as java.lang.Exception)" << '\n';
       indent_down();
-      indent(out) << "} else {" << endl;
+      indent(out) << "} else {" << '\n';
       indent_up();
-      indent(out) << "resultHandler.onComplete(r)" << endl;
+      indent(out) << "resultHandler.onComplete(r)" << '\n';
     }
     scope_down(out);
     scope_down(out);
@@ -1716,106 +1714,106 @@
     indent(out) << "override fun getResultHandler(fb: "
                    "org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer, seqid: "
                    "Int) ="
-                << endl;
+                << '\n';
     indent_up();
     {
       indent(out) << "object : org.apache.thrift.async.AsyncMethodCallback<" << rtype << ">{"
-                  << endl;
+                  << '\n';
       indent_up();
       {
-        indent(out) << "override fun onComplete(response: " << rtype << ") {" << endl;
+        indent(out) << "override fun onComplete(response: " << rtype << ") {" << '\n';
         indent_up();
         if (tfunc->is_oneway()) {
-          indent(out) << "// one way function, no result handling" << endl;
+          indent(out) << "// one way function, no result handling" << '\n';
         } else {
           string result_name
               = tservice->get_name() + "FunctionResult." + tfunc->get_name() + "_result";
-          indent(out) << "val result = " << result_name << "()" << endl;
+          indent(out) << "val result = " << result_name << "()" << '\n';
           if (!tfunc->get_returntype()->is_void()) {
-            indent(out) << "result.success = response" << endl;
+            indent(out) << "result.success = response" << '\n';
           }
-          indent(out) << "try {" << endl;
+          indent(out) << "try {" << '\n';
           indent_up();
           indent(out)
               << "sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid)"
-              << endl;
+              << '\n';
           indent_down();
-          indent(out) << "} catch (e: org.apache.thrift.transport.TTransportException) {" << endl;
+          indent(out) << "} catch (e: org.apache.thrift.transport.TTransportException) {" << '\n';
           indent_up();
           indent(out) << "logger.error(\"TTransportException writing to internal frame buffer\", e)"
-                      << endl;
-          indent(out) << "fb.close()" << endl;
+                      << '\n';
+          indent(out) << "fb.close()" << '\n';
           indent_down();
-          indent(out) << "} catch (e: Exception) {" << endl;
+          indent(out) << "} catch (e: Exception) {" << '\n';
           indent_up();
-          indent(out) << "logger.error(\"Exception writing to internal frame buffer\", e)" << endl;
-          indent(out) << "onError(e)" << endl;
+          indent(out) << "logger.error(\"Exception writing to internal frame buffer\", e)" << '\n';
+          indent(out) << "onError(e)" << '\n';
           scope_down(out);
         }
         scope_down(out);
       }
       {
-        indent(out) << "override fun onError(exception: kotlin.Exception) {" << endl;
+        indent(out) << "override fun onError(exception: kotlin.Exception) {" << '\n';
         indent_up();
         if (tfunc->is_oneway()) {
           indent(out) << "if (exception is org.apache.thrift.transport.TTransportException) {"
-                      << endl;
+                      << '\n';
           indent_up();
-          indent(out) << "logger.error(\"TTransportException inside handler\", exception)" << endl;
-          indent(out) << "fb.close()" << endl;
+          indent(out) << "logger.error(\"TTransportException inside handler\", exception)" << '\n';
+          indent(out) << "fb.close()" << '\n';
           indent_down();
-          indent(out) << "} else {" << endl;
+          indent(out) << "} else {" << '\n';
           indent_up();
-          indent(out) << "logger.error(\"Exception inside oneway handler\", exception)" << endl;
+          indent(out) << "logger.error(\"Exception inside oneway handler\", exception)" << '\n';
           scope_down(out);
         } else {
-          indent(out) << "val (msgType, msg) = when (exception) {" << endl;
+          indent(out) << "val (msgType, msg) = when (exception) {" << '\n';
           indent_up();
 
           auto xceptions = tfunc->get_xceptions()->get_members();
           for (auto xception : xceptions) {
-            indent(out) << "is " << type_name(xception->get_type()) << " -> {" << endl;
+            indent(out) << "is " << type_name(xception->get_type()) << " -> {" << '\n';
             indent_up();
             string result_name
                 = tservice->get_name() + "FunctionResult." + tfunc->get_name() + "_result";
-            indent(out) << "val result = " << result_name << "()" << endl;
-            indent(out) << "result." << xception->get_name() << " = exception" << endl;
-            indent(out) << "org.apache.thrift.protocol.TMessageType.REPLY to result" << endl;
+            indent(out) << "val result = " << result_name << "()" << '\n';
+            indent(out) << "result." << xception->get_name() << " = exception" << '\n';
+            indent(out) << "org.apache.thrift.protocol.TMessageType.REPLY to result" << '\n';
             scope_down(out);
           }
 
-          indent(out) << "is org.apache.thrift.transport.TTransportException -> {" << endl;
+          indent(out) << "is org.apache.thrift.transport.TTransportException -> {" << '\n';
           indent_up();
-          indent(out) << "logger.error(\"TTransportException inside handler\", exception)" << endl;
-          indent(out) << "fb.close()" << endl;
-          indent(out) << "return" << endl;
+          indent(out) << "logger.error(\"TTransportException inside handler\", exception)" << '\n';
+          indent(out) << "fb.close()" << '\n';
+          indent(out) << "return" << '\n';
           scope_down(out);
 
-          indent(out) << "is org.apache.thrift.TApplicationException -> {" << endl;
+          indent(out) << "is org.apache.thrift.TApplicationException -> {" << '\n';
           indent_up();
           indent(out) << "logger.error(\"TApplicationException inside handler\", exception)"
-                      << endl;
-          indent(out) << "org.apache.thrift.protocol.TMessageType.EXCEPTION to exception" << endl;
+                      << '\n';
+          indent(out) << "org.apache.thrift.protocol.TMessageType.EXCEPTION to exception" << '\n';
           scope_down(out);
 
-          indent(out) << "else -> {" << endl;
+          indent(out) << "else -> {" << '\n';
           indent_up();
-          indent(out) << "logger.error(\"Exception inside handler\", exception)" << endl;
+          indent(out) << "logger.error(\"Exception inside handler\", exception)" << '\n';
           indent(out) << "org.apache.thrift.protocol.TMessageType.EXCEPTION to "
                          "org.apache.thrift.TApplicationException(org.apache.thrift."
                          "TApplicationException.INTERNAL_ERROR, exception.message)"
-                      << endl;
+                      << '\n';
           scope_down(out);
           scope_down(out);
 
-          indent(out) << "try {" << endl;
+          indent(out) << "try {" << '\n';
           indent_up();
-          indent(out) << "sendResponse(fb, msg, msgType, seqid)" << endl;
+          indent(out) << "sendResponse(fb, msg, msgType, seqid)" << '\n';
           indent_down();
-          indent(out) << "} catch (ex: java.lang.Exception) {" << endl;
+          indent(out) << "} catch (ex: java.lang.Exception) {" << '\n';
           indent_up();
-          indent(out) << "logger.error(\"Exception writing to internal frame buffer\", ex)" << endl;
-          indent(out) << "fb.close()" << endl;
+          indent(out) << "logger.error(\"Exception writing to internal frame buffer\", ex)" << '\n';
+          indent(out) << "fb.close()" << '\n';
           scope_down(out);
         }
 
@@ -1836,7 +1834,7 @@
 
   generate_docstring_comment(out, "/**\n", " * ",
                              "function result for [" + tservice->get_name() + "]", " */\n");
-  indent(out) << "sealed interface " << tservice->get_name() << "FunctionResult {" << endl;
+  indent(out) << "sealed interface " << tservice->get_name() << "FunctionResult {" << '\n';
   indent_up();
   for (auto func : tservice->get_functions()) {
     if (func->is_oneway()) {
@@ -1863,12 +1861,12 @@
   out << autogen_comment() << warning_surpressions() << kotlin_package();
   generate_docstring_comment(out, "/**\n", " * ",
                              "function arguments for [" + tservice->get_name() + "]", " */\n");
-  indent(out) << "sealed interface " << tservice->get_name() << "FunctionArgs {" << endl;
+  indent(out) << "sealed interface " << tservice->get_name() << "FunctionArgs {" << '\n';
   indent_up();
   for (auto func : tservice->get_functions()) {
     t_struct* ts = func->get_arglist();
     generate_struct_definition(out, ts, false, tservice->get_name() + "FunctionArgs");
-    out << endl;
+    out << '\n';
   }
   scope_down(out);
   out.close();
@@ -1972,7 +1970,7 @@
  */
 string t_kotlin_generator::kotlin_package() {
   if (!package_name_.empty()) {
-    return string("package ") + package_name_ + endl + endl;
+    return string("package ") + package_name_ + "\n" + "\n";
   }
   return "";
 }
@@ -1980,8 +1978,7 @@
 string t_kotlin_generator::warning_surpressions() {
   return "@file:Suppress(\"ClassName\", \"PropertyName\", \"RedundantUnitReturnType\", "
          "\"NestedLambdaShadowedImplicitParameter\", "
-         "\"RemoveRedundantQualifierName\")"
-         + endl;
+         "\"RemoveRedundantQualifierName\")\n";
 }
 
 string t_kotlin_generator::constant_name(string name) {
diff --git a/compiler/cpp/src/thrift/generate/t_lua_generator.cc b/compiler/cpp/src/thrift/generate/t_lua_generator.cc
index 0dc7743..642dd9c 100644
--- a/compiler/cpp/src/thrift/generate/t_lua_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_lua_generator.cc
@@ -26,8 +26,6 @@
 using std::vector;
 using std::map;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * LUA code generator.
  *
@@ -190,7 +188,7 @@
   f_consts_ << autogen_comment() << lua_includes();
   f_types_ << autogen_comment() << lua_includes();
   if (gen_requires_) {
-    f_types_ << endl << "require '" << cur_namespace << "constants'";
+    f_types_ << '\n' << "require '" << cur_namespace << "constants'";
   }
 }
 
@@ -207,7 +205,7 @@
   if (ttypedef->get_type()->get_name().empty()) {
     return;
   }
-  f_types_ << endl << endl << indent() << ttypedef->get_symbolic() << " = "
+  f_types_ << '\n' << '\n' << indent() << ttypedef->get_symbolic() << " = "
            << ttypedef->get_type()->get_name();
 }
 
@@ -215,7 +213,7 @@
  * Generates code for an enumerated type (table)
  */
 void t_lua_generator::generate_enum(t_enum* tenum) {
-  f_types_ << endl << endl << tenum->get_name() << " = {" << endl;
+  f_types_ << '\n' << '\n' << tenum->get_name() << " = {" << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
@@ -227,7 +225,7 @@
     if (c_iter != constants.end()) {
       f_types_ << ",";
     }
-    f_types_ << endl;
+    f_types_ << '\n';
   }
   f_types_ << "}";
 }
@@ -240,7 +238,7 @@
   string name = tconst->get_name();
   t_const_value* value = tconst->get_value();
 
-  f_consts_ << endl << endl << name << " = ";
+  f_consts_ << '\n' << '\n' << name << " = ";
   f_consts_ << render_const_value(type, value);
 }
 
@@ -281,7 +279,7 @@
   } else if (type->is_enum()) {
     out << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << type->get_name() << " = {" << endl;
+    out << type->get_name() << " = {" << '\n';
     indent_up();
 
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
@@ -312,7 +310,7 @@
     out << "}";
     indent_down();
   } else if (type->is_map()) {
-    out << type->get_name() << "{" << endl;
+    out << type->get_name() << "{" << '\n';
     indent_up();
 
     t_type* ktype = ((t_map*)type)->get_key_type();
@@ -327,7 +325,7 @@
       if (v_iter != val.end()) {
         out << ",";
       }
-      out << endl;
+      out << '\n';
     }
     indent_down();
     indent(out) << "}";
@@ -338,7 +336,7 @@
     } else {
       etype = ((t_set*)type)->get_elem_type();
     }
-    out << type->get_name() << " = {" << endl;
+    out << type->get_name() << " = {" << '\n';
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end();) {
@@ -351,7 +349,7 @@
       }
       ++v_iter;
       if (v_iter != val.end()) {
-        out << "," << endl;
+        out << "," << '\n';
       }
     }
     out << "}";
@@ -382,15 +380,15 @@
   vector<t_field*>::const_iterator m_iter;
   const vector<t_field*>& members = tstruct->get_members();
 
-  indent(out) << endl << endl << tstruct->get_name();
+  indent(out) << '\n' << '\n' << tstruct->get_name();
   if (is_exception) {
-    out << " = TException:new{" << endl << indent() << "  __type = '" << tstruct->get_name() << "'";
+    out << " = TException:new{" << '\n' << indent() << "  __type = '" << tstruct->get_name() << "'";
     if (members.size() > 0) {
       out << ",";
     }
-    out << endl;
+    out << '\n';
   } else {
-    out << " = __TObject:new{" << endl;
+    out << " = __TObject:new{" << '\n';
   }
   indent_up();
   for (m_iter = members.begin(); m_iter != members.end();) {
@@ -398,12 +396,12 @@
     out << (*m_iter)->get_name();
     ++m_iter;
     if (m_iter != members.end()) {
-      out << "," << endl;
+      out << "," << '\n';
     }
   }
   indent_down();
   indent(out);
-  out << endl << "}";
+  out << '\n' << "}";
 
   generate_lua_struct_reader(out, tstruct);
   generate_lua_struct_writer(out, tstruct);
@@ -417,48 +415,48 @@
   vector<t_field*>::const_iterator f_iter;
 
   // function
-  indent(out) << endl << endl << "function " << tstruct->get_name() << ":read(iprot)" << endl;
+  indent(out) << '\n' << '\n' << "function " << tstruct->get_name() << ":read(iprot)" << '\n';
   indent_up();
 
-  indent(out) << "iprot:readStructBegin()" << endl;
+  indent(out) << "iprot:readStructBegin()" << '\n';
 
   // while: Read in fields
-  indent(out) << "while true do" << endl;
+  indent(out) << "while true do" << '\n';
   indent_up();
 
   // if: Check what to read
-  indent(out) << "local fname, ftype, fid = iprot:readFieldBegin()" << endl;
-  indent(out) << "if ftype == TType.STOP then" << endl;
+  indent(out) << "local fname, ftype, fid = iprot:readFieldBegin()" << '\n';
+  indent(out) << "if ftype == TType.STOP then" << '\n';
   indent_up();
-  indent(out) << "break" << endl;
+  indent(out) << "break" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     indent_down();
-    indent(out) << "elseif fid == " << (*f_iter)->get_key() << " then" << endl;
+    indent(out) << "elseif fid == " << (*f_iter)->get_key() << " then" << '\n';
     indent_up();
-    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << " then" << endl;
+    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << " then" << '\n';
     indent_up();
 
     // Read field contents
     generate_deserialize_field(out, *f_iter, false, "self.");
 
     indent_down();
-    indent(out) << "else" << endl;
-    indent(out) << "  iprot:skip(ftype)" << endl;
-    indent(out) << "end" << endl;
+    indent(out) << "else" << '\n';
+    indent(out) << "  iprot:skip(ftype)" << '\n';
+    indent(out) << "end" << '\n';
   }
 
   // end if
   indent_down();
-  indent(out) << "else" << endl;
-  indent(out) << "  iprot:skip(ftype)" << endl;
-  indent(out) << "end" << endl;
-  indent(out) << "iprot:readFieldEnd()" << endl;
+  indent(out) << "else" << '\n';
+  indent(out) << "  iprot:skip(ftype)" << '\n';
+  indent(out) << "end" << '\n';
+  indent(out) << "iprot:readFieldEnd()" << '\n';
 
   // end while
   indent_down();
-  indent(out) << "end" << endl;
-  indent(out) << "iprot:readStructEnd()" << endl;
+  indent(out) << "end" << '\n';
+  indent(out) << "iprot:readStructEnd()" << '\n';
 
   // end function
   indent_down();
@@ -474,28 +472,28 @@
   vector<t_field*>::const_iterator f_iter;
 
   // function
-  indent(out) << endl << endl << "function " << tstruct->get_name() << ":write(oprot)" << endl;
+  indent(out) << '\n' << '\n' << "function " << tstruct->get_name() << ":write(oprot)" << '\n';
   indent_up();
 
-  indent(out) << "oprot:writeStructBegin('" << tstruct->get_name() << "')" << endl;
+  indent(out) << "oprot:writeStructBegin('" << tstruct->get_name() << "')" << '\n';
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     // To check element of self whether nil or not.
     // avoid the value(false) of BOOL is lost.
-    indent(out) << "if self." << (*f_iter)->get_name() << " ~= nil then" << endl;
+    indent(out) << "if self." << (*f_iter)->get_name() << " ~= nil then" << '\n';
     indent_up();
     indent(out) << "oprot:writeFieldBegin('" << (*f_iter)->get_name() << "', "
                 << type_to_enum((*f_iter)->get_type()) << ", " << (*f_iter)->get_key() << ")"
-                << endl;
+                << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "self.");
 
-    indent(out) << "oprot:writeFieldEnd()" << endl;
+    indent(out) << "oprot:writeFieldEnd()" << '\n';
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
   }
-  indent(out) << "oprot:writeFieldStop()" << endl;
-  indent(out) << "oprot:writeStructEnd()" << endl;
+  indent(out) << "oprot:writeFieldStop()" << '\n';
+  indent(out) << "oprot:writeStructEnd()" << '\n';
 
   // end function
   indent_down();
@@ -518,15 +516,15 @@
   // Headers
   f_service_ << autogen_comment() << lua_includes();
   if (gen_requires_) {
-    f_service_ << endl << "require '" << cur_ns << "ttypes'" << endl;
+    f_service_ << '\n' << "require '" << cur_ns << "ttypes'" << '\n';
 
     if (tservice->get_extends() != nullptr) {
       f_service_ << "require '" << get_namespace(tservice->get_extends()->get_program())
-                 << tservice->get_extends()->get_name() << "'" << endl;
+                 << tservice->get_extends()->get_name() << "'" << '\n';
     }
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   generate_service_client(f_service_, tservice);
   generate_service_interface(f_service_, tservice);
@@ -544,11 +542,11 @@
   // Interface object definition
   out << classname << " = ";
   if (extends_s) {
-    out << extends_s->get_name() << "Iface:new{" << endl;
+    out << extends_s->get_name() << "Iface:new{" << '\n';
   } else {
-    out << "__TObject:new{" << endl;
+    out << "__TObject:new{" << '\n';
   }
-  out << "  __type = '" << classname << "'" << endl << "}" << endl << endl;
+  out << "  __type = '" << classname << "'" << '\n' << "}" << '\n' << '\n';
 }
 
 void t_lua_generator::generate_service_client(ostream& out, t_service* tservice) {
@@ -562,7 +560,7 @@
   } else {
     out << "__TClient";
   }
-  out << ", {" << endl << "  __type = '" << classname << "'" << endl << "})" << endl;
+  out << ", {" << '\n' << "  __type = '" << classname << "'" << '\n' << "})" << '\n';
 
   // Send/Recv functions
   vector<t_function*> functions = tservice->get_functions();
@@ -572,28 +570,28 @@
     string funcname = (*f_iter)->get_name();
 
     // Wrapper function
-    indent(out) << endl << "function " << classname << ":" << sig << endl;
+    indent(out) << '\n' << "function " << classname << ":" << sig << '\n';
     indent_up();
 
-    indent(out) << "self:send_" << sig << endl << indent();
+    indent(out) << "self:send_" << sig << '\n' << indent();
     if (!(*f_iter)->is_oneway()) {
       if (!(*f_iter)->get_returntype()->is_void()) {
         out << "return ";
       }
-      out << "self:recv_" << sig << endl;
+      out << "self:recv_" << sig << '\n';
     }
 
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
 
     // Send function
-    indent(out) << endl << "function " << classname << ":send_" << sig << endl;
+    indent(out) << '\n' << "function " << classname << ":send_" << sig << '\n';
     indent_up();
 
     indent(out) << "self.oprot:writeMessageBegin('" << funcname << "', "
                 << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-                << ", self._seqid)" << endl;
-    indent(out) << "local args = " << funcname << "_args:new{}" << endl;
+                << ", self._seqid)" << '\n';
+    indent(out) << "local args = " << funcname << "_args:new{}" << '\n';
 
     // Set the args
     const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
@@ -603,60 +601,60 @@
       if ((*fld_iter)->get_value() != nullptr) {
         // Insert default value for nil arguments
         t_type* type = get_true_type((*fld_iter)->get_type());
-        indent(out) << "if " << argname << " ~= nil then" << endl;
+        indent(out) << "if " << argname << " ~= nil then" << '\n';
         indent_up();
-        indent(out) << "args." << argname << " = " << argname << endl;
+        indent(out) << "args." << argname << " = " << argname << '\n';
         indent_down();
-        indent(out) << "else" << endl;
+        indent(out) << "else" << '\n';
         indent_up();
-        indent(out) << "args." << argname << " = " << render_const_value(type, (*fld_iter)->get_value()) << endl;
+        indent(out) << "args." << argname << " = " << render_const_value(type, (*fld_iter)->get_value()) << '\n';
         indent_down();
-        indent(out) << "end" << endl;
+        indent(out) << "end" << '\n';
       } else {
-        indent(out) << "args." << argname << " = " << argname << endl;
+        indent(out) << "args." << argname << " = " << argname << '\n';
       }
     }
 
-    indent(out) << "args:write(self.oprot)" << endl;
-    indent(out) << "self.oprot:writeMessageEnd()" << endl;
-    indent(out) << "self.oprot.trans:flush()" << endl;
+    indent(out) << "args:write(self.oprot)" << '\n';
+    indent(out) << "self.oprot:writeMessageEnd()" << '\n';
+    indent(out) << "self.oprot.trans:flush()" << '\n';
 
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
 
     // Recv function
     if (!(*f_iter)->is_oneway()) {
-      indent(out) << endl << "function " << classname << ":recv_" << sig << endl;
+      indent(out) << '\n' << "function " << classname << ":recv_" << sig << '\n';
       indent_up();
 
       out << indent() << "local fname, mtype, rseqid = self.iprot:"
-          << "readMessageBegin()" << endl << indent() << "if mtype == TMessageType.EXCEPTION then"
-          << endl << indent() << "  local x = TApplicationException:new{}" << endl << indent()
-          << "  x:read(self.iprot)" << endl << indent() << "  self.iprot:readMessageEnd()" << endl
-          << indent() << "  error(x)" << endl << indent() << "end" << endl << indent()
-          << "local result = " << funcname << "_result:new{}" << endl << indent()
-          << "result:read(self.iprot)" << endl << indent() << "self.iprot:readMessageEnd()" << endl;
+          << "readMessageBegin()" << '\n' << indent() << "if mtype == TMessageType.EXCEPTION then"
+          << '\n' << indent() << "  local x = TApplicationException:new{}" << '\n' << indent()
+          << "  x:read(self.iprot)" << '\n' << indent() << "  self.iprot:readMessageEnd()" << '\n'
+          << indent() << "  error(x)" << '\n' << indent() << "end" << '\n' << indent()
+          << "local result = " << funcname << "_result:new{}" << '\n' << indent()
+          << "result:read(self.iprot)" << '\n' << indent() << "self.iprot:readMessageEnd()" << '\n';
 
       // Return the result if it's not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        out << indent() << "if result.success ~= nil then" << endl << indent() << "  return result.success"
-            << endl;
+        out << indent() << "if result.success ~= nil then" << '\n' << indent() << "  return result.success"
+            << '\n';
 
         // Throw custom exceptions
         const std::vector<t_field*>& xf = (*f_iter)->get_xceptions()->get_members();
         vector<t_field*>::const_iterator x_iter;
         for (x_iter = xf.begin(); x_iter != xf.end(); ++x_iter) {
-          out << indent() << "elseif result." << (*x_iter)->get_name() << " then" << endl
-              << indent() << "  error(result." << (*x_iter)->get_name() << ")" << endl;
+          out << indent() << "elseif result." << (*x_iter)->get_name() << " then" << '\n'
+              << indent() << "  error(result." << (*x_iter)->get_name() << ")" << '\n';
         }
 
-        out << indent() << "end" << endl << indent()
+        out << indent() << "end" << '\n' << indent()
             << "error(TApplicationException:new{errorCode = "
-            << "TApplicationException.MISSING_RESULT})" << endl;
+            << "TApplicationException.MISSING_RESULT})" << '\n';
       }
 
       indent_down();
-      indent(out) << "end" << endl;
+      indent(out) << "end" << '\n';
     }
   }
 }
@@ -666,40 +664,40 @@
   t_service* extends_s = tservice->get_extends();
 
   // Define processor table
-  out << endl << classname << " = __TObject.new(";
+  out << '\n' << classname << " = __TObject.new(";
   if (extends_s != nullptr) {
-    out << extends_s->get_name() << "Processor" << endl;
+    out << extends_s->get_name() << "Processor" << '\n';
   } else {
-    out << "__TProcessor" << endl;
+    out << "__TProcessor" << '\n';
   }
-  out << ", {" << endl << " __type = '" << classname << "'" << endl << "})" << endl;
+  out << ", {" << '\n' << " __type = '" << classname << "'" << '\n' << "})" << '\n';
 
   // Process function
-  indent(out) << endl << "function " << classname << ":process(iprot, oprot, server_ctx)" << endl;
+  indent(out) << '\n' << "function " << classname << ":process(iprot, oprot, server_ctx)" << '\n';
   indent_up();
 
-  indent(out) << "local name, mtype, seqid = iprot:readMessageBegin()" << endl;
-  indent(out) << "local func_name = 'process_' .. name" << endl;
-  indent(out) << "if not self[func_name] or ttype(self[func_name]) ~= 'function' then" << endl;
+  indent(out) << "local name, mtype, seqid = iprot:readMessageBegin()" << '\n';
+  indent(out) << "local func_name = 'process_' .. name" << '\n';
+  indent(out) << "if not self[func_name] or ttype(self[func_name]) ~= 'function' then" << '\n';
   indent_up();
   indent(out) << "if oprot ~= nil then";
   indent_up();
-  out << endl << indent() << "iprot:skip(TType.STRUCT)" << endl << indent()
-      << "iprot:readMessageEnd()" << endl << indent() << "x = TApplicationException:new{" << endl
-      << indent() << "  errorCode = TApplicationException.UNKNOWN_METHOD" << endl << indent() << "}"
-      << endl << indent() << "oprot:writeMessageBegin(name, TMessageType.EXCEPTION, "
-      << "seqid)" << endl << indent() << "x:write(oprot)" << endl << indent()
-      << "oprot:writeMessageEnd()" << endl << indent() << "oprot.trans:flush()" << endl;
+  out << '\n' << indent() << "iprot:skip(TType.STRUCT)" << '\n' << indent()
+      << "iprot:readMessageEnd()" << '\n' << indent() << "x = TApplicationException:new{" << '\n'
+      << indent() << "  errorCode = TApplicationException.UNKNOWN_METHOD" << '\n' << indent() << "}"
+      << '\n' << indent() << "oprot:writeMessageBegin(name, TMessageType.EXCEPTION, "
+      << "seqid)" << '\n' << indent() << "x:write(oprot)" << '\n' << indent()
+      << "oprot:writeMessageEnd()" << '\n' << indent() << "oprot.trans:flush()" << '\n';
   indent_down();
-  out << indent() << "end" << endl << indent()
-      << "return false, 'Unknown function '..name" << endl;
+  out << indent() << "end" << '\n' << indent()
+      << "return false, 'Unknown function '..name" << '\n';
   indent_down();
-  indent(out) << "else" << endl << indent()
-              << "  return self[func_name](self, seqid, iprot, oprot, server_ctx)" << endl << indent()
-              << "end" << endl;
+  indent(out) << "else" << '\n' << indent()
+              << "  return self[func_name](self, seqid, iprot, oprot, server_ctx)" << '\n' << indent()
+              << "end" << '\n';
 
   indent_down();
-  indent(out) << "end" << endl;
+  indent(out) << "end" << '\n';
 
   // Generate the process subfunctions
   vector<t_function*> functions = tservice->get_functions();
@@ -717,18 +715,18 @@
   string resultname = tfunction->get_name() + "_result";
   string fn_name = tfunction->get_name();
 
-  indent(out) << endl << "function " << classname << ":process_" << fn_name
-              << "(seqid, iprot, oprot, server_ctx)" << endl;
+  indent(out) << '\n' << "function " << classname << ":process_" << fn_name
+              << "(seqid, iprot, oprot, server_ctx)" << '\n';
   indent_up();
 
   // Read the request
-  out << indent() << "local args = " << argsname << ":new{}" << endl << indent()
-      << "local reply_type = TMessageType.REPLY" << endl << indent() << "args:read(iprot)" << endl
-      << indent() << "iprot:readMessageEnd()" << endl;
+  out << indent() << "local args = " << argsname << ":new{}" << '\n' << indent()
+      << "local reply_type = TMessageType.REPLY" << '\n' << indent() << "args:read(iprot)" << '\n'
+      << indent() << "iprot:readMessageEnd()" << '\n';
 
   if (!tfunction->is_oneway()) {
       out << indent() << "local result = " << resultname
-          << ":new{}" << endl;
+          << ":new{}" << '\n';
   }
 
   out <<  indent() << "local status, res = pcall(self.handler." << fn_name
@@ -738,13 +736,13 @@
   if (args->get_members().size() > 0) {
     out << ", " << argument_list(args, "args.");
   }
-  out << ")" << endl;
+  out << ")" << '\n';
 
   if (!tfunction->is_oneway()) {
       // Check for errors
-      out << indent() << "if not status then" << endl << indent()
-          << "  reply_type = TMessageType.EXCEPTION" << endl << indent()
-          << "  result = TApplicationException:new{message = res}" << endl;
+      out << indent() << "if not status then" << '\n' << indent()
+          << "  reply_type = TMessageType.EXCEPTION" << '\n' << indent()
+          << "  result = TApplicationException:new{message = res}" << '\n';
 
       // Handle custom exceptions
       const std::vector<t_field*>& xf = tfunction->get_xceptions()->get_members();
@@ -752,19 +750,19 @@
           vector<t_field*>::const_iterator x_iter;
           for (x_iter = xf.begin(); x_iter != xf.end(); ++x_iter) {
               out << indent() << "elseif ttype(res) == '" << (*x_iter)->get_type()->get_name() << "' then"
-                  << endl << indent() << "  result." << (*x_iter)->get_name() << " = res" << endl;
+                  << '\n' << indent() << "  result." << (*x_iter)->get_name() << " = res" << '\n';
           }
       }
 
       // Set the result and write the reply
-      out << indent() << "else" << endl << indent() << "  result.success = res" << endl << indent()
-          << "end" << endl << indent() << "oprot:writeMessageBegin('" << fn_name << "', reply_type, "
-          << "seqid)" << endl << indent() << "result:write(oprot)" << endl << indent()
-          << "oprot:writeMessageEnd()" << endl << indent() << "oprot.trans:flush()" << endl;
+      out << indent() << "else" << '\n' << indent() << "  result.success = res" << '\n' << indent()
+          << "end" << '\n' << indent() << "oprot:writeMessageBegin('" << fn_name << "', reply_type, "
+          << "seqid)" << '\n' << indent() << "result:write(oprot)" << '\n' << indent()
+          << "oprot:writeMessageEnd()" << '\n' << indent() << "oprot.trans:flush()" << '\n';
   }
-  out << indent() << "return status, res" << endl;
+  out << indent() << "return status, res" << '\n';
   indent_down();
-  indent(out) << "end" << endl;
+  indent(out) << "end" << '\n';
 }
 
 // Service helpers
@@ -772,7 +770,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  out << endl << "-- HELPER FUNCTIONS AND STRUCTURES";
+  out << '\n' << "-- HELPER FUNCTIONS AND STRUCTURES";
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
     generate_lua_struct_definition(out, ts, false);
@@ -853,7 +851,7 @@
     } else if (type->is_enum()) {
       out << "readI32()";
     }
-    out << endl;
+    out << '\n';
 
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
@@ -867,7 +865,7 @@
                                                   bool local,
                                                   string prefix) {
   indent(out) << (local ? "local " : "") << prefix << " = " << tstruct->get_name() << ":new{}"
-              << endl << indent() << prefix << ":read(iprot)" << endl;
+              << '\n' << indent() << prefix << ":read(iprot)" << '\n';
 }
 
 void t_lua_generator::generate_deserialize_container(ostream& out,
@@ -885,18 +883,18 @@
   t_field fetype(g_type_i8, etype);
 
   // Declare variables, read header
-  indent(out) << (local ? "local " : "") << prefix << " = {}" << endl;
+  indent(out) << (local ? "local " : "") << prefix << " = {}" << '\n';
   if (ttype->is_map()) {
     indent(out) << "local " << ktype << ", " << vtype << ", " << size << " = iprot:readMapBegin() "
-                << endl;
+                << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "local " << etype << ", " << size << " = iprot:readSetBegin()" << endl;
+    indent(out) << "local " << etype << ", " << size << " = iprot:readSetBegin()" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "local " << etype << ", " << size << " = iprot:readListBegin()" << endl;
+    indent(out) << "local " << etype << ", " << size << " = iprot:readListBegin()" << '\n';
   }
 
   // Deserialize
-  indent(out) << "for _i=1," << size << " do" << endl;
+  indent(out) << "for _i=1," << size << " do" << '\n';
   indent_up();
 
   if (ttype->is_map()) {
@@ -908,15 +906,15 @@
   }
 
   indent_down();
-  indent(out) << "end" << endl;
+  indent(out) << "end" << '\n';
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "iprot:readMapEnd()" << endl;
+    indent(out) << "iprot:readMapEnd()" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "iprot:readSetEnd()" << endl;
+    indent(out) << "iprot:readSetEnd()" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "iprot:readListEnd()" << endl;
+    indent(out) << "iprot:readListEnd()" << '\n';
   }
 }
 
@@ -930,7 +928,7 @@
   generate_deserialize_field(out, &fkey, true);
   generate_deserialize_field(out, &fval, true);
 
-  indent(out) << prefix << "[" << key << "] = " << val << endl;
+  indent(out) << prefix << "[" << key << "] = " << val << '\n';
 }
 
 void t_lua_generator::generate_deserialize_set_element(ostream& out, t_set* tset, string prefix) {
@@ -940,7 +938,7 @@
 
   generate_deserialize_field(out, &felem, true);
 
-  indent(out) << prefix << "[" << elem << "] = " << elem << endl;
+  indent(out) << prefix << "[" << elem << "] = " << elem << '\n';
 }
 
 void t_lua_generator::generate_deserialize_list_element(ostream& out,
@@ -953,7 +951,7 @@
 
   generate_deserialize_field(out, &felem, true);
 
-  indent(out) << "table.insert(" << prefix << ", " << elem << ")" << endl;
+  indent(out) << "table.insert(" << prefix << ", " << elem << ")" << '\n';
 }
 
 /**
@@ -1008,7 +1006,7 @@
     } else if (type->is_enum()) {
       out << "writeI32(" << name << ")";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
            name.c_str(),
@@ -1018,7 +1016,7 @@
 
 void t_lua_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << prefix << ":write(oprot)" << endl;
+  indent(out) << prefix << ":write(oprot)" << '\n';
 }
 
 void t_lua_generator::generate_serialize_container(ostream& out, t_type* ttype, string prefix) {
@@ -1026,48 +1024,48 @@
   if (ttype->is_map()) {
     indent(out) << "oprot:writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                 << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "ttable_size(" << prefix << "))" << endl;
+                << "ttable_size(" << prefix << "))" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot:writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "ttable_size(" << prefix << "))" << endl;
+                << "ttable_size(" << prefix << "))" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot:writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
                 << ", "
-                << "#" << prefix << ")" << endl;
+                << "#" << prefix << ")" << '\n';
   }
 
   // Serialize
   if (ttype->is_map()) {
     string kiter = tmp("kiter");
     string viter = tmp("viter");
-    indent(out) << "for " << kiter << "," << viter << " in pairs(" << prefix << ") do" << endl;
+    indent(out) << "for " << kiter << "," << viter << " in pairs(" << prefix << ") do" << '\n';
     indent_up();
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
   } else if (ttype->is_set()) {
     string iter = tmp("iter");
-    indent(out) << "for " << iter << ",_ in pairs(" << prefix << ") do" << endl;
+    indent(out) << "for " << iter << ",_ in pairs(" << prefix << ") do" << '\n';
     indent_up();
     generate_serialize_set_element(out, (t_set*)ttype, iter);
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
   } else if (ttype->is_list()) {
     string iter = tmp("iter");
-    indent(out) << "for _," << iter << " in ipairs(" << prefix << ") do" << endl;
+    indent(out) << "for _," << iter << " in ipairs(" << prefix << ") do" << '\n';
     indent_up();
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     indent_down();
-    indent(out) << "end" << endl;
+    indent(out) << "end" << '\n';
   }
 
   // Finish writing
   if (ttype->is_map()) {
-    indent(out) << "oprot:writeMapEnd()" << endl;
+    indent(out) << "oprot:writeMapEnd()" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "oprot:writeSetEnd()" << endl;
+    indent(out) << "oprot:writeSetEnd()" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "oprot:writeListEnd()" << endl;
+    indent(out) << "oprot:writeListEnd()" << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_markdown_generator.cc b/compiler/cpp/src/thrift/generate/t_markdown_generator.cc
index 76fe98b..fbcaccc 100644
--- a/compiler/cpp/src/thrift/generate/t_markdown_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_markdown_generator.cc
@@ -38,9 +38,6 @@
 using std::stringstream;
 using std::vector;
 
-static const char endl = '\n'; // avoid ostream << std::endl flushes
-
-
 /**
  * MARKDOWN code generator
  *
@@ -55,7 +52,7 @@
                        const std::map<std::string, std::string>& parsed_options,
                        const std::string& option_string)
     : t_generator(program) {
-      
+
     (void)option_string;
     std::map<std::string, std::string>::const_iterator iter;
 
@@ -128,14 +125,14 @@
 
 
 /**
- * string to markdown-id link reference 
+ * string to markdown-id link reference
  */
 std::string t_markdown_generator::str_to_id(const std::string& s) {
   std::string id;
   for(auto chr=s.begin();chr<=s.end(); ++chr) {
     if(*chr == '.' || *chr == 0)
       continue;
-    id += tolower(*chr); 
+    id += tolower(*chr);
   }
   return id;
 }
@@ -144,10 +141,10 @@
  * Emits the Table of Contents links at the top of the module's page
  */
 void t_markdown_generator::generate_program_toc() {
-  f_out_ << "| Module | Services & Functions | Data types | Constants |" << endl 
-         << "| --- | --- | --- | --- |" << endl;
+  f_out_ << "| Module | Services & Functions | Data types | Constants |" << '\n'
+         << "| --- | --- | --- | --- |" << '\n';
   generate_program_toc_row(program_);
-  f_out_ << endl;
+  f_out_ << '\n';
 }
 
 /**
@@ -191,24 +188,24 @@
         fill = &filling.back();
       }
       string name = get_service_name(*sv_iter);
-      (*fill)[1] = "[" + name + "](" 
-        + make_file_link(fname) 
+      (*fill)[1] = "[" + name + "]("
+        + make_file_link(fname)
         + "#service-" + str_to_id(name) + ")";
-  
+
       vector<t_function*> functions = (*sv_iter)->get_functions();
       vector<t_function*>::iterator fn_iter;
-      for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {   
-        string fn_name = (*fn_iter)->get_name(); 
+      for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
+        string fn_name = (*fn_iter)->get_name();
         filling.emplace_back();
         fill = &filling.back();
-        (*fill)[1] = "    [ &bull; " + fn_name + "](" 
-          + make_file_link(fname) 
+        (*fill)[1] = "    [ &bull; " + fn_name + "]("
+          + make_file_link(fname)
           + "#function-" + str_to_id(name + fn_name) + ")";
       }
     }
   }
-  
-  // Data Types Column 
+
+  // Data Types Column
   auto it_fill = filling.begin();
 
   if (!tprog->get_enums().empty()) {
@@ -224,8 +221,8 @@
         ++it_fill;
       }
       string name = (*en_iter)->get_name();
-      (*fill)[2] = "[" + name + "](" 
-        + make_file_link(fname) 
+      (*fill)[2] = "[" + name + "]("
+        + make_file_link(fname)
         + "#enumeration-" + str_to_id(name) + ")";
     }
   }
@@ -242,15 +239,15 @@
         ++it_fill;
       }
       string name = (*td_iter)->get_symbolic();
-      (*fill)[2] = "[" + name + "](" 
-        + make_file_link(fname) 
+      (*fill)[2] = "[" + name + "]("
+        + make_file_link(fname)
         + "#typedef-" + str_to_id(name) + ")";
     }
   }
   if (!tprog->get_objects().empty()) {
     vector<t_struct*> objects = tprog->get_objects();
     vector<t_struct*>::iterator o_iter;
-    for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {      
+    for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
       if(it_fill == filling.end()) {
         filling.emplace_back();
         fill = &filling.back();
@@ -261,7 +258,7 @@
       }
       string name = (*o_iter)->get_name();
       (*fill)[2] = "[" + name + "](" + make_file_link(fname);
-      
+
       if ((*o_iter)->is_xception()) {
         (*fill)[2] += "#exception-";
       } else if ((*o_iter)->is_struct() && (*o_iter)->is_union()) {
@@ -270,11 +267,11 @@
         (*fill)[2] += "#struct-";
       }
       (*fill)[2] += str_to_id(name) + ")";
-      
+
     }
   }
-  
-  // Constants Column 
+
+  // Constants Column
   it_fill = filling.begin();
 
   if (!tprog->get_consts().empty()) {
@@ -291,19 +288,19 @@
         ++it_fill;
       }
       string name = (*con_iter)->get_name();
-      (*fill)[3] = "[" + name + "](" 
-        + make_file_link(fname) 
+      (*fill)[3] = "[" + name + "]("
+        + make_file_link(fname)
         + "#constant-" + str_to_id(name) + ")";
     }
-    
+
   }
-  
+
   for(auto& fill : filling) {
     for(auto& c : fill)
-      f_out_ << '|' << c;  
-    f_out_ << '|' << endl;
+      f_out_ << '|' << c;
+    f_out_ << '|' << '\n';
   }
-  f_out_ << endl;
+  f_out_ << '\n';
 }
 
 /**
@@ -318,24 +315,24 @@
   current_file_ = make_file_name(pname);
   string fname = get_out_dir() + current_file_;
   f_out_.open(fname.c_str());
-  f_out_ << "# Thrift module: " << pname << endl << endl;
+  f_out_ << "# Thrift module: " << pname << '\n' << '\n';
 
   print_doc(program_);
-  f_out_ << endl << endl;
+  f_out_ << '\n' << '\n';
 
   generate_program_toc();
 
   if (!program_->get_consts().empty()) {
-    f_out_ << "***" << endl << "## Constants" << endl << endl;
+    f_out_ << "***" << '\n' << "## Constants" << '\n' << '\n';
     vector<t_const*> consts = program_->get_consts();
-    f_out_ << "|Constant|Type|Value||" << endl
-           << "|---|---|---|---|" << endl;
+    f_out_ << "|Constant|Type|Value||" << '\n'
+           << "|---|---|---|---|" << '\n';
     generate_consts(consts);
-    f_out_ << endl;
+    f_out_ << '\n';
   }
 
   if (!program_->get_enums().empty()) {
-    f_out_ << "***" << endl << "## Enumerations" << endl << endl;
+    f_out_ << "***" << '\n' << "## Enumerations" << '\n' << '\n';
     // Generate enums
     vector<t_enum*> enums = program_->get_enums();
     vector<t_enum*>::iterator en_iter;
@@ -345,7 +342,7 @@
   }
 
   if (!program_->get_typedefs().empty()) {
-    f_out_ << "***" << endl << "## Type declarations" << endl << endl;
+    f_out_ << "***" << '\n' << "## Type declarations" << '\n' << '\n';
     // Generate typedefs
     vector<t_typedef*> typedefs = program_->get_typedefs();
     vector<t_typedef*>::iterator td_iter;
@@ -355,7 +352,7 @@
   }
 
   if (!program_->get_objects().empty()) {
-    f_out_ << "***" << endl << "## Data structures" << endl << endl;
+    f_out_ << "***" << '\n' << "## Data structures" << '\n' << '\n';
     // Generate structs and exceptions in declared order
     vector<t_struct*> objects = program_->get_objects();
     vector<t_struct*>::iterator o_iter;
@@ -369,7 +366,7 @@
   }
 
   if (!program_->get_services().empty()) {
-    f_out_ << "***" << endl << "## Services" << endl << endl;
+    f_out_ << "***" << '\n' << "## Services" << '\n' << '\n';
     // Generate services
     vector<t_service*> services = program_->get_services();
     vector<t_service*>::iterator sv_iter;
@@ -379,7 +376,7 @@
     }
   }
 
-  f_out_ << endl;
+  f_out_ << '\n';
   f_out_.close();
 
   generate_index();
@@ -392,15 +389,15 @@
   current_file_ = make_file_name("index");
   string index_fname = get_out_dir() + current_file_;
   f_out_.open(index_fname.c_str());
-  
-  f_out_ << "# Thrift declarations" << endl;
-  f_out_ << "| Module | Services & Functions | Data types | Constants |" 
-         << endl 
-         << "| --- | --- | --- | --- |" 
-         << endl;
+
+  f_out_ << "# Thrift declarations" << '\n';
+  f_out_ << "| Module | Services & Functions | Data types | Constants |"
+         << '\n'
+         << "| --- | --- | --- | --- |"
+         << '\n';
   vector<t_program*> programs;
   generate_program_toc_rows(program_, programs);
-  f_out_ << endl;
+  f_out_ << '\n';
   f_out_.close();
 }
 
@@ -716,13 +713,13 @@
       f_out_ << "&gt;";
     }
   } else if (ttype->is_base_type()) {
-    f_out_ << "```" << (ttype->is_binary() ? "binary" : ttype->get_name()) 
+    f_out_ << "```" << (ttype->is_binary() ? "binary" : ttype->get_name())
            << "```";
     len = ttype->get_name().size();
   } else {
     string prog_name = ttype->get_program()->get_name();
     string type_name = ttype->get_name();
-    f_out_ << "[```" << type_name << "```](" 
+    f_out_ << "[```" << type_name << "```]("
            << make_file_link(make_file_name(prog_name)) << "#";
     if (ttype->is_typedef()) {
       f_out_ << "typedef-";
@@ -740,7 +737,7 @@
     }
     len = type_name.size();
     if (ttype->get_program() != program_) {
-      f_out_ << str_to_id(prog_name); 
+      f_out_ << str_to_id(prog_name);
       len += prog_name.size() + 1;
     }
     f_out_ <<  str_to_id(type_name) << ')';
@@ -757,8 +754,8 @@
   if (tvalue->get_type() == t_const_value::CV_IDENTIFIER) {
     string fname = make_file_name(program_->get_name());
     string name = escape_html(tvalue->get_identifier());
-    f_out_ << "[```" << name << "```](" 
-      + make_file_link(fname) 
+    f_out_ << "[```" << name << "```]("
+      + make_file_link(fname)
       + "#constant-" + str_to_id(name) + ")";
     return;
   }
@@ -773,7 +770,7 @@
     t_base_type::t_base tbase = ((t_base_type*)truetype)->get_base();
     f_out_ << "```";
     switch (tbase) {
-    case t_base_type::TYPE_STRING: 
+    case t_base_type::TYPE_STRING:
       f_out_ << escape_html(get_escaped_string(tvalue));
       break;
     case t_base_type::TYPE_BOOL:
@@ -893,17 +890,17 @@
     }
     if (has_docs) {
       arg_iter = args.begin();
-      f_out_ << endl << "* parameters:" << endl;
+      f_out_ << '\n' << "* parameters:" << '\n';
       for (int n = 1; arg_iter != args.end(); ++arg_iter, ++n ) {
         f_out_ << n << ". " << (*arg_iter)->get_name();
         f_out_ << " - " << escape_html((*arg_iter)->get_doc());
-        f_out_ << endl;
+        f_out_ << '\n';
       }
-      f_out_ << endl;
+      f_out_ << '\n';
     }
   }
-  if(!has_docs) 
-    f_out_ << endl;
+  if(!has_docs)
+    f_out_ << '\n';
 
   has_docs = false;
   vector<t_field*> excepts = tfunction->get_xceptions()->get_members();
@@ -917,14 +914,14 @@
     }
     if (has_docs) {
       ex_iter = excepts.begin();
-      f_out_ << "* exceptions:" << endl;
+      f_out_ << "* exceptions:" << '\n';
       for (; ex_iter != excepts.end(); ex_iter++) {
         f_out_ << "  * " << (*ex_iter)->get_type()->get_name();
         f_out_ << " - ";
         f_out_ << escape_html((*ex_iter)->get_doc());
-        f_out_ << endl;
+        f_out_ << '\n';
       }
-      f_out_ << endl;
+      f_out_ << '\n';
     }
   }
 }
@@ -936,13 +933,13 @@
  */
 void t_markdown_generator::generate_typedef(t_typedef* ttypedef) {
   string name = ttypedef->get_name();
-  f_out_ << "### Typedef: " << name  << endl;
+  f_out_ << "### Typedef: " << name  << '\n';
   print_doc(ttypedef);
-  f_out_ << endl << endl;
+  f_out_ << '\n' << '\n';
   f_out_ << "_Base type_: **";
   print_type(ttypedef->get_type());
-  f_out_ << "**" << endl << endl;
-  f_out_ << endl;
+  f_out_ << "**" << '\n' << '\n';
+  f_out_ << '\n';
 }
 
 /**
@@ -952,10 +949,10 @@
  */
 void t_markdown_generator::generate_enum(t_enum* tenum) {
   string name = tenum->get_name();
-  f_out_ << "### Enumeration: " << name << endl;
+  f_out_ << "### Enumeration: " << name << '\n';
   print_doc(tenum);
-  f_out_  << endl << endl << "|Name|Value|Description|" << endl 
-          << "|---|---|---|" << endl;
+  f_out_  << '\n' << '\n' << "|Name|Value|Description|" << '\n'
+          << "|---|---|---|" << '\n';
   vector<t_enum_value*> values = tenum->get_constants();
   vector<t_enum_value*>::iterator val_iter;
   for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
@@ -965,9 +962,9 @@
     f_out_ << (*val_iter)->get_value();
     f_out_ << "```|";
     print_doc((*val_iter));
-    f_out_ << "|" << endl;
+    f_out_ << "|" << '\n';
   }
-  f_out_ << endl;
+  f_out_ << '\n';
 }
 
 /**
@@ -984,7 +981,7 @@
   if (tconst->has_doc()) {
     print_doc(tconst);
   }
-  f_out_ << '|' << endl;
+  f_out_ << '|' << '\n';
 }
 
 /**
@@ -1002,14 +999,14 @@
   } else {
     f_out_ << "Struct: ";
   }
-  f_out_ << name << endl;
+  f_out_ << name << '\n';
   print_doc(tstruct);
-  f_out_ << endl << endl;
+  f_out_ << '\n' << '\n';
   vector<t_field*> members = tstruct->get_members();
   vector<t_field*>::iterator mem_iter = members.begin();
   f_out_ << "| Key | Field | Type | Description | Requiredness "
-            "| Default value |" << endl
-         << "| --- | --- | --- | --- | --- | --- |" << endl;
+            "| Default value |" << '\n'
+         << "| --- | --- | --- | --- | --- | --- |" << '\n';
   for (; mem_iter != members.end(); mem_iter++) {
     f_out_ << '|' << (*mem_iter)->get_key();
     f_out_ << '|' << (*mem_iter)->get_name();
@@ -1030,9 +1027,9 @@
       print_const_value((*mem_iter)->get_type(), default_val);
       f_out_ << "```";
     }
-    f_out_ << '|' << endl;
+    f_out_ << '|' << '\n';
   }
-  f_out_ << endl;
+  f_out_ << '\n';
 }
 
 /**
@@ -1050,32 +1047,32 @@
  * @param tservice The service definition
  */
 void t_markdown_generator::generate_service(t_service* tservice) {
-  f_out_ << "### Service: " << service_name_ << endl;
+  f_out_ << "### Service: " << service_name_ << '\n';
 
   if (tservice->get_extends()) {
     f_out_ << "**extends ** _";
     print_type(tservice->get_extends());
-    f_out_ << "_" << endl;
+    f_out_ << "_" << '\n';
   }
 
   print_doc(tservice);
-  f_out_ << endl;
+  f_out_ << '\n';
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator fn_iter = functions.begin();
   for (; fn_iter != functions.end(); fn_iter++) {
     string fn_name = (*fn_iter)->get_name();
-    f_out_ << "#### Function: " << service_name_ << "." << fn_name << endl;
+    f_out_ << "#### Function: " << service_name_ << "." << fn_name << '\n';
     print_doc(*fn_iter);
-    f_out_ << endl << endl;
+    f_out_ << '\n' << '\n';
     print_type((*fn_iter)->get_returntype());
     bool first = true;
-    f_out_ << endl << " _" << fn_name << "_(";
+    f_out_ << '\n' << " _" << fn_name << "_(";
     vector<t_field*> args = (*fn_iter)->get_arglist()->get_members();
     vector<t_field*>::iterator arg_iter = args.begin();
     for (; arg_iter != args.end(); arg_iter++) {
       if (!first) {
-        f_out_ << "," << endl;
+        f_out_ << "," << '\n';
       }
       first = false;
       print_type((*arg_iter)->get_type());
@@ -1085,7 +1082,7 @@
         print_const_value((*arg_iter)->get_type(), (*arg_iter)->get_value());
       }
     }
-    f_out_ << ")" << endl;
+    f_out_ << ")" << '\n';
     first = true;
     vector<t_field*> excepts = (*fn_iter)->get_xceptions()->get_members();
     vector<t_field*>::iterator ex_iter = excepts.begin();
@@ -1098,10 +1095,10 @@
         first = false;
         print_type((*ex_iter)->get_type());
       }
-      f_out_ << endl;
+      f_out_ << '\n';
     }
     print_fn_args_doc(*fn_iter);
-    f_out_ << endl;
+    f_out_ << '\n';
   }
 }
 
diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
index 1a27c0c..6e46454 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
@@ -203,26 +203,26 @@
 void t_netstd_generator::pragmas_and_directives(ostream& out)
 {
     if( target_net_version >= 6) {
-      out << "// Thrift code generated for net" << target_net_version << endl;
-      out << "#nullable enable                 // requires C# 8.0" << endl;
+      out << "// Thrift code generated for net" << target_net_version << '\n';
+      out << "#nullable enable                 // requires C# 8.0" << '\n';
     }
 
     // this one must be first
-    out << "#pragma warning disable IDE0079  // remove unnecessary pragmas" << endl;
+    out << "#pragma warning disable IDE0079  // remove unnecessary pragmas" << '\n';
 
     if( target_net_version >= 8) {
-      out << "#pragma warning disable IDE0290  // use primary CTOR" << endl;
+      out << "#pragma warning disable IDE0290  // use primary CTOR" << '\n';
     } else {
-      out << "#pragma warning disable IDE0017  // object init can be simplified" << endl;
-      out << "#pragma warning disable IDE0028  // collection init can be simplified" << endl;
+      out << "#pragma warning disable IDE0017  // object init can be simplified" << '\n';
+      out << "#pragma warning disable IDE0028  // collection init can be simplified" << '\n';
     }
-    out << "#pragma warning disable IDE1006  // parts of the code use IDL spelling" << endl;
-    out << "#pragma warning disable CA1822   // empty " << DEEP_COPY_METHOD_NAME << "() methods still non-static" << endl;
+    out << "#pragma warning disable IDE1006  // parts of the code use IDL spelling" << '\n';
+    out << "#pragma warning disable CA1822   // empty " << DEEP_COPY_METHOD_NAME << "() methods still non-static" << '\n';
 
     if( target_net_version < 6) {
-        out << "#pragma warning disable IDE0083  // pattern matching \"that is not SomeType\" requires net5.0 but we still support earlier versions" << endl;
+        out << "#pragma warning disable IDE0083  // pattern matching \"that is not SomeType\" requires net5.0 but we still support earlier versions" << '\n';
     }
-    out << endl;
+    out << '\n';
 }
 
 
@@ -230,7 +230,7 @@
 {
     if (!namespace_name_.empty())
     {
-        out << "namespace " << namespace_name_ << endl;
+        out << "namespace " << namespace_name_ << '\n';
         scope_up(out);
     }
 }
@@ -309,13 +309,13 @@
 void t_netstd_generator::generate_enum(ostream& out, t_enum* tenum)
 {
     reset_indent();
-    out << autogen_comment() << endl;
+    out << autogen_comment() << '\n';
 
     pragmas_and_directives(out);
     start_netstd_namespace(out);
     generate_netstd_doc(out, tenum);
 
-    out << indent() << "public enum " << type_name(tenum,false) << endl;
+    out << indent() << "public enum " << type_name(tenum,false) << '\n';
     scope_up(out);
 
     vector<t_enum_value*> constants = tenum->get_constants();
@@ -325,7 +325,7 @@
     {
         generate_netstd_doc(out, *c_iter);
         int value = (*c_iter)->get_value();
-        out << indent() << normalize_name((*c_iter)->get_name()) << " = " << value << "," << endl;
+        out << indent() << normalize_name((*c_iter)->get_name()) << " = " << value << "," << '\n';
     }
 
     scope_down(out);
@@ -356,12 +356,12 @@
     }
 
     reset_indent();
-    out << autogen_comment() << netstd_type_usings() << endl << endl;
+    out << autogen_comment() << netstd_type_usings() << '\n' << '\n';
 
     pragmas_and_directives(out);
     start_netstd_namespace(out);
 
-    out << indent() << "public static class " << make_valid_csharp_identifier(program_name_) << "Constants" << endl;
+    out << indent() << "public static class " << make_valid_csharp_identifier(program_name_) << "Constants" << '\n';
 
     scope_up(out);
 
@@ -416,7 +416,7 @@
             t_type* field_type = field->get_type();
 
             string val = render_const_value(out, name, field_type, v_iter->second);
-            out << indent() << name << "." << prop_name(field) << " = " << val << ";" << endl;
+            out << indent() << name << "." << prop_name(field) << " = " << val << ";" << '\n';
         }
 
         cleanup_member_name_mapping(static_cast<t_struct*>(type));
@@ -431,7 +431,7 @@
         {
             string key = render_const_value(out, name, ktype, v_iter->first);
             string val = render_const_value(out, name, vtype, v_iter->second);
-            out << indent() << name << "[" << key << "]" << " = " << val << ";" << endl;
+            out << indent() << name << "[" << key << "]" << " = " << val << ";" << '\n';
         }
     }
     else if (type->is_list() || type->is_set())
@@ -451,14 +451,14 @@
         for (v_iter = val.begin(); v_iter != val.end(); ++v_iter)
         {
             string val = render_const_value(out, name, etype, *v_iter);
-            out << indent() << name << ".Add(" << val << ");" << endl;
+            out << indent() << name << ".Add(" << val << ");" << '\n';
         }
     }
 }
 
 void t_netstd_generator::print_const_constructor(ostream& out, vector<t_const*> consts)
 {
-    out << indent() << "static " << make_valid_csharp_identifier(program_name_).c_str() << "Constants()" << endl;
+    out << indent() << "static " << make_valid_csharp_identifier(program_name_).c_str() << "Constants()" << '\n';
     scope_up(out);
 
     vector<t_const*>::iterator c_iter;
@@ -494,30 +494,30 @@
     if (type->is_base_type())
     {
         string v2 = render_const_value(out, name, type, value);
-        out << name << " = " << v2 << ";" << endl;
+        out << name << " = " << v2 << ";" << '\n';
         need_static_construction = false;
     }
     else if (type->is_enum())
     {
-        out << name << " = " << type_name(type) << "." << value->get_identifier_name() << ";" << endl;
+        out << name << " = " << type_name(type) << "." << value->get_identifier_name() << ";" << '\n';
         need_static_construction = false;
     }
     else if (type->is_struct() || type->is_xception())
     {
         if(target_net_version >= 6) {
-          out << name << " = new();" << endl;
+          out << name << " = new();" << '\n';
         } else {
-          out << name << " = new " << type_name(type) << "();" << endl;
+          out << name << " = new " << type_name(type) << "();" << '\n';
         }
     }
     else if (type->is_map() || type->is_list() || type->is_set())
     {
         if(target_net_version >= 8) {
-          out << name << " = [];" << endl;
+          out << name << " = [];" << '\n';
         } else if(target_net_version >= 6) {
-          out << name << " = new();" << endl;
+          out << name << " = new();" << '\n';
         } else {
-          out << name << " = new " << type_name(type) << "();" << endl;
+          out << name << " = new " << type_name(type) << "();" << '\n';
         }
     }
 
@@ -672,49 +672,49 @@
 
     reset_indent();
     out << autogen_comment() << netstd_type_usings()
-        << "using Thrift.Protocol;" << endl
-        << endl << endl;
+        << "using Thrift.Protocol;" << '\n'
+        << '\n' << '\n';
 
     pragmas_and_directives(out);
     start_netstd_namespace(out);
 
-    out << indent() << "public static class " << make_valid_csharp_identifier(program_name_) << "Extensions" << endl;
+    out << indent() << "public static class " << make_valid_csharp_identifier(program_name_) << "Extensions" << '\n';
     scope_up(out);
 
     bool needs_typecast = false;
     std::map<string,t_type*>::const_iterator iter;
     for( iter = types.begin(); iter != types.end(); ++iter)
     {
-        out << indent() << "public static bool Equals(this " << iter->first << " instance, object that)" << endl;
+        out << indent() << "public static bool Equals(this " << iter->first << " instance, object that)" << '\n';
         scope_up(out);
         if( target_net_version >= 6) {
-            out << indent() << "if (that is not " << iter->first << " other) return false;" << endl;
+            out << indent() << "if (that is not " << iter->first << " other) return false;" << '\n';
         } else {
-            out << indent() << "if (!(that is " << iter->first << " other)) return false;" << endl;
+            out << indent() << "if (!(that is " << iter->first << " other)) return false;" << '\n';
         }
-        out << indent() << "if (ReferenceEquals(instance, other)) return true;" << endl;
-        out << endl;
-        out << indent() << "return TCollections.Equals(instance, other);" << endl;
+        out << indent() << "if (ReferenceEquals(instance, other)) return true;" << '\n';
+        out << '\n';
+        out << indent() << "return TCollections.Equals(instance, other);" << '\n';
         scope_down(out);
-        out << endl << endl;
+        out << '\n' << '\n';
 
-        out << indent() << "public static int GetHashCode(this " << iter->first << " instance)" << endl;
+        out << indent() << "public static int GetHashCode(this " << iter->first << " instance)" << '\n';
         scope_up(out);
-        out << indent() << "return TCollections.GetHashCode(instance);" << endl;
+        out << indent() << "return TCollections.GetHashCode(instance);" << '\n';
         scope_down(out);
-        out << endl << endl;
+        out << '\n' << '\n';
 
         if(! suppress_deepcopy) {
-            out << indent() << "public static " << iter->first << nullable_field_suffix(iter->second) << " " << DEEP_COPY_METHOD_NAME << "(this " << iter->first << nullable_field_suffix(iter->second) << " source)" << endl;
+            out << indent() << "public static " << iter->first << nullable_field_suffix(iter->second) << " " << DEEP_COPY_METHOD_NAME << "(this " << iter->first << nullable_field_suffix(iter->second) << " source)" << '\n';
             scope_up(out);
-            out << indent() << "if (source == null)" << endl;
+            out << indent() << "if (source == null)" << '\n';
             indent_up();
-            out << indent() << "return null;" << endl << endl;
+            out << indent() << "return null;" << '\n' << '\n';
             indent_down();
 
             string suffix("");
             string tmp_instance = tmp("tmp");
-            out << indent() << "var " << tmp_instance << " = new " << iter->first << "(source.Count);" << endl;
+            out << indent() << "var " << tmp_instance << " = new " << iter->first << "(source.Count);" << '\n';
             if( iter->second->is_map())
             {
                 t_map* tmap = static_cast<t_map*>(iter->second);
@@ -723,7 +723,7 @@
                 bool null_key = type_can_be_null(tmap->get_key_type());
                 bool null_val = type_can_be_null(tmap->get_val_type());
 
-                out << indent() << "foreach (var pair in source)" << endl;
+                out << indent() << "foreach (var pair in source)" << '\n';
                 indent_up();
                 if( target_net_version >= 6) {
                     out << indent() << tmp_instance << ".Add(pair.Key" << copy_key;
@@ -742,7 +742,7 @@
                         out << "pair.Value" << copy_val;
                     }
                 }
-                out << ");" << endl;
+                out << ");" << '\n';
                 indent_down();
 
             } else if( iter->second->is_set() || iter->second->is_list()) {
@@ -761,7 +761,7 @@
                     null_elm = type_can_be_null(tlist->get_elem_type());
                 }
 
-                out << indent() << "foreach (var elem in source)" << endl;
+                out << indent() << "foreach (var elem in source)" << '\n';
                 indent_up();
                 if( target_net_version >= 6) {
                     out << indent() << tmp_instance << ".Add(elem" << copy_elm;
@@ -774,13 +774,13 @@
                         out << "elem" << copy_elm;
                     }
                 }
-                out << ");" << endl;
+                out << ");" << '\n';
                 indent_down();
             }
 
-            out << indent() << "return " << tmp_instance << ";" << endl;
+            out << indent() << "return " << tmp_instance << ";" << '\n';
             scope_down(out);
-            out << endl << endl;
+            out << '\n' << '\n';
         }
     }
 
@@ -818,7 +818,7 @@
     f_struct.open(f_struct_name.c_str());
 
     reset_indent();
-    f_struct << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << endl << endl;
+    f_struct << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << '\n' << '\n';
 
     pragmas_and_directives(f_struct);
     generate_netstd_struct_definition(f_struct, tstruct, is_exception);
@@ -835,7 +835,7 @@
         start_netstd_namespace(out);
     }
 
-    out << endl;
+    out << '\n';
 
     generate_netstd_doc(out, tstruct);
     collect_extensions_types(tstruct);
@@ -843,7 +843,7 @@
 
     if ((is_serialize_enabled() || is_wcf_enabled()) && !is_exception)
     {
-        out << indent() << "[DataContract(Namespace=\"" << wcf_namespace_ << "\")]" << endl;
+        out << indent() << "[DataContract(Namespace=\"" << wcf_namespace_ << "\")]" << '\n';
     }
 
     bool is_final = tstruct->annotations_.find("final") != tstruct->annotations_.end();
@@ -857,8 +857,8 @@
         out << "TException, ";
     }
 
-    out << "TBase" << endl
-        << indent() << "{" << endl;
+    out << "TBase" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     const vector<t_field*>& members = tstruct->get_members();
@@ -870,10 +870,10 @@
         // if the field is required, then we use auto-properties
         if (!field_is_required((*m_iter)))
         {
-            out << indent() << "private " << declare_field(*m_iter, false, true, "_") << endl;
+            out << indent() << "private " << declare_field(*m_iter, false, true, "_") << '\n';
         }
     }
-    out << endl;
+    out << '\n';
 
     bool has_non_required_fields = false;
     bool has_required_fields = false;
@@ -895,19 +895,19 @@
     bool generate_isset = has_non_required_fields;
     if (generate_isset)
     {
-        out << endl;
+        out << '\n';
         if (is_serialize_enabled() || is_wcf_enabled())
         {
-            out << indent() << "[DataMember(Order = 1)]" << endl;
+            out << indent() << "[DataMember(Order = 1)]" << '\n';
         }
-        out << indent() << "public Isset __isset;" << endl;
+        out << indent() << "public Isset __isset;" << '\n';
         if (is_serialize_enabled() || is_wcf_enabled())
         {
-            out << indent() << "[DataContract]" << endl;
+            out << indent() << "[DataContract]" << '\n';
         }
 
-        out << indent() << "public struct Isset" << endl
-            << indent() << "{" << endl;
+        out << indent() << "public struct Isset" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
         for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
@@ -919,18 +919,18 @@
             {
                 if (is_serialize_enabled() || is_wcf_enabled())
                 {
-                    out << indent() << "[DataMember]" << endl;
+                    out << indent() << "[DataMember]" << '\n';
                 }
-                out << indent() << "public bool " << get_isset_name(normalize_name((*m_iter)->get_name())) << ";" << endl;
+                out << indent() << "public bool " << get_isset_name(normalize_name((*m_iter)->get_name())) << ";" << '\n';
             }
         }
 
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
 
         if (generate_isset && (is_serialize_enabled() || is_wcf_enabled()))
         {
-            out << indent() << "#region XmlSerializer support" << endl << endl;
+            out << indent() << "#region XmlSerializer support" << '\n' << '\n';
 
             for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
             {
@@ -939,22 +939,22 @@
                 // if it is not required, if it has a default value, we need to generate Isset
                 if (!is_required)
                 {
-                    out << indent() << "public bool ShouldSerialize" << prop_name(*m_iter) << "()" << endl
-                        << indent() << "{" << endl;
+                    out << indent() << "public bool ShouldSerialize" << prop_name(*m_iter) << "()" << '\n'
+                        << indent() << "{" << '\n';
                     indent_up();
-                    out << indent() << "return __isset." << get_isset_name(normalize_name((*m_iter)->get_name())) << ";" << endl;
+                    out << indent() << "return __isset." << get_isset_name(normalize_name((*m_iter)->get_name())) << ";" << '\n';
                     indent_down();
-                    out << indent() << "}" << endl << endl;
+                    out << indent() << "}" << '\n' << '\n';
                 }
             }
 
-            out << indent() << "#endregion XmlSerializer support" << endl << endl;
+            out << indent() << "#endregion XmlSerializer support" << '\n' << '\n';
         }
     }
 
     // We always want a default, no argument constructor for Reading
-    out << indent() << "public " << sharp_struct_name << "()" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public " << sharp_struct_name << "()" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
@@ -972,12 +972,12 @@
             {
                 print_const_value(out, "this._" + (*m_iter)->get_name(), t, (*m_iter)->get_value(), true, true);
                 // Optionals with defaults are marked set
-                out << indent() << "this.__isset." << get_isset_name(normalize_name((*m_iter)->get_name())) << " = true;" << endl;
+                out << indent() << "this.__isset." << get_isset_name(normalize_name((*m_iter)->get_name())) << " = true;" << '\n';
             }
         }
     }
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     // if we have required fields, we add that CTOR too
     if (has_required_fields)
@@ -999,20 +999,20 @@
                 out << type_name((*m_iter)->get_type()) << nullable_field_suffix(*m_iter) << " " << normalize_name((*m_iter)->get_name());
             }
         }
-        out << ") : this()" << endl
-            << indent() << "{" << endl;
+        out << ") : this()" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
         for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
         {
             if (field_is_required(*m_iter))
             {
-                out << indent() << "this." << prop_name(*m_iter) << " = " << normalize_name((*m_iter)->get_name()) << ";" << endl;
+                out << indent() << "this." << prop_name(*m_iter) << " = " << normalize_name((*m_iter)->get_name()) << ";" << '\n';
             }
         }
 
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
     }
 
     // DeepCopy()
@@ -1032,7 +1032,7 @@
     generate_netstd_struct_tostring(out, tstruct);
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     // generate a corresponding WCF fault to wrap the exception
     if ((is_serialize_enabled() || is_wcf_enabled()) && is_exception)
@@ -1050,13 +1050,13 @@
 
 void t_netstd_generator::generate_netstd_wcffault(ostream& out, t_struct* tstruct)
 {
-    out << endl;
-    out << indent() << "[DataContract]" << endl;
+    out << '\n';
+    out << indent() << "[DataContract]" << '\n';
 
     bool is_final = tstruct->annotations_.find("final") != tstruct->annotations_.end();
 
-    out << indent() << "public " << (is_final ? "sealed " : "") << "partial class " << type_name(tstruct,false) << "Fault" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public " << (is_final ? "sealed " : "") << "partial class " << type_name(tstruct,false) << "Fault" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     const vector<t_field*>& members = tstruct->get_members();
@@ -1068,10 +1068,10 @@
         // if the field is required, then we use auto-properties
         if (!field_is_required((*m_iter)))
         {
-            out << indent() << "private " << declare_field(*m_iter, false, true, "_") << endl;
+            out << indent() << "private " << declare_field(*m_iter, false, true, "_") << '\n';
         }
     }
-    out << endl;
+    out << '\n';
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
     {
@@ -1079,7 +1079,7 @@
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_deepcopy_method(ostream& out, t_struct* tstruct, std::string sharp_struct_name)
@@ -1091,8 +1091,8 @@
     const vector<t_field*>& members = tstruct->get_members();
     vector<t_field*>::const_iterator m_iter;
 
-    out << indent() << "public " << sharp_struct_name << " " << DEEP_COPY_METHOD_NAME << "()" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public " << sharp_struct_name << " " << DEEP_COPY_METHOD_NAME << "()" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
     // return directly if there are only required fields
@@ -1100,10 +1100,10 @@
     out << indent() << "var " << tmp_instance << " = new " << sharp_struct_name << "()";
     bool inline_assignment = (target_net_version >= 6);
     if(inline_assignment) {
-      out << endl << indent() << "{" << endl;
+      out << '\n' << indent() << "{" << '\n';
       indent_up();
     } else {
-      out << endl;
+      out << '\n';
     }
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -1118,7 +1118,7 @@
         if(inline_assignment) {
           if( null_allowed || (!is_required)) {  // = has isset
             indent_down();
-            out << indent() << "};" << endl;
+            out << indent() << "};" << '\n';
             inline_assignment = false;
           }
         }
@@ -1134,7 +1134,7 @@
             out << "(" << type_name(ttype) << ")";
         }
         out << "this." << prop_name(*m_iter) << copy_op;
-        out << (inline_assignment ? "," : ";") << endl;
+        out << (inline_assignment ? "," : ";") << '\n';
 
         generate_null_check_end( out, *m_iter);
         if( !is_required) {
@@ -1144,29 +1144,29 @@
             }
             out << "__isset." << get_isset_name(normalize_name((*m_iter)->get_name()));
             out << " = this.__isset." << get_isset_name(normalize_name((*m_iter)->get_name()));
-            out << (inline_assignment ? "," : ";") << endl;
+            out << (inline_assignment ? "," : ";") << '\n';
         }
     }
 
     if(inline_assignment) {
       indent_down();
-      out << indent() << "};" << endl;
+      out << indent() << "};" << '\n';
     }
 
-    out << indent() << "return " << tmp_instance << ";" << endl;
+    out << indent() << "return " << tmp_instance << ";" << '\n';
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_struct_reader(ostream& out, t_struct* tstruct)
 {
-    out << indent() << "public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "iprot.IncrementRecursionDepth();" << endl
-        << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "iprot.IncrementRecursionDepth();" << '\n'
+        << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     const vector<t_field*>& fields = tstruct->get_members();
@@ -1177,90 +1177,90 @@
     {
         if (field_is_required(*f_iter))
         {
-            out << indent() << "bool isset_" << (*f_iter)->get_name() << " = false;" << endl;
+            out << indent() << "bool isset_" << (*f_iter)->get_name() << " = false;" << '\n';
         }
     }
 
-    out << indent() << "TField field;" << endl
-        << indent() << "await iprot.ReadStructBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "while (true)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "TField field;" << '\n'
+        << indent() << "await iprot.ReadStructBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "while (true)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "field = await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "if (field.Type == TType.Stop)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "field = await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "if (field.Type == TType.Stop)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "break;" << endl;
+    out << indent() << "break;" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl
-        << indent() << "switch (field.ID)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n' << '\n'
+        << indent() << "switch (field.ID)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
     {
         bool is_required = field_is_required(*f_iter);
-        out << indent() << "case " << (*f_iter)->get_key() << ":" << endl;
+        out << indent() << "case " << (*f_iter)->get_key() << ":" << '\n';
         indent_up();
-        out << indent() << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ")" << endl
-            << indent() << "{" << endl;
+        out << indent() << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ")" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
         generate_deserialize_field(out, *f_iter);
         if (is_required)
         {
-            out << indent() << "isset_" << (*f_iter)->get_name() << " = true;" << endl;
+            out << indent() << "isset_" << (*f_iter)->get_name() << " = true;" << '\n';
         }
 
         indent_down();
-        out << indent() << "}" << endl
-            << indent() << "else" << endl
-            << indent() << "{" << endl;
+        out << indent() << "}" << '\n'
+            << indent() << "else" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
-        out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
         indent_down();
-        out << indent() << "}" << endl
-            << indent() << "break;" << endl;
+        out << indent() << "}" << '\n'
+            << indent() << "break;" << '\n';
         indent_down();
     }
 
-    out << indent() << "default: " << endl;
+    out << indent() << "default: " << '\n';
     indent_up();
-    out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "break;" << endl;
+    out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "break;" << '\n';
     indent_down();
     indent_down();
-    out << indent() << "}" << endl
-        << endl
-        << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "}" << '\n'
+        << '\n'
+        << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << endl
-        << indent() << "await iprot.ReadStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "}" << '\n'
+        << '\n'
+        << indent() << "await iprot.ReadStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
     {
         if (field_is_required((*f_iter)))
         {
-            out << indent() << "if (!isset_" << (*f_iter)->get_name() << ")" << endl
-                << indent() << "{" << endl;
+            out << indent() << "if (!isset_" << (*f_iter)->get_name() << ")" << '\n'
+                << indent() << "{" << '\n';
             indent_up();
-            out << indent() << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << endl;
+            out << indent() << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << '\n';
             indent_down();
-            out << indent() << "}" << endl;
+            out << indent() << "}" << '\n';
         }
     }
 
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "finally" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "finally" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "iprot.DecrementRecursionDepth();" << endl;
+    out << indent() << "iprot.DecrementRecursionDepth();" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 
@@ -1284,8 +1284,8 @@
             out << "__isset." << get_isset_name(normalize_name(tfield->get_name()));
         }
 
-        out << ")" << endl
-            << indent() << "{" << endl;
+        out << ")" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
     }
 }
@@ -1297,19 +1297,19 @@
 
     if( null_allowed || (!is_required)) {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
     }
 }
 
 void t_netstd_generator::generate_netstd_struct_writer(ostream& out, t_struct* tstruct)
 {
-    out << indent() << "public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "oprot.IncrementRecursionDepth();" << endl
-        << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "oprot.IncrementRecursionDepth();" << '\n'
+        << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     string name = tstruct->get_name();
@@ -1317,57 +1317,57 @@
     vector<t_field*>::const_iterator f_iter;
 
     string tmpvar = tmp("tmp");
-    out << indent() << "var " << tmpvar << " = new TStruct(\"" << name << "\");" << endl
-        << indent() << "await oprot.WriteStructBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "var " << tmpvar << " = new TStruct(\"" << name << "\");" << '\n'
+        << indent() << "await oprot.WriteStructBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     if (fields.size() > 0)
     {
         tmpvar = tmp("tmp");
         if(target_net_version >= 8) {
-          out << indent() << "#pragma warning disable IDE0017  // simplified init" << endl;
+          out << indent() << "#pragma warning disable IDE0017  // simplified init" << '\n';
         }
-        out << indent() << "var " << tmpvar << " = new TField();" << endl;
+        out << indent() << "var " << tmpvar << " = new TField();" << '\n';
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
             generate_null_check_begin( out, *f_iter);
-            out << indent() << tmpvar << ".Name = \"" << (*f_iter)->get_name() << "\";" << endl
-                << indent() << tmpvar << ".Type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl
-                << indent() << tmpvar << ".ID = " << (*f_iter)->get_key() << ";" << endl
-                << indent() << "await oprot.WriteFieldBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << endl;
+            out << indent() << tmpvar << ".Name = \"" << (*f_iter)->get_name() << "\";" << '\n'
+                << indent() << tmpvar << ".Type = " << type_to_enum((*f_iter)->get_type()) << ";" << '\n'
+                << indent() << tmpvar << ".ID = " << (*f_iter)->get_key() << ";" << '\n'
+                << indent() << "await oprot.WriteFieldBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
             generate_serialize_field(out, *f_iter);
 
-            out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+            out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
             generate_null_check_end(out, *f_iter);
         }
         if(target_net_version >= 8) {
-          out << indent() << "#pragma warning restore IDE0017  // simplified init" << endl;
+          out << indent() << "#pragma warning restore IDE0017  // simplified init" << '\n';
         }
     }
 
-    out << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << indent() << "finally" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n'
+        << indent() << "finally" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "oprot.DecrementRecursionDepth();" << endl;
+    out << indent() << "oprot.DecrementRecursionDepth();" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_struct_result_writer(ostream& out, t_struct* tstruct)
 {
-    out << indent() << "public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "oprot.IncrementRecursionDepth();" << endl
-        << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "oprot.IncrementRecursionDepth();" << '\n'
+        << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     string name = tstruct->get_name();
@@ -1375,85 +1375,85 @@
     vector<t_field*>::const_iterator f_iter;
 
     string tmpvar = tmp("tmp");
-    out << indent() << "var " << tmpvar << " = new TStruct(\"" << name << "\");" << endl
-        << indent() << "await oprot.WriteStructBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "var " << tmpvar << " = new TStruct(\"" << name << "\");" << '\n'
+        << indent() << "await oprot.WriteStructBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     if (fields.size() > 0)
     {
         tmpvar = tmp("tmp");
         if(target_net_version >= 8) {
-          out << indent() << "#pragma warning disable IDE0017  // simplified init" << endl;
+          out << indent() << "#pragma warning disable IDE0017  // simplified init" << '\n';
         }
-        out << indent() << "var " << tmpvar << " = new TField();" << endl;
+        out << indent() << "var " << tmpvar << " = new TField();" << '\n';
         bool first = true;
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
             if (first)
             {
                 first = false;
-                out << endl << indent() << "if";
+                out << '\n' << indent() << "if";
             }
             else
             {
                 out << indent() << "else if";
             }
 
-            out << "(this.__isset." << get_isset_name(normalize_name((*f_iter)->get_name())) << ")" << endl
-                << indent() << "{" << endl;
+            out << "(this.__isset." << get_isset_name(normalize_name((*f_iter)->get_name())) << ")" << '\n'
+                << indent() << "{" << '\n';
             indent_up();
 
             bool null_allowed = type_can_be_null((*f_iter)->get_type());
             if (null_allowed)
             {
-                out << indent() << "if (" << prop_name(*f_iter) << " != null)" << endl
-                    << indent() << "{" << endl;
+                out << indent() << "if (" << prop_name(*f_iter) << " != null)" << '\n'
+                    << indent() << "{" << '\n';
                 indent_up();
             }
 
-            out << indent() << tmpvar << ".Name = \"" << prop_name(*f_iter) << "\";" << endl
-                << indent() << tmpvar << ".Type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl
-                << indent() << tmpvar << ".ID = " << (*f_iter)->get_key() << ";" << endl
-                << indent() << "await oprot.WriteFieldBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << endl;
+            out << indent() << tmpvar << ".Name = \"" << prop_name(*f_iter) << "\";" << '\n'
+                << indent() << tmpvar << ".Type = " << type_to_enum((*f_iter)->get_type()) << ";" << '\n'
+                << indent() << tmpvar << ".ID = " << (*f_iter)->get_key() << ";" << '\n'
+                << indent() << "await oprot.WriteFieldBeginAsync(" << tmpvar << ", " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
             generate_serialize_field(out, *f_iter);
 
-            out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+            out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
             if (null_allowed)
             {
                 indent_down();
-                out << indent() << "}" << endl;
+                out << indent() << "}" << '\n';
             }
 
             indent_down();
-            out << indent() << "}" << endl;
+            out << indent() << "}" << '\n';
         }
         if(target_net_version >= 8) {
-          out << indent() << "#pragma warning restore IDE0017  // simplified init" << endl;
+          out << indent() << "#pragma warning restore IDE0017  // simplified init" << '\n';
         }
     }
 
-    out << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << indent() << "finally" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n'
+        << indent() << "finally" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "oprot.DecrementRecursionDepth();" << endl;
+    out << indent() << "oprot.DecrementRecursionDepth();" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_struct_tostring(ostream& out, t_struct* tstruct)
 {
     string tmpvar = tmp("tmp");
-    out << indent() << "public override string ToString()" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public override string ToString()" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "var " << tmpvar << " = new StringBuilder(\"" << tstruct->get_name() << "(\");" << endl;
+    out << indent() << "var " << tmpvar << " = new StringBuilder(\"" << tstruct->get_name() << "(\");" << '\n';
 
     const vector<t_field*>& fields = tstruct->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -1464,7 +1464,7 @@
     {
         if (!field_is_required((*f_iter)))
         {
-            out << indent() << "int " << tmp_count.c_str() << " = 0;" << endl;
+            out << indent() << "int " << tmp_count.c_str() << " = 0;" << '\n';
             useFirstFlag = true;
         }
         break;
@@ -1479,15 +1479,15 @@
 
         if (useFirstFlag && (!had_required))
         {
-            out << indent() << "if(0 < " << tmp_count.c_str() << (is_required ? "" : "++") << ") { " << tmpvar << ".Append(\", \"); }" << endl;
-            out << indent() << tmpvar << ".Append(\"" << prop_name(*f_iter) << ": \");" << endl;
+            out << indent() << "if(0 < " << tmp_count.c_str() << (is_required ? "" : "++") << ") { " << tmpvar << ".Append(\", \"); }" << '\n';
+            out << indent() << tmpvar << ".Append(\"" << prop_name(*f_iter) << ": \");" << '\n';
         }
         else
         {
-            out << indent() << tmpvar << ".Append(\", " << prop_name(*f_iter) << ": \");" << endl;
+            out << indent() << tmpvar << ".Append(\", " << prop_name(*f_iter) << ": \");" << '\n';
         }
 
-        out << indent() << prop_name(*f_iter) << ".ToString(" << tmpvar << ");" << endl;
+        out << indent() << prop_name(*f_iter) << ".ToString(" << tmpvar << ");" << '\n';
 
         generate_null_check_end(out, *f_iter);
         if (is_required) {
@@ -1495,10 +1495,10 @@
         }
     }
 
-    out << indent() << tmpvar << ".Append(')');" << endl
-        << indent() << "return " << tmpvar << ".ToString();" << endl;
+    out << indent() << tmpvar << ".Append(')');" << '\n'
+        << indent() << "return " << tmpvar << ".ToString();" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 }
 
 void t_netstd_generator::generate_netstd_union(t_struct* tunion)
@@ -1511,7 +1511,7 @@
     f_union.open(f_union_name.c_str());
 
     reset_indent();
-    f_union << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << endl << endl;
+    f_union << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << '\n' << '\n';
 
     pragmas_and_directives(f_union);
     generate_netstd_union_definition(f_union, tunion);
@@ -1526,75 +1526,75 @@
     // Let's define the class first
     start_netstd_namespace(out);
 
-    out << indent() << "public abstract partial class " << normalize_name(tunion->get_name()) << " : TUnionBase" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public abstract partial class " << normalize_name(tunion->get_name()) << " : TUnionBase" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "public abstract global::System.Threading.Tasks.Task WriteAsync(TProtocol tProtocol, CancellationToken " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "public readonly int Isset;" << endl
-        << indent() << "public abstract object" << nullable_suffix() <<" Data { get; }" << endl
-        << indent() << "protected " << normalize_name(tunion->get_name()) << "(int isset)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public abstract global::System.Threading.Tasks.Task WriteAsync(TProtocol tProtocol, CancellationToken " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "public readonly int Isset;" << '\n'
+        << indent() << "public abstract object" << nullable_suffix() <<" Data { get; }" << '\n'
+        << indent() << "protected " << normalize_name(tunion->get_name()) << "(int isset)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "Isset = isset;" << endl;
+    out << indent() << "Isset = isset;" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     const vector<t_field*>& fields = tunion->get_members();
     vector<t_field*>::const_iterator f_iter;
 
-    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << endl;
+    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << '\n';
     scope_up(out);
     if( target_net_version >= 6) {
-        out << indent() << "if (that is not " << tunion->get_name() << " other) return false;" << endl;
+        out << indent() << "if (that is not " << tunion->get_name() << " other) return false;" << '\n';
     } else {
-        out << indent() << "if (!(that is " << tunion->get_name() << " other)) return false;" << endl;
+        out << indent() << "if (!(that is " << tunion->get_name() << " other)) return false;" << '\n';
     }
-    out << indent() << "if (ReferenceEquals(this, other)) return true;" << endl;
-    out << endl;
-    out << indent() << "if(this.Isset != other.Isset) return false;" << endl;
-    out << endl;
+    out << indent() << "if (ReferenceEquals(this, other)) return true;" << '\n';
+    out << '\n';
+    out << indent() << "if(this.Isset != other.Isset) return false;" << '\n';
+    out << '\n';
     if(target_net_version >= 6) {
-        out << indent() << "return Isset switch" << endl;
+        out << indent() << "return Isset switch" << '\n';
         scope_up(out);
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
             bool needs_typecast = false;
             string suffix("");
             get_deep_copy_method_call((*f_iter)->get_type(), false, needs_typecast, suffix);
-            out << indent() << (*f_iter)->get_key() << " => Equals(As_" << (*f_iter)->get_name() << ", other.As_" << (*f_iter)->get_name() << ")," << endl;
+            out << indent() << (*f_iter)->get_key() << " => Equals(As_" << (*f_iter)->get_name() << ", other.As_" << (*f_iter)->get_name() << ")," << '\n';
         }
-        out << indent() << "_ => true," << endl;
+        out << indent() << "_ => true," << '\n';
         indent_down();
-        out << indent() << "};" << endl;
+        out << indent() << "};" << '\n';
     } else {
-        out << indent() << "switch (Isset)" << endl;
+        out << indent() << "switch (Isset)" << '\n';
         scope_up(out);
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
             bool needs_typecast = false;
             string suffix("");
             get_deep_copy_method_call((*f_iter)->get_type(), false, needs_typecast, suffix);
-            out << indent() << "case " << (*f_iter)->get_key() << ":" << endl;
+            out << indent() << "case " << (*f_iter)->get_key() << ":" << '\n';
             indent_up();
-            out << indent() << "return Equals(As_" << (*f_iter)->get_name() << ", other.As_" << (*f_iter)->get_name() << ");" << endl;
+            out << indent() << "return Equals(As_" << (*f_iter)->get_name() << ", other.As_" << (*f_iter)->get_name() << ");" << '\n';
             indent_down();
         }
-        out << indent() << "default:" << endl;
+        out << indent() << "default:" << '\n';
         indent_up();
-        out << indent() << "return true;" << endl;
+        out << indent() << "return true;" << '\n';
         indent_down();
         scope_down(out);
     }
     scope_down(out);
-    out << endl;
+    out << '\n';
 
-    out << indent() << "public override int GetHashCode()" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public override int GetHashCode()" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
     if(target_net_version >= 6) {
-        out << indent() << "return Isset switch" << endl;
-        out << indent() << "{" << endl;
+        out << indent() << "return Isset switch" << '\n';
+        out << indent() << "{" << '\n';
         indent_up();
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
@@ -1603,108 +1603,108 @@
             if( null_coalesce.size() > 0) {
               out << " ?? 0";
             }
-            out << "," << endl;
+            out << "," << '\n';
         }
-        out << indent() << "_ =>  (new ___undefined()).GetHashCode()" << endl;
+        out << indent() << "_ =>  (new ___undefined()).GetHashCode()" << '\n';
         indent_down();
-        out << indent() << "};" << endl;
+        out << indent() << "};" << '\n';
     } else {
-        out << indent() << "switch (Isset)" << endl;
-        out << indent() << "{" << endl;
+        out << indent() << "switch (Isset)" << '\n';
+        out << indent() << "{" << '\n';
         indent_up();
         for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
         {
             string null_coalesce(is_nullable_type((*f_iter)->get_type()) ? "?" : "");
-            out << indent() << "case " << (*f_iter)->get_key() << ":" << endl;
+            out << indent() << "case " << (*f_iter)->get_key() << ":" << '\n';
             indent_up();
             out << indent() << "return As_" << (*f_iter)->get_name() << null_coalesce << ".GetHashCode()";
             if( null_coalesce.size() > 0) {
               out << " ?? 0";
             }
-            out << ";" << endl;
+            out << ";" << '\n';
             indent_down();
         }
-        out << indent() << "default:" << endl;
+        out << indent() << "default:" << '\n';
         indent_up();
-        out << indent() << "return (new ___undefined()).GetHashCode();" << endl;
+        out << indent() << "return (new ___undefined()).GetHashCode();" << '\n';
         indent_down();
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
     }
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     if( ! suppress_deepcopy) {
-        out << indent() << "public " << tunion->get_name() << " " << DEEP_COPY_METHOD_NAME << "()" << endl;
-        out << indent() << "{" << endl;
+        out << indent() << "public " << tunion->get_name() << " " << DEEP_COPY_METHOD_NAME << "()" << '\n';
+        out << indent() << "{" << '\n';
         indent_up();
         if(target_net_version >= 6) {
-            out << indent() << "return Isset switch" << endl;
-            out << indent() << "{" << endl;
+            out << indent() << "return Isset switch" << '\n';
+            out << indent() << "{" << '\n';
             indent_up();
             for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
             {
                 bool needs_typecast = false;
                 string suffix("");
                 string copy_op = get_deep_copy_method_call((*f_iter)->get_type(), false, needs_typecast, suffix);
-                out << indent() << (*f_iter)->get_key() << " => new " << (*f_iter)->get_name() << "(As_" << (*f_iter)->get_name() << suffix << copy_op << ")," << endl;
+                out << indent() << (*f_iter)->get_key() << " => new " << (*f_iter)->get_name() << "(As_" << (*f_iter)->get_name() << suffix << copy_op << ")," << '\n';
             }
-            out << indent() << "_ => new ___undefined()" << endl;
+            out << indent() << "_ => new ___undefined()" << '\n';
             indent_down();
-            out << indent() << "};" << endl;
+            out << indent() << "};" << '\n';
         } else {
-            out << indent() << "switch (Isset)" << endl;
-            out << indent() << "{" << endl;
+            out << indent() << "switch (Isset)" << '\n';
+            out << indent() << "{" << '\n';
             indent_up();
             for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
             {
                 bool needs_typecast = false;
                 string suffix("");
                 string copy_op = get_deep_copy_method_call((*f_iter)->get_type(), false, needs_typecast, suffix);
-                out << indent() << "case " << (*f_iter)->get_key() << ":" << endl;
+                out << indent() << "case " << (*f_iter)->get_key() << ":" << '\n';
                 indent_up();
-                out << indent() << "return new " << (*f_iter)->get_name() << "(As_" << (*f_iter)->get_name() << suffix << copy_op << ");" << endl;
+                out << indent() << "return new " << (*f_iter)->get_name() << "(As_" << (*f_iter)->get_name() << suffix << copy_op << ");" << '\n';
                 indent_down();
             }
-            out << indent() << "default:" << endl;
+            out << indent() << "default:" << '\n';
             indent_up();
-            out << indent() << "return new ___undefined();" << endl;
+            out << indent() << "return new ___undefined();" << '\n';
             indent_down();
             indent_down();
-            out << indent() << "}" << endl;
+            out << indent() << "}" << '\n';
         }
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
     }
 
-    out << indent() << "public class ___undefined : " << tunion->get_name() << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public class ___undefined : " << tunion->get_name() << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "public override object" << nullable_suffix() <<" Data { get { return null; } }" << endl
-        << indent() << "public ___undefined() : base(0) {}" << endl << endl;
+    out << indent() << "public override object" << nullable_suffix() <<" Data { get { return null; } }" << '\n'
+        << indent() << "public ___undefined() : base(0) {}" << '\n' << '\n';
 
     if( ! suppress_deepcopy) {
-        out << indent() << "public new ___undefined " << DEEP_COPY_METHOD_NAME << "()" << endl;
-        out << indent() << "{" << endl;
+        out << indent() << "public new ___undefined " << DEEP_COPY_METHOD_NAME << "()" << '\n';
+        out << indent() << "{" << '\n';
         indent_up();
-        out << indent() << "return new ___undefined();" << endl;
+        out << indent() << "return new ___undefined();" << '\n';
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
     }
 
     t_struct undefined_struct(program_,"___undefined");
     generate_netstd_struct_equals(out, &undefined_struct);
     generate_netstd_struct_hashcode(out, &undefined_struct);
 
-    out << indent() << "public override global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public override global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "throw new TProtocolException( TProtocolException.INVALID_DATA, \"Cannot persist an union type which is not set.\");" << endl;
+    out << indent() << "throw new TProtocolException( TProtocolException.INVALID_DATA, \"Cannot persist an union type which is not set.\");" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
     {
@@ -1714,128 +1714,128 @@
     generate_netstd_union_reader(out, tunion);
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     end_netstd_namespace(out);
 }
 
 void t_netstd_generator::generate_netstd_union_class(ostream& out, t_struct* tunion, t_field* tfield)
 {
-    out << indent() << "public " << type_name(tfield->get_type()) << nullable_field_suffix(tfield) << " As_" << tfield->get_name() << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public " << type_name(tfield->get_type()) << nullable_field_suffix(tfield) << " As_" << tfield->get_name() << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "get" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "get" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
     out << indent() << "return (" << tfield->get_key() << " == Isset) && (Data != null)"
         << " ? (" << type_name(tfield->get_type()) << nullable_field_suffix(tfield) << ")Data"
         << " : default"
         << (target_net_version >= 6 ? "" : ("(" + type_name(tfield->get_type()) + ")"))
-        << ";" << endl;
+        << ";" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << endl;
+    out << indent() << "}" << '\n'
+        << '\n';
 
 
-    out << indent() << "public class " << normalize_name(tfield->get_name()) << " : " << normalize_name(tunion->get_name()) << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public class " << normalize_name(tfield->get_name()) << " : " << normalize_name(tunion->get_name()) << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "private readonly " << type_name(tfield->get_type()) << " _data;" << endl
-        << indent() << "public override object" << nullable_suffix() <<" Data { get { return _data; } }" << endl
-        << indent() << "public " << normalize_name(tfield->get_name()) << "(" << type_name(tfield->get_type()) << " data) : base("<< tfield->get_key() <<")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "private readonly " << type_name(tfield->get_type()) << " _data;" << '\n'
+        << indent() << "public override object" << nullable_suffix() <<" Data { get { return _data; } }" << '\n'
+        << indent() << "public " << normalize_name(tfield->get_name()) << "(" << type_name(tfield->get_type()) << " data) : base("<< tfield->get_key() <<")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "this._data = data;" << endl;
+    out << indent() << "this._data = data;" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 
     if( ! suppress_deepcopy) {
-        out << indent() << "public new " << normalize_name(tfield->get_name()) << " " << DEEP_COPY_METHOD_NAME << "()" << endl;
-        out << indent() << "{" << endl;
+        out << indent() << "public new " << normalize_name(tfield->get_name()) << " " << DEEP_COPY_METHOD_NAME << "()" << '\n';
+        out << indent() << "{" << '\n';
         indent_up();
         bool needs_typecast = false;
         string suffix("");
         string copy_op = get_deep_copy_method_call(tfield->get_type(), true, needs_typecast, suffix);
-        out << indent() << "return new " << normalize_name(tfield->get_name()) << "(_data" << copy_op << ");" << endl;
+        out << indent() << "return new " << normalize_name(tfield->get_name()) << "(_data" << copy_op << ");" << '\n';
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
     }
 
-    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
     if(target_net_version >= 6) {
-        out << indent() << "if (that is not " << tunion->get_name() << " other) return false;" << endl;
+        out << indent() << "if (that is not " << tunion->get_name() << " other) return false;" << '\n';
     } else {
-        out << indent() << "if (!(that is " << tunion->get_name() << " other)) return false;" << endl;
+        out << indent() << "if (!(that is " << tunion->get_name() << " other)) return false;" << '\n';
     }
-    out << indent() << "if (ReferenceEquals(this, other)) return true;" << endl;
-    out << endl;
-    out << indent() << "return Equals( _data, other.As_" << tfield->get_name() << ");" << endl;
+    out << indent() << "if (ReferenceEquals(this, other)) return true;" << '\n';
+    out << '\n';
+    out << indent() << "return Equals( _data, other.As_" << tfield->get_name() << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
-    out << indent() << "public override int GetHashCode()" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public override int GetHashCode()" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "return _data.GetHashCode();" << endl;
+    out << indent() << "return _data.GetHashCode();" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
-    out << indent() << "public override async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ") {" << endl;
+    out << indent() << "public override async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ") {" << '\n';
     indent_up();
 
-    out << indent() << "oprot.IncrementRecursionDepth();" << endl
-        << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "oprot.IncrementRecursionDepth();" << '\n'
+        << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "var struc = new TStruct(\"" << tunion->get_name() << "\");" << endl
-        << indent() << "await oprot.WriteStructBeginAsync(struc, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "var struc = new TStruct(\"" << tunion->get_name() << "\");" << '\n'
+        << indent() << "await oprot.WriteStructBeginAsync(struc, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
-    out << indent() << "var field = new TField()" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "var field = new TField()" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "Name = \"" << tfield->get_name() << "\"," << endl
-        << indent() << "Type = " << type_to_enum(tfield->get_type()) << "," << endl
-        << indent() << "ID = " << tfield->get_key() << endl;
+    out << indent() << "Name = \"" << tfield->get_name() << "\"," << '\n'
+        << indent() << "Type = " << type_to_enum(tfield->get_type()) << "," << '\n'
+        << indent() << "ID = " << tfield->get_key() << '\n';
     indent_down();
-    out << indent() << "};" << endl;
-    out << indent() << "await oprot.WriteFieldBeginAsync(field, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "};" << '\n';
+    out << indent() << "await oprot.WriteFieldBeginAsync(field, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     generate_serialize_field(out, tfield, "_data", true, false);
 
-    out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "await oprot.WriteFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.WriteFieldStopAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.WriteStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << indent() << "finally" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n'
+        << indent() << "finally" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "oprot.DecrementRecursionDepth();" << endl;
+    out << indent() << "oprot.DecrementRecursionDepth();" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_struct_equals(ostream& out, t_struct* tstruct)
 {
-    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public override bool Equals(object" << nullable_suffix() << " that)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
     if(target_net_version >= 6) {
-        out << indent() << "if (that is not " << type_name(tstruct,false) << " other) return false;" << endl;
+        out << indent() << "if (that is not " << type_name(tstruct,false) << " other) return false;" << '\n';
     } else {
-        out << indent() << "if (!(that is " << type_name(tstruct,false) << " other)) return false;" << endl;
+        out << indent() << "if (!(that is " << type_name(tstruct,false) << " other)) return false;" << '\n';
     }
-    out << indent() << "if (ReferenceEquals(this, other)) return true;" << endl;
+    out << indent() << "if (ReferenceEquals(this, other)) return true;" << '\n';
 
 
     const vector<t_field*>& fields = tstruct->get_members();
@@ -1853,7 +1853,7 @@
         }
         else
         {
-            out << endl;
+            out << '\n';
             out << indent() << "&& ";
         }
         if (!field_is_required((*f_iter)))
@@ -1879,25 +1879,25 @@
     }
     if (first)
     {
-        out << indent() << "return true;" << endl;
+        out << indent() << "return true;" << '\n';
     }
     else
     {
-        out << ";" << endl;
+        out << ";" << '\n';
         indent_down();
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_struct_hashcode(ostream& out, t_struct* tstruct)
 {
-    out << indent() << "public override int GetHashCode() {" << endl;
+    out << indent() << "public override int GetHashCode() {" << '\n';
     indent_up();
 
-    out << indent() << "int hashcode = 157;" << endl;
-    out << indent() << "unchecked {" << endl;
+    out << indent() << "int hashcode = 157;" << '\n';
+    out << indent() << "unchecked {" << '\n';
     indent_up();
 
     const vector<t_field*>& fields = tstruct->get_members();
@@ -1915,17 +1915,17 @@
         else {
             out << prop_name(*f_iter) << ".GetHashCode()";
         }
-        out << ";" << endl;
+        out << ";" << '\n';
 
         generate_null_check_end(out, *f_iter);
     }
 
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "return hashcode;" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "return hashcode;" << '\n';
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_service(t_service* tservice)
@@ -1937,13 +1937,13 @@
     f_service.open(f_service_name.c_str());
 
     reset_indent();
-    f_service << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << endl << endl;
+    f_service << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << '\n' << '\n';
 
     pragmas_and_directives(f_service);
     start_netstd_namespace(f_service);
 
-    f_service << indent() << "public partial class " << normalize_name(service_name_) << endl
-              << indent() << "{" << endl;
+    f_service << indent() << "public partial class " << normalize_name(service_name_) << '\n'
+              << indent() << "{" << '\n';
     indent_up();
 
     generate_service_interface(f_service, tservice);
@@ -1952,7 +1952,7 @@
     generate_service_helpers(f_service, tservice);
 
     indent_down();
-    f_service << indent() << "}" << endl;
+    f_service << indent() << "}" << '\n';
 
     end_netstd_namespace(f_service);
     f_service.close();
@@ -1970,18 +1970,18 @@
         extends_iface = " : " + extends + ".IAsync";
     }
 
-    //out << endl << endl;
+    //out << '\n' << '\n';
 
     generate_netstd_doc(out, tservice);
 
     if (is_wcf_enabled())
     {
-        out << indent() << "[ServiceContract(Namespace=\"" << wcf_namespace_ << "\")]" << endl;
+        out << indent() << "[ServiceContract(Namespace=\"" << wcf_namespace_ << "\")]" << '\n';
     }
 
     prepare_member_name_mapping(tservice);
-    out << indent() << "public interface IAsync" << extends_iface << endl
-        << indent() << "{" << endl;
+    out << indent() << "public interface IAsync" << extends_iface << '\n'
+        << indent() << "{" << '\n';
 
     indent_up();
     vector<t_function*> functions = tservice->get_functions();
@@ -1993,21 +1993,21 @@
         // if we're using WCF, add the corresponding attributes
         if (is_wcf_enabled())
         {
-            out << indent() << "[OperationContract]" << endl;
+            out << indent() << "[OperationContract]" << '\n';
 
             const vector<t_field*>& xceptions = (*f_iter)->get_xceptions()->get_members();
             vector<t_field*>::const_iterator x_iter;
             for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter)
             {
-                out << indent() << "[FaultContract(typeof(" + type_name((*x_iter)->get_type()) + "Fault))]" << endl;
+                out << indent() << "[FaultContract(typeof(" + type_name((*x_iter)->get_type()) + "Fault))]" << '\n';
             }
         }
 
         generate_deprecation_attribute(out, *f_iter);
-        out << indent() << function_signature_async(*f_iter) << ";" << endl << endl;
+        out << indent() << function_signature_async(*f_iter) << ";" << '\n' << '\n';
     }
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
     cleanup_member_name_mapping(tservice);
 }
 
@@ -2020,7 +2020,7 @@
     if ((iter->second.back().length() > 0) && (iter->second.back() != "1")) {
       out << "(" << make_csharp_string_literal(iter->second.back()) << ")";
     }
-    out << "]" << endl;
+    out << "]" << '\n';
   }
 }
 
@@ -2030,8 +2030,8 @@
     vector<t_function*>::iterator f_iter;
 
     prepare_member_name_mapping(tservice);
-    out << indent() << "public class InternalStructs" << endl;
-    out << indent() << "{" << endl;
+    out << indent() << "public class InternalStructs" << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter)
@@ -2043,7 +2043,7 @@
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
     cleanup_member_name_mapping(tservice);
 }
 
@@ -2061,22 +2061,22 @@
         extends_client = "TBaseClient, IDisposable, ";
     }
 
-    out << endl;
+    out << '\n';
 
     generate_netstd_doc(out, tservice);
     prepare_member_name_mapping(tservice);
-    out << indent() << "public class Client : " << extends_client << "IAsync" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public class Client : " << extends_client << "IAsync" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "public Client(TProtocol protocol) : this(protocol, protocol)" << endl
-        << indent() << "{" << endl
-        << indent() << "}" << endl
-        << endl
-        << indent() << "public Client(TProtocol inputProtocol, TProtocol outputProtocol) : base(inputProtocol, outputProtocol)" << endl
-        << indent() << "{" << endl
-        << indent() << "}" << endl
-        << endl;
+    out << indent() << "public Client(TProtocol protocol) : this(protocol, protocol)" << '\n'
+        << indent() << "{" << '\n'
+        << indent() << "}" << '\n'
+        << '\n'
+        << indent() << "public Client(TProtocol inputProtocol, TProtocol outputProtocol) : base(inputProtocol, outputProtocol)" << '\n'
+        << indent() << "{" << '\n'
+        << indent() << "}" << '\n'
+        << '\n';
 
     vector<t_function*> functions = tservice->get_functions();
     vector<t_function*>::const_iterator functions_iterator;
@@ -2088,26 +2088,26 @@
 
         // async
         generate_deprecation_attribute(out, *functions_iterator);
-        out << indent() << "public async " << function_signature_async(*functions_iterator, "") << endl
-            << indent() << "{" << endl;
+        out << indent() << "public async " << function_signature_async(*functions_iterator, "") << '\n'
+            << indent() << "{" << '\n';
         indent_up();
         out << indent() << "await send_" << function_name << "(";
         string call_args = argument_list((*functions_iterator)->get_arglist(),false);
         if(! call_args.empty()) {
             out << call_args << ", ";
         }
-        out << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << CANCELLATION_TOKEN_NAME << ");" << '\n';
         if(! (*functions_iterator)->is_oneway()) {
             out << indent() << ((*functions_iterator)->get_returntype()->is_void() ? "" : "return ")
-                            << "await recv_" << function_name << "(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+                            << "await recv_" << function_name << "(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
         }
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
 
         // async send
         generate_deprecation_attribute(out, *functions_iterator);
-        out << indent() << "public async " << function_signature_async(*functions_iterator, "send_", MODE_NO_RETURN) << endl
-            << indent() << "{" << endl;
+        out << indent() << "public async " << function_signature_async(*functions_iterator, "send_", MODE_NO_RETURN) << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
         string tmpvar = tmp("tmp");
@@ -2115,9 +2115,9 @@
 
         out << indent() << "await OutputProtocol.WriteMessageBeginAsync(new TMessage(\"" << raw_func_name
             << "\", TMessageType." << ((*functions_iterator)->is_oneway() ? "Oneway" : "Call")
-            << ", SeqId), " << CANCELLATION_TOKEN_NAME << ");" << endl
-            << indent() << endl
-            << indent() << "var " << tmpvar << " = new InternalStructs." << argsname << "() {" << endl;
+            << ", SeqId), " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+            << indent() << '\n'
+            << indent() << "var " << tmpvar << " = new InternalStructs." << argsname << "() {" << '\n';
         indent_up();
 
         t_struct* arg_struct = (*functions_iterator)->get_arglist();
@@ -2128,27 +2128,27 @@
 
         for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter)
         {
-            out << indent() << prop_name(*fld_iter) << " = " << normalize_name((*fld_iter)->get_name(),true) << "," << endl;
+            out << indent() << prop_name(*fld_iter) << " = " << normalize_name((*fld_iter)->get_name(),true) << "," << '\n';
         }
 
         indent_down();
-        out << indent() << "};" << endl;
+        out << indent() << "};" << '\n';
 
 
-        out << indent() << endl
-            << indent() << "await " << tmpvar << ".WriteAsync(OutputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << endl
-            << indent() << "await OutputProtocol.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-            << indent() << "await OutputProtocol.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << '\n'
+            << indent() << "await " << tmpvar << ".WriteAsync(OutputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+            << indent() << "await OutputProtocol.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+            << indent() << "await OutputProtocol.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
 
         if (!(*functions_iterator)->is_oneway())
         {
             // async recv
             generate_deprecation_attribute(out, *functions_iterator);
-            out << indent() << "public async " << function_signature_async(*functions_iterator, "recv_", MODE_NO_ARGS) << endl
-                << indent() << "{" << endl;
+            out << indent() << "public async " << function_signature_async(*functions_iterator, "recv_", MODE_NO_ARGS) << '\n'
+                << indent() << "{" << '\n';
             indent_up();
 
             string resultname = (*functions_iterator)->get_name() + "_result";
@@ -2158,64 +2158,64 @@
             prepare_member_name_mapping(xs, xs->get_members(), resultname);
 
             tmpvar = tmp("tmp");
-            out << indent() << endl
-                << indent() << "var " << tmpvar << " = await InputProtocol.ReadMessageBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-                << indent() << "if (" << tmpvar << ".Type == TMessageType.Exception)" << endl
-                << indent() << "{" << endl;
+            out << indent() << '\n'
+                << indent() << "var " << tmpvar << " = await InputProtocol.ReadMessageBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+                << indent() << "if (" << tmpvar << ".Type == TMessageType.Exception)" << '\n'
+                << indent() << "{" << '\n';
             indent_up();
 
             tmpvar = tmp("tmp");
-            out << indent() << "var " << tmpvar << " = await TApplicationException.ReadAsync(InputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << endl
-                << indent() << "await InputProtocol.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-                << indent() << "throw " << tmpvar << ";" << endl;
+            out << indent() << "var " << tmpvar << " = await TApplicationException.ReadAsync(InputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+                << indent() << "await InputProtocol.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+                << indent() << "throw " << tmpvar << ";" << '\n';
             indent_down();
 
             tmpvar = tmp("tmp");
-            out << indent() << "}" << endl
-                << endl
-                << indent() << "var " << tmpvar << " = new InternalStructs." << resultname << "();" << endl
-                << indent() << "await " << tmpvar << ".ReadAsync(InputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << endl
-                << indent() << "await InputProtocol.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+            out << indent() << "}" << '\n'
+                << '\n'
+                << indent() << "var " << tmpvar << " = new InternalStructs." << resultname << "();" << '\n'
+                << indent() << "await " << tmpvar << ".ReadAsync(InputProtocol, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+                << indent() << "await InputProtocol.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
             if (!(*functions_iterator)->get_returntype()->is_void())
             {
-                out << indent() << "if (" << tmpvar << ".__isset.success)" << endl
-                    << indent() << "{" << endl;
+                out << indent() << "if (" << tmpvar << ".__isset.success)" << '\n'
+                    << indent() << "{" << '\n';
                 indent_up();
                 string nullable_value = nullable_value_access((*functions_iterator)->get_returntype());
-                out << indent() << "return " << tmpvar << ".Success" << nullable_value << ";" << endl;
+                out << indent() << "return " << tmpvar << ".Success" << nullable_value << ";" << '\n';
                 indent_down();
-                out << indent() << "}" << endl;
+                out << indent() << "}" << '\n';
             }
 
             const vector<t_field*>& xceptions = xs->get_members();
             vector<t_field*>::const_iterator x_iter;
             for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter)
             {
-                out << indent() << "if (" << tmpvar << ".__isset." << get_isset_name(normalize_name((*x_iter)->get_name())) << ")" << endl
-                    << indent() << "{" << endl;
+                out << indent() << "if (" << tmpvar << ".__isset." << get_isset_name(normalize_name((*x_iter)->get_name())) << ")" << '\n'
+                    << indent() << "{" << '\n';
                 indent_up();
-                out << indent() << "throw " << tmpvar << "." << prop_name(*x_iter) << nullable_value_access((*x_iter)->get_type()) << ";" << endl;
+                out << indent() << "throw " << tmpvar << "." << prop_name(*x_iter) << nullable_value_access((*x_iter)->get_type()) << ";" << '\n';
                 indent_down();
-                out << indent() << "}" << endl;
+                out << indent() << "}" << '\n';
             }
 
             if (!(*functions_iterator)->get_returntype()->is_void())
             {
                 out << indent() << "throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, \""
-                    << function_name << " failed: unknown result\");" << endl;
+                    << function_name << " failed: unknown result\");" << '\n';
             }
 
             cleanup_member_name_mapping(xs);
             indent_down();
-            out << indent() << "}" << endl << endl;
+            out << indent() << "}" << '\n' << '\n';
         }
 
         cleanup_member_name_mapping(arg_struct);
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
     cleanup_member_name_mapping(tservice);
 }
 
@@ -2233,14 +2233,14 @@
     }
 
     prepare_member_name_mapping(tservice);
-    out << indent() << "public class AsyncProcessor : " << extends_processor << "ITAsyncProcessor" << endl
-        << indent() << "{" << endl;
+    out << indent() << "public class AsyncProcessor : " << extends_processor << "ITAsyncProcessor" << '\n'
+        << indent() << "{" << '\n';
 
     indent_up();
 
-    out << indent() << "private readonly IAsync _iAsync;" << endl
-        << indent() << "private readonly ILogger<AsyncProcessor>" << nullable_suffix() << " _logger;" << endl
-        << endl
+    out << indent() << "private readonly IAsync _iAsync;" << '\n'
+        << indent() << "private readonly ILogger<AsyncProcessor>" << nullable_suffix() << " _logger;" << '\n'
+        << '\n'
         << indent() << "public AsyncProcessor(IAsync iAsync, ILogger<AsyncProcessor>" << nullable_suffix() << " logger = default)";
 
     if (!extends.empty())
@@ -2248,101 +2248,101 @@
         out << " : base(iAsync)";
     }
 
-    out << endl
-        << indent() << "{" << endl;
+    out << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
-    out << indent() << "_iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));" << endl;
-    out << indent() << "_logger = logger;" << endl;
+    out << indent() << "_iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));" << '\n';
+    out << indent() << "_logger = logger;" << '\n';
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter)
     {
         string raw_func_name = (*f_iter)->get_name();
-        out << indent() << "processMap_[\"" << raw_func_name << "\"] = " << raw_func_name << "_ProcessAsync;" << endl;
+        out << indent() << "processMap_[\"" << raw_func_name << "\"] = " << raw_func_name << "_ProcessAsync;" << '\n';
     }
 
     indent_down();
-    out << indent() << "}" << endl
-        << endl;
+    out << indent() << "}" << '\n'
+        << '\n';
 
     if (extends.empty())
     {
-        out << indent() << "protected delegate global::System.Threading.Tasks.Task ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "protected delegate global::System.Threading.Tasks.Task ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 
     if (extends.empty())
     {
         out << indent() << "protected Dictionary<string, ProcessFunction> processMap_ = ";
         if(target_net_version >= 8) {
-          out << "[];" << endl;
+          out << "[];" << '\n';
         } else if(target_net_version >= 6) {
-          out << "new();" << endl;
+          out << "new();" << '\n';
         } else {
-          out << "new Dictionary<string, ProcessFunction>();" << endl;
+          out << "new Dictionary<string, ProcessFunction>();" << '\n';
         }
     }
 
-    out << endl;
+    out << '\n';
 
     if (extends.empty())
     {
-        out << indent() << "public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot)" << endl
-            << indent() << "{" << endl;
+        out << indent() << "public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot)" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
-        out << indent() << "return await ProcessAsync(iprot, oprot, CancellationToken.None);" << endl;
+        out << indent() << "return await ProcessAsync(iprot, oprot, CancellationToken.None);" << '\n';
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
 
-        out << indent() << "public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl;
+        out << indent() << "public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n';
     }
     else
     {
-        out << indent() << "public new async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot)" << endl
-            << indent() << "{" << endl;
+        out << indent() << "public new async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot)" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
-        out << indent() << "return await ProcessAsync(iprot, oprot, CancellationToken.None);" << endl;
+        out << indent() << "return await ProcessAsync(iprot, oprot, CancellationToken.None);" << '\n';
         indent_down();
-        out << indent() << "}" << endl << endl;
+        out << indent() << "}" << '\n' << '\n';
 
-        out << indent() << "public new async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl;
+        out << indent() << "public new async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n';
     }
 
-    out << indent() << "{" << endl;
+    out << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "var msg = await iprot.ReadMessageBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << endl
-        << indent() << "processMap_.TryGetValue(msg.Name, out var fn);" << endl
-        << endl
-        << indent() << "if (fn == null)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "var msg = await iprot.ReadMessageBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << '\n'
+        << indent() << "processMap_.TryGetValue(msg.Name, out var fn);" << '\n'
+        << '\n'
+        << indent() << "if (fn == null)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "await TProtocolUtil.SkipAsync(iprot, TType.Struct, " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await iprot.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "var x = new TApplicationException (TApplicationException.ExceptionType.UnknownMethod, \"Invalid method name: '\" + msg.Name + \"'\");" << endl
-        << indent() << "await oprot.WriteMessageBeginAsync(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID), " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await x.WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await oprot.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "return true;" << endl;
+    out << indent() << "await TProtocolUtil.SkipAsync(iprot, TType.Struct, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await iprot.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "var x = new TApplicationException (TApplicationException.ExceptionType.UnknownMethod, \"Invalid method name: '\" + msg.Name + \"'\");" << '\n'
+        << indent() << "await oprot.WriteMessageBeginAsync(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID), " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await x.WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await oprot.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "return true;" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << endl
-        << indent() << "await fn(msg.SeqID, iprot, oprot, " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << endl;
+    out << indent() << "}" << '\n'
+        << '\n'
+        << indent() << "await fn(msg.SeqID, iprot, oprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << '\n';
     indent_down();
-    out << indent() << "}" << endl;
-    out << indent() << "catch (IOException)" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n';
+    out << indent() << "catch (IOException)" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
-    out << indent() << "return false;" << endl;
+    out << indent() << "return false;" << '\n';
     indent_down();
-    out << indent() << "}" << endl
-        << endl
-        << indent() << "return true;" << endl;
+    out << indent() << "}" << '\n'
+        << '\n'
+        << indent() << "return true;" << '\n';
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter)
     {
@@ -2350,7 +2350,7 @@
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
     cleanup_member_name_mapping(tservice);
 }
 
@@ -2384,26 +2384,26 @@
 {
     (void)tservice;
     out << indent() << "public async global::System.Threading.Tasks.Task " << tfunction->get_name()
-        << "_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl
-        << indent() << "{" << endl;
+        << "_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     string argsname = tfunction->get_name() + "_args";
     string resultname = tfunction->get_name() + "_result";
 
     string args = tmp("tmp");
-    out << indent() << "var " << args << " = new InternalStructs." << argsname << "();" << endl
-        << indent() << "await " << args << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << endl
-        << indent() << "await iprot.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "var " << args << " = new InternalStructs." << argsname << "();" << '\n'
+        << indent() << "await " << args << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+        << indent() << "await iprot.ReadMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     string tmpResult = tmp("tmp");
     if (!tfunction->is_oneway())
     {
-        out << indent() << "var " << tmpResult << " = new InternalStructs." << resultname << "();" << endl;
+        out << indent() << "var " << tmpResult << " = new InternalStructs." << resultname << "();" << '\n';
     }
 
-    out << indent() << "try" << endl
-        << indent() << "{" << endl;
+    out << indent() << "try" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     t_struct* xs = tfunction->get_xceptions();
@@ -2411,8 +2411,8 @@
 
     if (xceptions.size() > 0)
     {
-        out << indent() << "try" << endl
-            << indent() << "{" << endl;
+        out << indent() << "try" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
     }
 
@@ -2422,7 +2422,7 @@
 
     bool is_deprecated = (tfunction->annotations_.end() != tfunction->annotations_.find("deprecated"));
     if( is_deprecated) {
-      out << indent() << "#pragma warning disable CS0618,CS0612" << endl;
+      out << indent() << "#pragma warning disable CS0618,CS0612" << '\n';
     }
 
     out << indent();
@@ -2457,10 +2457,10 @@
         out << ", ";
     }
 
-    out << "" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << "" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
     if( is_deprecated) {
-      out << indent() << "#pragma warning restore CS0618,CS0612" << endl;
+      out << indent() << "#pragma warning restore CS0618,CS0612" << '\n';
     }
 
     vector<t_field*>::const_iterator x_iter;
@@ -2470,76 +2470,76 @@
     if (xceptions.size() > 0)
     {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
 
         for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter)
         {
             string tmpex = tmp("tmp");
-            out << indent() << "catch (" << type_name((*x_iter)->get_type()) << " " << tmpex << ")" << endl
-                << indent() << "{" << endl;
+            out << indent() << "catch (" << type_name((*x_iter)->get_type()) << " " << tmpex << ")" << '\n'
+                << indent() << "{" << '\n';
 
             if (!tfunction->is_oneway())
             {
                 indent_up();
-                out << indent() << tmpResult << "." << prop_name(*x_iter) << " = " << tmpex << ";" << endl;
+                out << indent() << tmpResult << "." << prop_name(*x_iter) << " = " << tmpex << ";" << '\n';
                 indent_down();
             }
-            out << indent() << "}" << endl;
+            out << indent() << "}" << '\n';
         }
     }
 
     if (!tfunction->is_oneway())
     {
         out << indent() << "await oprot.WriteMessageBeginAsync(new TMessage(\""
-                << tfunction->get_name() << "\", TMessageType.Reply, seqid), " << CANCELLATION_TOKEN_NAME << "); " << endl
-            << indent() << "await " << tmpResult << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+                << tfunction->get_name() << "\", TMessageType.Reply, seqid), " << CANCELLATION_TOKEN_NAME << "); " << '\n'
+            << indent() << "await " << tmpResult << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     indent_down();
 
     cleanup_member_name_mapping(xs);
 
     string tmpex = tmp("tmp");
-    out << indent() << "}" << endl
-        << indent() << "catch (TTransportException)" << endl
-        << indent() << "{" << endl
-        << indent() << "  throw;" << endl
-        << indent() << "}" << endl
-        << indent() << "catch (Exception " << tmpex << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "}" << '\n'
+        << indent() << "catch (TTransportException)" << '\n'
+        << indent() << "{" << '\n'
+        << indent() << "  throw;" << '\n'
+        << indent() << "}" << '\n'
+        << indent() << "catch (Exception " << tmpex << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     string tmpvar = tmp("tmp");
-    out << indent() << "var " << tmpvar << " = $\"Error occurred in {GetType().FullName}: {" << tmpex << ".Message}\";" << endl;
-    out << indent() << "if(_logger != null)" << endl;
+    out << indent() << "var " << tmpvar << " = $\"Error occurred in {GetType().FullName}: {" << tmpex << ".Message}\";" << '\n';
+    out << indent() << "if(_logger != null)" << '\n';
     indent_up();
-    out << indent() << "_logger.LogError(\"{Exception}, {Message}\", " << tmpex << ", " << tmpvar << ");" << endl;
+    out << indent() << "_logger.LogError(\"{Exception}, {Message}\", " << tmpex << ", " << tmpvar << ");" << '\n';
     indent_down();
-    out << indent() << "else" << endl;
+    out << indent() << "else" << '\n';
     indent_up();
-    out << indent() << "Console.Error.WriteLine(" << tmpvar << ");" << endl;
+    out << indent() << "Console.Error.WriteLine(" << tmpvar << ");" << '\n';
     indent_down();
 
     if (tfunction->is_oneway())
     {
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
     }
     else
     {
         tmpvar = tmp("tmp");
-        out << indent() << "var " << tmpvar << " = new TApplicationException(TApplicationException.ExceptionType.InternalError,\" Internal error.\");" << endl
+        out << indent() << "var " << tmpvar << " = new TApplicationException(TApplicationException.ExceptionType.InternalError,\" Internal error.\");" << '\n'
             << indent() << "await oprot.WriteMessageBeginAsync(new TMessage(\"" << tfunction->get_name()
-            << "\", TMessageType.Exception, seqid), " << CANCELLATION_TOKEN_NAME << ");" << endl
-            << indent() << "await " << tmpvar << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+            << "\", TMessageType.Exception, seqid), " << CANCELLATION_TOKEN_NAME << ");" << '\n'
+            << indent() << "await " << tmpvar << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
         indent_down();
 
-        out << indent() << "}" << endl
-            << indent() << "await oprot.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl
-            << indent() << "await oprot.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "}" << '\n'
+            << indent() << "await oprot.WriteMessageEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n'
+            << indent() << "await oprot.Transport.FlushAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 
     indent_down();
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_netstd_union_reader(ostream& out, t_struct* tunion)
@@ -2548,76 +2548,76 @@
     const vector<t_field*>& fields = tunion->get_members();
     vector<t_field*>::const_iterator f_iter;
 
-    out << indent() << "public static async Task<" << tunion->get_name() << "> ReadAsync(TProtocol iprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << endl;
+    out << indent() << "public static async Task<" << tunion->get_name() << "> ReadAsync(TProtocol iprot, CancellationToken " << CANCELLATION_TOKEN_NAME << ")" << '\n';
     scope_up(out);
 
-    out << indent() << "iprot.IncrementRecursionDepth();" << endl;
-    out << indent() << "try" << endl;
+    out << indent() << "iprot.IncrementRecursionDepth();" << '\n';
+    out << indent() << "try" << '\n';
     scope_up(out);
 
     string tmpRetval = tmp("tmp");
-    out << indent() << tunion->get_name() << " " << tmpRetval << ";" << endl;
-    out << indent() << "await iprot.ReadStructBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
-    out << indent() << "TField field = await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << tunion->get_name() << " " << tmpRetval << ";" << '\n';
+    out << indent() << "await iprot.ReadStructBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
+    out << indent() << "TField field = await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     // we cannot have the first field be a stop -- we must have a single field defined
-    out << indent() << "if (field.Type == TType.Stop)" << endl;
+    out << indent() << "if (field.Type == TType.Stop)" << '\n';
     scope_up(out);
-    out << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
-    out << indent() << "" << tmpRetval << " = new ___undefined();" << endl;
+    out << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
+    out << indent() << "" << tmpRetval << " = new ___undefined();" << '\n';
     scope_down(out);
-    out << indent() << "else" << endl;
+    out << indent() << "else" << '\n';
     scope_up(out);
-    out << indent() << "switch (field.ID)" << endl;
+    out << indent() << "switch (field.ID)" << '\n';
     scope_up(out);
 
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
     {
-        out << indent() << "case " << (*f_iter)->get_key() << ":" << endl;
+        out << indent() << "case " << (*f_iter)->get_key() << ":" << '\n';
         indent_up();
-        out << indent() << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+        out << indent() << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
         indent_up();
 
         string tmpvar = tmp("tmp");
-        out << indent() << type_name((*f_iter)->get_type()) << " " << tmpvar << ";" << endl;
+        out << indent() << type_name((*f_iter)->get_type()) << " " << tmpvar << ";" << '\n';
         generate_deserialize_field(out, (*f_iter), tmpvar, true);
-        out << indent() << tmpRetval << " = new " << (*f_iter)->get_name() << "(" << tmpvar << ");" << endl;
+        out << indent() << tmpRetval << " = new " << (*f_iter)->get_name() << "(" << tmpvar << ");" << '\n';
 
         indent_down();
-        out << indent() << "} else { " << endl << indent() << " await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");"
-            << endl << indent() << "  " << tmpRetval << " = new ___undefined();" << endl << indent() << "}" << endl
-            << indent() << "break;" << endl;
+        out << indent() << "} else { " << '\n' << indent() << " await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");"
+            << '\n' << indent() << "  " << tmpRetval << " = new ___undefined();" << '\n' << indent() << "}" << '\n'
+            << indent() << "break;" << '\n';
         indent_down();
     }
 
-    out << indent() << "default: " << endl;
+    out << indent() << "default: " << '\n';
     indent_up();
-    out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << endl << indent()
-        << tmpRetval << " = new ___undefined();" << endl;
-    out << indent() << "break;" << endl;
+    out << indent() << "await TProtocolUtil.SkipAsync(iprot, field.Type, " << CANCELLATION_TOKEN_NAME << ");" << '\n' << indent()
+        << tmpRetval << " = new ___undefined();" << '\n';
+    out << indent() << "break;" << '\n';
     indent_down();
 
     scope_down(out);
 
-    out << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "await iprot.ReadFieldEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
 
-    out << indent() << "if ((await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ")).Type != TType.Stop)" << endl;
+    out << indent() << "if ((await iprot.ReadFieldBeginAsync(" << CANCELLATION_TOKEN_NAME << ")).Type != TType.Stop)" << '\n';
     scope_up(out);
-    out << indent() << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << endl;
+    out << indent() << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << '\n';
     scope_down(out);
 
     // end of else for TStop
     scope_down(out);
-    out << indent() << "await iprot.ReadStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
-    out << indent() << "return " << tmpRetval << ";" << endl;
+    out << indent() << "await iprot.ReadStructEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
+    out << indent() << "return " << tmpRetval << ";" << '\n';
     indent_down();
 
     scope_down(out);
-    out << indent() << "finally" << endl;
+    out << indent() << "finally" << '\n';
     scope_up(out);
-    out << indent() << "iprot.DecrementRecursionDepth();" << endl;
+    out << indent() << "iprot.DecrementRecursionDepth();" << '\n';
     scope_down(out);
 
-    out << indent() << "}" << endl << endl;
+    out << indent() << "}" << '\n' << '\n';
 }
 
 void t_netstd_generator::generate_deserialize_field(ostream& out, t_field* tfield, string prefix, bool is_propertyless)
@@ -2698,7 +2698,7 @@
         {
             out << "ReadI32Async(" << CANCELLATION_TOKEN_NAME << ");";
         }
-        out << endl;
+        out << '\n';
     }
     else
     {
@@ -2710,18 +2710,18 @@
 {
     if (is_union_enabled() && tstruct->is_union())
     {
-        out << indent() << prefix << " = await " << type_name(tstruct) << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << prefix << " = await " << type_name(tstruct) << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else
     {
-        out << indent() << prefix << " = new " << type_name(tstruct) << "();" << endl
-            << indent() << "await " << prefix << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << prefix << " = new " << type_name(tstruct) << "();" << '\n'
+            << indent() << "await " << prefix << ".ReadAsync(iprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 }
 
 void t_netstd_generator::generate_deserialize_container(ostream& out, t_type* ttype, string prefix)
 {
-    out << indent() << "{" << endl;
+    out << indent() << "{" << '\n';
     indent_up();
 
     string obj;
@@ -2741,21 +2741,21 @@
 
     if (ttype->is_map())
     {
-        out << indent() << "var " << obj << " = await iprot.ReadMapBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "var " << obj << " = await iprot.ReadMapBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_set())
     {
-        out << indent() << "var " << obj << " = await iprot.ReadSetBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "var " << obj << " = await iprot.ReadSetBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_list())
     {
-        out << indent() << "var " << obj << " = await iprot.ReadListBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "var " << obj << " = await iprot.ReadListBeginAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 
-    out << indent() << prefix << " = new " << type_name(ttype) << "(" << obj << ".Count);" << endl;
+    out << indent() << prefix << " = new " << type_name(ttype) << "(" << obj << ".Count);" << '\n';
     string i = tmp("_i");
-    out << indent() << "for(int " << i << " = 0; " << i << " < " << obj << ".Count; ++" << i << ")" << endl
-        << indent() << "{" << endl;
+    out << indent() << "for(int " << i << " = 0; " << i << " < " << obj << ".Count; ++" << i << ")" << '\n'
+        << indent() << "{" << '\n';
     indent_up();
 
     if (ttype->is_map())
@@ -2772,23 +2772,23 @@
     }
 
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 
     if (ttype->is_map())
     {
-        out << indent() << "await iprot.ReadMapEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await iprot.ReadMapEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_set())
     {
-        out << indent() << "await iprot.ReadSetEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await iprot.ReadSetEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_list())
     {
-        out << indent() << "await iprot.ReadListEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await iprot.ReadListEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 }
 
 void t_netstd_generator::generate_deserialize_map_element(ostream& out, t_map* tmap, string prefix)
@@ -2799,13 +2799,13 @@
     t_field fkey(tmap->get_key_type(), key);
     t_field fval(tmap->get_val_type(), val);
 
-    out << indent() << declare_field(&fkey, false, false) << endl;
-    out << indent() << declare_field(&fval, false, false) << endl;
+    out << indent() << declare_field(&fkey, false, false) << '\n';
+    out << indent() << declare_field(&fval, false, false) << '\n';
 
     generate_deserialize_field(out, &fkey);
     generate_deserialize_field(out, &fval);
 
-    out << indent() << prefix << "[" << key << "] = " << val << ";" << endl;
+    out << indent() << prefix << "[" << key << "] = " << val << ";" << '\n';
 }
 
 void t_netstd_generator::generate_deserialize_set_element(ostream& out, t_set* tset, string prefix)
@@ -2813,11 +2813,11 @@
     string elem = tmp("_elem");
     t_field felem(tset->get_elem_type(), elem);
 
-    out << indent() << declare_field(&felem, false, false) << endl;
+    out << indent() << declare_field(&felem, false, false) << '\n';
 
     generate_deserialize_field(out, &felem);
 
-    out << indent() << prefix << ".Add(" << elem << ");" << endl;
+    out << indent() << prefix << ".Add(" << elem << ");" << '\n';
 }
 
 void t_netstd_generator::generate_deserialize_list_element(ostream& out, t_list* tlist, string prefix)
@@ -2825,11 +2825,11 @@
     string elem = tmp("_elem");
     t_field felem(tlist->get_elem_type(), elem);
 
-    out << indent() << declare_field(&felem, false, false) << endl;
+    out << indent() << declare_field(&felem, false, false) << '\n';
 
     generate_deserialize_field(out, &felem);
 
-    out << indent() << prefix << ".Add(" << elem << ");" << endl;
+    out << indent() << prefix << ".Add(" << elem << ");" << '\n';
 }
 
 void t_netstd_generator::generate_serialize_field(ostream& out, t_field* tfield, string prefix, bool is_propertyless, bool allow_nullable)
@@ -2904,7 +2904,7 @@
         {
             out << "WriteI32Async((int)" << name << ", " << CANCELLATION_TOKEN_NAME << ");";
         }
-        out << endl;
+        out << '\n';
     }
     else
     {
@@ -2915,7 +2915,7 @@
 void t_netstd_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix)
 {
     (void)tstruct;
-    out << indent() << "await " << prefix << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << endl;
+    out << indent() << "await " << prefix << ".WriteAsync(oprot, " << CANCELLATION_TOKEN_NAME << ");" << '\n';
 }
 
 void t_netstd_generator::generate_serialize_container(ostream& out, t_type* ttype, string prefix)
@@ -2924,18 +2924,18 @@
     {
         out << indent() << "await oprot.WriteMapBeginAsync(new TMap(" << type_to_enum(static_cast<t_map*>(ttype)->get_key_type())
             << ", " << type_to_enum(static_cast<t_map*>(ttype)->get_val_type()) << ", " << prefix
-            << ".Count), " << CANCELLATION_TOKEN_NAME << ");" << endl;
+            << ".Count), " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_set())
     {
         out << indent() << "await oprot.WriteSetBeginAsync(new TSet(" << type_to_enum(static_cast<t_set*>(ttype)->get_elem_type())
-            << ", " << prefix << ".Count), " << CANCELLATION_TOKEN_NAME << ");" << endl;
+            << ", " << prefix << ".Count), " << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_list())
     {
         out << indent() << "await oprot.WriteListBeginAsync(new TList("
             << type_to_enum(static_cast<t_list*>(ttype)->get_elem_type()) << ", " << prefix << ".Count), " << CANCELLATION_TOKEN_NAME << ");"
-            << endl;
+            << '\n';
     }
 
     string iter = tmp("_iter");
@@ -2955,8 +2955,8 @@
             << " in " << prefix << ")";
     }
 
-    out << endl;
-    out << indent() << "{" << endl;
+    out << '\n';
+    out << indent() << "{" << '\n';
     indent_up();
 
     if (ttype->is_map())
@@ -2973,19 +2973,19 @@
     }
 
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
 
     if (ttype->is_map())
     {
-        out << indent() << "await oprot.WriteMapEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await oprot.WriteMapEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_set())
     {
-        out << indent() << "await oprot.WriteSetEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await oprot.WriteSetEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
     else if (ttype->is_list())
     {
-        out << indent() << "await oprot.WriteListEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << endl;
+        out << indent() << "await oprot.WriteListEndAsync(" << CANCELLATION_TOKEN_NAME << ");" << '\n';
     }
 }
 
@@ -3018,7 +3018,7 @@
 {
     if ((is_serialize_enabled() || is_wcf_enabled()) && isPublic)
     {
-        out << indent() << "[DataMember(Order = 0)]" << endl;
+        out << indent() << "[DataMember(Order = 0)]" << '\n';
     }
 
     out << indent()
@@ -3036,37 +3036,37 @@
         if( (target_net_version >= 6) && (!force_member_nullable(tfield))) {
             out << initialize_field(tfield) << ";";
         }
-        out << endl;
+        out << '\n';
     }
     else
     {
-        out << endl
-            << indent() << "{" << endl;
+        out << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
-        out << indent() << "get" << endl
-            << indent() << "{" << endl;
+        out << indent() << "get" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
-        out << indent() << "return " << fieldPrefix + tfield->get_name() << ";" << endl;
+        out << indent() << "return " << fieldPrefix + tfield->get_name() << ";" << '\n';
         indent_down();
-        out << indent() << "}" << endl
-            << indent() << "set" << endl
-            << indent() << "{" << endl;
+        out << indent() << "}" << '\n'
+            << indent() << "set" << '\n'
+            << indent() << "{" << '\n';
         indent_up();
 
         if (generateIsset)
         {
-            out << indent() << "__isset." << get_isset_name(normalize_name(tfield->get_name())) << " = true;" << endl;
+            out << indent() << "__isset." << get_isset_name(normalize_name(tfield->get_name())) << " = true;" << '\n';
         }
-        out << indent() << "this." << fieldPrefix + tfield->get_name() << " = value;" << endl;
+        out << indent() << "this." << fieldPrefix + tfield->get_name() << " = value;" << '\n';
 
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
     }
-    out << endl;
+    out << '\n';
 }
 
 string t_netstd_generator::make_csharp_string_literal( string const& value)
@@ -3749,14 +3749,14 @@
 
 void t_netstd_generator::generate_netstd_docstring_comment(ostream& out, string contents)
 {
-    docstring_comment(out, "/// <summary>" + endl, "/// ", contents, "/// </summary>" + endl);
+    docstring_comment(out, "/// <summary>" + string("\n"), "/// ", contents, "/// </summary>" + string("\n"));
 }
 
 void t_netstd_generator::generate_netstd_doc(ostream& out, t_field* field)
 {
     if (field->get_type()->is_enum())
     {
-        string combined_message = field->get_doc() + endl + "<seealso cref=\"" + get_enum_class_name(field->get_type()) + "\"/>";
+        string combined_message = field->get_doc() + "\n" + "<seealso cref=\"" + get_enum_class_name(field->get_type()) + "\"/>";
         generate_netstd_docstring_comment(out, combined_message);
     }
     else
@@ -3783,7 +3783,7 @@
         for (p_iter = fields.begin(); p_iter != fields.end(); ++p_iter)
         {
             t_field* p = *p_iter;
-            ps << endl << "<param name=\"" << p->get_name() << "\">";
+            ps << '\n' << "<param name=\"" << p->get_name() << "\">";
             if (p->has_doc())
             {
                 string str = p->get_doc();
@@ -3796,7 +3796,7 @@
         docstring_comment(out,
                                    "",
                                    "/// ",
-                                   "<summary>" + endl + tfunction->get_doc() + "</summary>" + ps.str(),
+                                   "<summary>" + string("\n") + tfunction->get_doc() + "</summary>" + ps.str(),
                                    "");
     }
 }
@@ -3818,11 +3818,11 @@
         // Just prnt a newline when the line & prefix are empty.
         if (strlen(line) == 0 && line_prefix == "" && !docs.eof())
         {
-            out << endl;
+            out << '\n';
         }
         else if (strlen(line) > 0 || !docs.eof())
         { // skip the empty last line
-            out << indent() << line_prefix << line << endl;
+            out << indent() << line_prefix << line << '\n';
         }
     }
     if (comment_end != "")
diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.h b/compiler/cpp/src/thrift/generate/t_netstd_generator.h
index ff3cfb1..a6e4d90 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.h
@@ -44,8 +44,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 static const string DEEP_COPY_METHOD_NAME = "DeepCopy";
 static const string CANCELLATION_TOKEN_NAME = "cancellationToken";
 
@@ -165,7 +163,7 @@
     comment += " */\n";
     return comment;
   }
-  
+
 
 private:
   string namespace_name_;
@@ -182,15 +180,15 @@
 
   const std::string CSHARP_KEYWORDS[101] = {
     // C# keywords
-    "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", 
-    "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally", 
-    "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "int", "interface", "internal", "is", "lock", 
-    "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected", 
-    "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", 
-    "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", 
-    "using", "virtual", "void", "volatile", "while", 
+    "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue",
+    "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally",
+    "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "int", "interface", "internal", "is", "lock",
+    "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected",
+    "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string",
+    "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort",
+    "using", "virtual", "void", "volatile", "while",
     // C# contextual keywords
-    "add", "alias", "ascending", "async", "await", "descending", "dynamic", "from", "get", "global", "group", "into", 
+    "add", "alias", "ascending", "async", "await", "descending", "dynamic", "from", "get", "global", "group", "into",
     "join", "let", "orderby", "partial", "remove", "select", "set", "value", "var", "when", "where", "yield"
   };
 
@@ -199,7 +197,7 @@
   vector<member_mapping_scope> member_mapping_scopes;
   map<string, t_type*> collected_extension_types;
   map<string, t_type*> checked_extension_types;
-  
+
   string normalize_name(string name, bool is_arg_name = false);
   string make_valid_csharp_identifier(string const& fromName);
   string make_csharp_string_literal( string const& value);
diff --git a/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc b/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc
index 5f9b80c..34dda40 100644
--- a/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_ocaml_generator.cc
@@ -38,8 +38,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * OCaml code generator.
  *
@@ -241,10 +239,10 @@
   f_consts_.open(f_consts_name.c_str());
 
   // Print header
-  f_types_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_types_i_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_consts_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl << "open "
-            << capitalize(program_name_) << "_types" << endl;
+  f_types_ << ocaml_autogen_comment() << '\n' << ocaml_imports() << '\n';
+  f_types_i_ << ocaml_autogen_comment() << '\n' << ocaml_imports() << '\n';
+  f_consts_ << ocaml_autogen_comment() << '\n' << ocaml_imports() << '\n' << "open "
+            << capitalize(program_name_) << "_types" << '\n';
 }
 
 /**
@@ -277,9 +275,9 @@
  */
 void t_ocaml_generator::generate_typedef(t_typedef* ttypedef) {
   f_types_ << indent() << "type " << decapitalize(ttypedef->get_symbolic()) << " = "
-           << render_ocaml_type(ttypedef->get_type()) << endl << endl;
+           << render_ocaml_type(ttypedef->get_type()) << '\n' << '\n';
   f_types_i_ << indent() << "type " << decapitalize(ttypedef->get_symbolic()) << " = "
-             << render_ocaml_type(ttypedef->get_type()) << endl << endl;
+             << render_ocaml_type(ttypedef->get_type()) << '\n' << '\n';
 }
 
 /**
@@ -289,46 +287,46 @@
  * @param tenum The enumeration
  */
 void t_ocaml_generator::generate_enum(t_enum* tenum) {
-  indent(f_types_) << "module " << capitalize(tenum->get_name()) << " = " << endl << "struct"
-                   << endl;
-  indent(f_types_i_) << "module " << capitalize(tenum->get_name()) << " : " << endl << "sig"
-                     << endl;
+  indent(f_types_) << "module " << capitalize(tenum->get_name()) << " = " << '\n' << "struct"
+                   << '\n';
+  indent(f_types_i_) << "module " << capitalize(tenum->get_name()) << " : " << '\n' << "sig"
+                     << '\n';
   indent_up();
-  indent(f_types_) << "type t = " << endl;
-  indent(f_types_i_) << "type t = " << endl;
+  indent(f_types_) << "type t = " << '\n';
+  indent(f_types_i_) << "type t = " << '\n';
   indent_up();
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << name << endl;
-    indent(f_types_i_) << "| " << name << endl;
+    indent(f_types_) << "| " << name << '\n';
+    indent(f_types_i_) << "| " << name << '\n';
   }
   indent_down();
 
-  indent(f_types_) << "let to_i = function" << endl;
-  indent(f_types_i_) << "val to_i : t -> Int32.t" << endl;
+  indent(f_types_) << "let to_i = function" << '\n';
+  indent(f_types_i_) << "val to_i : t -> Int32.t" << '\n';
   indent_up();
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << name << " -> " << value << "l" << endl;
+    indent(f_types_) << "| " << name << " -> " << value << "l" << '\n';
   }
   indent_down();
 
-  indent(f_types_) << "let of_i = function" << endl;
-  indent(f_types_i_) << "val of_i : Int32.t -> t" << endl;
+  indent(f_types_) << "let of_i = function" << '\n';
+  indent(f_types_i_) << "val of_i : Int32.t -> t" << '\n';
   indent_up();
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << value << "l -> " << name << endl;
+    indent(f_types_) << "| " << value << "l -> " << name << '\n';
   }
-  indent(f_types_) << "| _ -> raise Thrift_error" << endl;
+  indent(f_types_) << "| _ -> raise Thrift_error" << '\n';
   indent_down();
   indent_down();
-  indent(f_types_) << "end" << endl;
-  indent(f_types_i_) << "end" << endl;
+  indent(f_types_) << "end" << '\n';
+  indent(f_types_i_) << "end" << '\n';
 }
 
 /**
@@ -339,7 +337,7 @@
   string name = decapitalize(tconst->get_name());
   t_const_value* value = tconst->get_value();
 
-  indent(f_consts_) << "let " << name << " = " << render_const_value(type, value) << endl << endl;
+  indent(f_consts_) << "let " << name << " = " << render_const_value(type, value) << '\n' << '\n';
 }
 
 /**
@@ -395,9 +393,9 @@
   } else if (type->is_struct() || type->is_xception()) {
     string cname = type_name(type);
     string ct = tmp("_c");
-    out << endl;
+    out << '\n';
     indent_up();
-    indent(out) << "(let " << ct << " = new " << cname << " in" << endl;
+    indent(out) << "(let " << ct << " = new " << cname << " in" << '\n';
     indent_up();
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -417,7 +415,7 @@
       out << indent();
       out << ct << "#set_" << fname << " ";
       out << render_const_value(field_type, v_iter->second);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
     indent(out) << ct << ")";
     indent_down();
@@ -428,14 +426,14 @@
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     string hm = tmp("_hm");
-    out << endl;
+    out << '\n';
     indent_up();
-    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << endl;
+    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << '\n';
     indent_up();
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string key = render_const_value(ktype, v_iter->first);
       string val = render_const_value(vtype, v_iter->second);
-      indent(out) << "Hashtbl.add " << hm << " " << key << " " << val << ";" << endl;
+      indent(out) << "Hashtbl.add " << hm << " " << key << " " << val << ";" << '\n';
     }
     indent(out) << hm << ")";
     indent_down();
@@ -443,14 +441,14 @@
   } else if (type->is_list()) {
     t_type* etype;
     etype = ((t_list*)type)->get_elem_type();
-    out << "[" << endl;
+    out << "[" << '\n';
     indent_up();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       out << indent();
       out << render_const_value(etype, *v_iter);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
     indent_down();
     indent(out) << "]";
@@ -459,15 +457,15 @@
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     string hm = tmp("_hm");
-    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << endl;
+    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << '\n';
     indent_up();
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       string val = render_const_value(etype, *v_iter);
-      indent(out) << "Hashtbl.add " << hm << " " << val << " true;" << endl;
+      indent(out) << "Hashtbl.add " << hm << " " << val << " true;" << '\n';
     }
-    indent(out) << hm << ")" << endl;
+    indent(out) << hm << ")" << '\n';
     indent_down();
-    out << endl;
+    out << '\n';
   } else {
     throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
   }
@@ -503,15 +501,15 @@
   vector<t_field*>::const_iterator m_iter;
 
   /* Create a copy of the current object */
-  indent(out) << "method copy =" << endl;
+  indent(out) << "method copy =" << '\n';
   indent_up();
   indent_up();
-  indent(out) << "let _new = Oo.copy self in" << endl;
+  indent(out) << "let _new = Oo.copy self in" << '\n';
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
     generate_ocaml_member_copy(out, *m_iter);
 
   indent_down();
-  indent(out) << "_new" << endl;
+  indent(out) << "_new" << '\n';
   indent_down();
 }
 
@@ -564,10 +562,10 @@
   if (copy_of != grab_field) {
     indent(out);
     if (!struct_member_persistent(tmember)) {
-      out << "if _" << mname << " <> None then" << endl;
+      out << "if _" << mname << " <> None then" << '\n';
       indent(out) << "  ";
     }
-    out << "_new#set_" << mname << " " << copy_of << ";" << endl;
+    out << "_new#set_" << mname << " " << copy_of << ";" << '\n';
   }
 }
 
@@ -582,24 +580,24 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   string tname = type_name(tstruct);
-  indent(out) << "class " << tname << " =" << endl;
-  indent(out) << "object (self)" << endl;
+  indent(out) << "class " << tname << " =" << '\n';
+  indent(out) << "object (self)" << '\n';
 
   indent_up();
 
   if (members.size() > 0) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       generate_ocaml_struct_member(out, tname, (*m_iter));
-      out << endl;
+      out << '\n';
     }
   }
   generate_ocaml_method_copy(out, members);
   generate_ocaml_struct_writer(out, tstruct);
   indent_down();
-  indent(out) << "end" << endl;
+  indent(out) << "end" << '\n';
 
   if (is_exception) {
-    indent(out) << "exception " << capitalize(tname) << " of " << tname << endl;
+    indent(out) << "exception " << capitalize(tname) << " of " << tname << '\n';
   }
 
   generate_ocaml_struct_reader(out, tstruct);
@@ -621,37 +619,37 @@
   t_const_value* val = tmember->get_value();
   if (val) {
     if (struct_member_persistent(tmember))
-      out << " = " << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
+      out << " = " << render_const_value(tmember->get_type(), tmember->get_value()) << '\n';
     else
       out << " option = Some " << render_const_value(tmember->get_type(), tmember->get_value())
-          << endl;
+          << '\n';
   } else {
     // assert(!struct_member_persistent(tmember))
-    out << " option = None" << endl;
+    out << " option = None" << '\n';
   }
 
   if (struct_member_persistent(tmember)) {
-    indent(out) << "method get_" << mname << " = Some _" << mname << endl;
-    indent(out) << "method grab_" << mname << " = _" << mname << endl;
-    indent(out) << "method set_" << mname << " " << x << " = _" << mname << " <- " << x << endl;
+    indent(out) << "method get_" << mname << " = Some _" << mname << '\n';
+    indent(out) << "method grab_" << mname << " = _" << mname << '\n';
+    indent(out) << "method set_" << mname << " " << x << " = _" << mname << " <- " << x << '\n';
   } else {
-    indent(out) << "method get_" << mname << " = _" << mname << endl;
+    indent(out) << "method get_" << mname << " = _" << mname << '\n';
     indent(out) << "method grab_" << mname << " = match _" << mname
                 << " with None->raise (Field_empty \"" << tname << "." << mname << "\") | Some "
-                << x << " -> " << x << endl;
+                << x << " -> " << x << '\n';
     indent(out) << "method set_" << mname << " " << x << " = _" << mname << " <- Some " << x
-                << endl;
-    indent(out) << "method unset_" << mname << " = _" << mname << " <- None" << endl;
+                << '\n';
+    indent(out) << "method unset_" << mname << " = _" << mname << " <- None" << '\n';
   }
 
   indent(out) << "method reset_" << mname << " = _" << mname << " <- ";
   if (val) {
     if (struct_member_persistent(tmember))
-      out << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
+      out << render_const_value(tmember->get_type(), tmember->get_value()) << '\n';
     else
-      out << "Some " << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
+      out << "Some " << render_const_value(tmember->get_type(), tmember->get_value()) << '\n';
   } else {
-    out << "None" << endl;
+    out << "None" << '\n';
   }
 }
 
@@ -719,8 +717,8 @@
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   string tname = type_name(tstruct);
-  indent(out) << "class " << tname << " :" << endl;
-  indent(out) << "object ('a)" << endl;
+  indent(out) << "class " << tname << " :" << '\n';
+  indent(out) << "object ('a)" << '\n';
 
   indent_up();
 
@@ -729,24 +727,24 @@
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       string mname = decapitalize((*m_iter)->get_name());
       string type = render_ocaml_type((*m_iter)->get_type());
-      indent(out) << "method get_" << mname << " : " << type << " option" << endl;
-      indent(out) << "method grab_" << mname << " : " << type << endl;
-      indent(out) << "method set_" << mname << " : " << type << " -> unit" << endl;
+      indent(out) << "method get_" << mname << " : " << type << " option" << '\n';
+      indent(out) << "method grab_" << mname << " : " << type << '\n';
+      indent(out) << "method set_" << mname << " : " << type << " -> unit" << '\n';
       if (!struct_member_persistent(*m_iter))
-        indent(out) << "method unset_" << mname << " : unit" << endl;
-      indent(out) << "method reset_" << mname << " : unit" << endl;
+        indent(out) << "method unset_" << mname << " : unit" << '\n';
+      indent(out) << "method reset_" << mname << " : unit" << '\n';
     }
   }
-  indent(out) << "method copy : 'a" << endl;
-  indent(out) << "method write : Protocol.t -> unit" << endl;
+  indent(out) << "method copy : 'a" << '\n';
+  indent(out) << "method write : Protocol.t -> unit" << '\n';
   indent_down();
-  indent(out) << "end" << endl;
+  indent(out) << "end" << '\n';
 
   if (is_exception) {
-    indent(out) << "exception " << capitalize(tname) << " of " << tname << endl;
+    indent(out) << "exception " << capitalize(tname) << " of " << tname << '\n';
   }
 
-  indent(out) << "val read_" << tname << " : Protocol.t -> " << tname << endl;
+  indent(out) << "val read_" << tname << " : Protocol.t -> " << tname << '\n';
 }
 
 /**
@@ -759,55 +757,55 @@
   string str = tmp("_str");
   string t = tmp("_t");
   string id = tmp("_id");
-  indent(out) << "let rec read_" << sname << " (iprot : Protocol.t) =" << endl;
+  indent(out) << "let rec read_" << sname << " (iprot : Protocol.t) =" << '\n';
   indent_up();
-  indent(out) << "let " << str << " = new " << sname << " in" << endl;
+  indent(out) << "let " << str << " = new " << sname << " in" << '\n';
   indent_up();
-  indent(out) << "ignore(iprot#readStructBegin);" << endl;
+  indent(out) << "ignore(iprot#readStructBegin);" << '\n';
 
   // Loop over reading in fields
-  indent(out) << "(try while true do" << endl;
+  indent(out) << "(try while true do" << '\n';
   indent_up();
   indent_up();
 
   // Read beginning field marker
-  indent(out) << "let (_," << t << "," << id << ") = iprot#readFieldBegin in" << endl;
+  indent(out) << "let (_," << t << "," << id << ") = iprot#readFieldBegin in" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if " << t << " = Protocol.T_STOP then" << endl;
+  indent(out) << "if " << t << " = Protocol.T_STOP then" << '\n';
   indent_up();
-  indent(out) << "raise Break" << endl;
+  indent(out) << "raise Break" << '\n';
   indent_down();
-  indent(out) << "else ();" << endl;
+  indent(out) << "else ();" << '\n';
 
-  indent(out) << "(match " << id << " with " << endl;
+  indent(out) << "(match " << id << " with " << '\n';
   indent_up();
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     indent(out) << "| " << (*f_iter)->get_key() << " -> (";
-    out << "if " << t << " = " << type_to_enum((*f_iter)->get_type()) << " then" << endl;
+    out << "if " << t << " = " << type_to_enum((*f_iter)->get_type()) << " then" << '\n';
     indent_up();
     indent_up();
     generate_deserialize_field(out, *f_iter, str);
     indent_down();
-    out << indent() << "else" << endl << indent() << "  iprot#skip " << t << ")" << endl;
+    out << indent() << "else" << '\n' << indent() << "  iprot#skip " << t << ")" << '\n';
     indent_down();
   }
 
   // In the default case we skip the field
   out << indent() << "| _ -> "
-      << "iprot#skip " << t << ");" << endl;
+      << "iprot#skip " << t << ");" << '\n';
   indent_down();
   // Read field end marker
-  indent(out) << "iprot#readFieldEnd;" << endl;
+  indent(out) << "iprot#readFieldEnd;" << '\n';
   indent_down();
-  indent(out) << "done; ()" << endl;
+  indent(out) << "done; ()" << '\n';
   indent_down();
-  indent(out) << "with Break -> ());" << endl;
+  indent(out) << "with Break -> ());" << '\n';
 
-  indent(out) << "iprot#readStructEnd;" << endl;
+  indent(out) << "iprot#readStructEnd;" << '\n';
 
-  indent(out) << str << endl << endl;
+  indent(out) << str << '\n' << '\n';
   indent_down();
   indent_down();
 }
@@ -819,9 +817,9 @@
   string str = tmp("_str");
   string f = tmp("_f");
 
-  indent(out) << "method write (oprot : Protocol.t) =" << endl;
+  indent(out) << "method write (oprot : Protocol.t) =" << '\n';
   indent_up();
-  indent(out) << "oprot#writeStructBegin \"" << name << "\";" << endl;
+  indent(out) << "oprot#writeStructBegin \"" << name << "\";" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* tmember = (*f_iter);
@@ -835,10 +833,10 @@
         // Avoid redundant encoding of members having default values.
         indent(out) << "(match " << mname << " with "
                     << render_const_value(tmember->get_type(), tmember->get_value()) << " -> () | "
-                    << _v << " -> " << endl;
+                    << _v << " -> " << '\n';
       } else {
         _v = mname;
-        indent(out) << "(" << endl;
+        indent(out) << "(" << '\n';
       }
 
     } else {
@@ -853,12 +851,12 @@
           out << " | Some " << render_const_value(tmember->get_type(), tmember->get_value())
               << " -> ()";
         }
-        out << " | Some _v -> " << endl;
+        out << " | Some _v -> " << '\n';
       } else {
-        out << endl;
+        out << '\n';
         indent(out) << "| None -> raise (Field_empty \"" << type_name(tstruct) << "." << mname
-                    << "\")" << endl;
-        indent(out) << "| Some _v -> " << endl;
+                    << "\")" << '\n';
+        indent(out) << "| Some _v -> " << '\n';
       }
 
       _v = "_v";
@@ -866,20 +864,20 @@
     indent_up();
     // Write field header
     indent(out) << "oprot#writeFieldBegin(\"" << tmember->get_name() << "\","
-                << type_to_enum(tmember->get_type()) << "," << tmember->get_key() << ");" << endl;
+                << type_to_enum(tmember->get_type()) << "," << tmember->get_key() << ");" << '\n';
 
     // Write field contents
     generate_serialize_field(out, tmember, _v);
 
     // Write field closer
-    indent(out) << "oprot#writeFieldEnd" << endl;
+    indent(out) << "oprot#writeFieldEnd" << '\n';
 
     indent_down();
-    indent(out) << ");" << endl;
+    indent(out) << ");" << '\n';
   }
 
   // Write the struct map
-  out << indent() << "oprot#writeFieldStop;" << endl << indent() << "oprot#writeStructEnd" << endl;
+  out << indent() << "oprot#writeFieldStop;" << '\n' << indent() << "oprot#writeStructEnd" << '\n';
 
   indent_down();
 }
@@ -895,19 +893,19 @@
   string f_service_i_name = get_out_dir() + capitalize(service_name_) + ".mli";
   f_service_i_.open(f_service_i_name.c_str());
 
-  f_service_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_service_i_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
+  f_service_ << ocaml_autogen_comment() << '\n' << ocaml_imports() << '\n';
+  f_service_i_ << ocaml_autogen_comment() << '\n' << ocaml_imports() << '\n';
 
   /* if (tservice->get_extends() != nullptr) {
     f_service_ <<
-      "open " << capitalize(tservice->get_extends()->get_name()) << endl;
+      "open " << capitalize(tservice->get_extends()->get_name()) << '\n';
     f_service_i_ <<
-      "open " << capitalize(tservice->get_extends()->get_name()) << endl;
+      "open " << capitalize(tservice->get_extends()->get_name()) << '\n';
   }
   */
-  f_service_ << "open " << capitalize(program_name_) << "_types" << endl << endl;
+  f_service_ << "open " << capitalize(program_name_) << "_types" << '\n' << '\n';
 
-  f_service_i_ << "open " << capitalize(program_name_) << "_types" << endl << endl;
+  f_service_i_ << "open " << capitalize(program_name_) << "_types" << '\n' << '\n';
 
   // Generate the three main parts of the service
   generate_service_helpers(tservice);
@@ -925,7 +923,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  indent(f_service_) << "(* HELPER FUNCTIONS AND STRUCTURES *)" << endl << endl;
+  indent(f_service_) << "(* HELPER FUNCTIONS AND STRUCTURES *)" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -961,15 +959,15 @@
  * @param tservice The service to generate a header definition for
  */
 void t_ocaml_generator::generate_service_interface(t_service* tservice) {
-  f_service_ << indent() << "class virtual iface =" << endl << "object (self)" << endl;
-  f_service_i_ << indent() << "class virtual iface :" << endl << "object" << endl;
+  f_service_ << indent() << "class virtual iface =" << '\n' << "object (self)" << '\n';
+  f_service_i_ << indent() << "class virtual iface :" << '\n' << "object" << '\n';
 
   indent_up();
 
   if (tservice->get_extends() != nullptr) {
     string extends = type_name(tservice->get_extends());
-    indent(f_service_) << "inherit " << extends << ".iface" << endl;
-    indent(f_service_i_) << "inherit " << extends << ".iface" << endl;
+    indent(f_service_) << "inherit " << extends << ".iface" << '\n';
+    indent(f_service_i_) << "inherit " << extends << ".iface" << '\n';
   }
 
   vector<t_function*> functions = tservice->get_functions();
@@ -977,13 +975,13 @@
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     string ft = function_type(*f_iter, true, true);
     f_service_ << indent() << "method virtual " << decapitalize((*f_iter)->get_name()) << " : "
-               << ft << endl;
+               << ft << '\n';
     f_service_i_ << indent() << "method virtual " << decapitalize((*f_iter)->get_name()) << " : "
-                 << ft << endl;
+                 << ft << '\n';
   }
   indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
+  indent(f_service_) << "end" << '\n' << '\n';
+  indent(f_service_i_) << "end" << '\n' << '\n';
 }
 
 /**
@@ -995,17 +993,17 @@
  */
 void t_ocaml_generator::generate_service_client(t_service* tservice) {
   string extends = "";
-  indent(f_service_) << "class client (iprot : Protocol.t) (oprot : Protocol.t) =" << endl
-                     << "object (self)" << endl;
-  indent(f_service_i_) << "class client : Protocol.t -> Protocol.t -> " << endl << "object" << endl;
+  indent(f_service_) << "class client (iprot : Protocol.t) (oprot : Protocol.t) =" << '\n'
+                     << "object (self)" << '\n';
+  indent(f_service_i_) << "class client : Protocol.t -> Protocol.t -> " << '\n' << "object" << '\n';
   indent_up();
 
   if (tservice->get_extends() != nullptr) {
     extends = type_name(tservice->get_extends());
-    indent(f_service_) << "inherit " << extends << ".client iprot oprot as super" << endl;
-    indent(f_service_i_) << "inherit " << extends << ".client" << endl;
+    indent(f_service_) << "inherit " << extends << ".client iprot oprot as super" << '\n';
+    indent(f_service_i_) << "inherit " << extends << ".client" << '\n';
   }
-  indent(f_service_) << "val mutable seqid = 0" << endl;
+  indent(f_service_) << "val mutable seqid = 0" << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -1017,24 +1015,24 @@
     string funname = (*f_iter)->get_name();
 
     // Open function
-    indent(f_service_) << "method " << function_signature(*f_iter) << " = " << endl;
+    indent(f_service_) << "method " << function_signature(*f_iter) << " = " << '\n';
     indent(f_service_i_) << "method " << decapitalize((*f_iter)->get_name()) << " : "
-                         << function_type(*f_iter, true, false) << endl;
+                         << function_type(*f_iter, true, false) << '\n';
     indent_up();
     indent(f_service_) << "self#send_" << funname;
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << " " << decapitalize((*fld_iter)->get_name());
     }
-    f_service_ << ";" << endl;
+    f_service_ << ";" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_ << indent();
-      f_service_ << "self#recv_" << funname << endl;
+      f_service_ << "self#recv_" << funname << '\n';
     }
     indent_down();
 
-    indent(f_service_) << "method private send_" << function_signature(*f_iter) << " = " << endl;
+    indent(f_service_) << "method private send_" << function_signature(*f_iter) << " = " << '\n';
     indent_up();
 
     std::string argsname = decapitalize((*f_iter)->get_name() + "_args");
@@ -1042,19 +1040,19 @@
     // Serialize the request header
     f_service_ << indent() << "oprot#writeMessageBegin (\"" << (*f_iter)->get_name() << "\", "
                << ((*f_iter)->is_oneway() ? "Protocol.ONEWAY" : "Protocol.CALL") << ", seqid);"
-               << endl;
+               << '\n';
 
-    f_service_ << indent() << "let args = new " << argsname << " in" << endl;
+    f_service_ << indent() << "let args = new " << argsname << " in" << '\n';
     indent_up();
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "args#set_" << (*fld_iter)->get_name() << " "
-                 << (*fld_iter)->get_name() << ";" << endl;
+                 << (*fld_iter)->get_name() << ";" << '\n';
     }
 
     // Write to the stream
-    f_service_ << indent() << "args#write oprot;" << endl << indent() << "oprot#writeMessageEnd;"
-               << endl << indent() << "oprot#getTransport#flush" << endl;
+    f_service_ << indent() << "args#write oprot;" << '\n' << indent() << "oprot#writeMessageEnd;"
+               << '\n' << indent() << "oprot#getTransport#flush" << '\n';
 
     indent_down();
     indent_down();
@@ -1068,20 +1066,20 @@
                                &noargs);
       // Open function
       f_service_ << indent() << "method private " << function_signature(&recv_function) << " ="
-                 << endl;
+                 << '\n';
       indent_up();
 
       // TODO(mcslee): Validate message reply here, seq ids etc.
 
-      f_service_ << indent() << "let (fname, mtype, rseqid) = iprot#readMessageBegin in" << endl;
+      f_service_ << indent() << "let (fname, mtype, rseqid) = iprot#readMessageBegin in" << '\n';
       indent_up();
-      f_service_ << indent() << "(if mtype = Protocol.EXCEPTION then" << endl << indent()
-                 << "  let x = Application_Exn.read iprot in" << endl;
+      f_service_ << indent() << "(if mtype = Protocol.EXCEPTION then" << '\n' << indent()
+                 << "  let x = Application_Exn.read iprot in" << '\n';
       indent_up();
       f_service_ << indent() << "  (iprot#readMessageEnd;" << indent()
-                 << "   raise (Application_Exn.E x))" << endl;
+                 << "   raise (Application_Exn.E x))" << '\n';
       indent_down();
-      f_service_ << indent() << "else ());" << endl;
+      f_service_ << indent() << "else ());" << '\n';
       string res = "_";
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -1090,32 +1088,32 @@
       if (!(*f_iter)->get_returntype()->is_void() || xceptions.size() > 0) {
         res = "result";
       }
-      f_service_ << indent() << "let " << res << " = read_" << resultname << " iprot in" << endl;
+      f_service_ << indent() << "let " << res << " = read_" << resultname << " iprot in" << '\n';
       indent_up();
-      f_service_ << indent() << "iprot#readMessageEnd;" << endl;
+      f_service_ << indent() << "iprot#readMessageEnd;" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "match result#get_success with Some v -> v | None -> (" << endl;
+        f_service_ << indent() << "match result#get_success with Some v -> v | None -> (" << '\n';
         indent_up();
       }
 
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         f_service_ << indent() << "(match result#get_" << (*x_iter)->get_name()
-                   << " with None -> () | Some _v ->" << endl;
+                   << " with None -> () | Some _v ->" << '\n';
         indent(f_service_) << "  raise (" << capitalize(exception_ctor((*x_iter)->get_type()))
-                           << " _v));" << endl;
+                           << " _v));" << '\n';
       }
 
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "()" << endl;
+        indent(f_service_) << "()" << '\n';
       } else {
         f_service_
             << indent()
             << "raise (Application_Exn.E (Application_Exn.create Application_Exn.MISSING_RESULT \""
-            << (*f_iter)->get_name() << " failed: unknown result\")))" << endl;
+            << (*f_iter)->get_name() << " failed: unknown result\")))" << '\n';
         indent_down();
       }
 
@@ -1127,8 +1125,8 @@
   }
 
   indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
+  indent(f_service_) << "end" << '\n' << '\n';
+  indent(f_service_i_) << "end" << '\n' << '\n';
 }
 
 /**
@@ -1142,50 +1140,50 @@
   vector<t_function*>::iterator f_iter;
 
   // Generate the header portion
-  indent(f_service_) << "class processor (handler : iface) =" << endl << indent() << "object (self)"
-                     << endl;
-  indent(f_service_i_) << "class processor : iface ->" << endl << indent() << "object" << endl;
+  indent(f_service_) << "class processor (handler : iface) =" << '\n' << indent() << "object (self)"
+                     << '\n';
+  indent(f_service_i_) << "class processor : iface ->" << '\n' << indent() << "object" << '\n';
   indent_up();
 
-  f_service_ << indent() << "inherit Processor.t" << endl << endl;
-  f_service_i_ << indent() << "inherit Processor.t" << endl << endl;
+  f_service_ << indent() << "inherit Processor.t" << '\n' << '\n';
+  f_service_i_ << indent() << "inherit Processor.t" << '\n' << '\n';
   string extends = "";
 
   if (tservice->get_extends() != nullptr) {
     extends = type_name(tservice->get_extends());
     indent(f_service_) << "inherit " + extends + ".processor (handler :> " + extends + ".iface)"
-                       << endl;
-    indent(f_service_i_) << "inherit " + extends + ".processor" << endl;
+                       << '\n';
+    indent(f_service_i_) << "inherit " + extends + ".processor" << '\n';
   }
 
   if (extends.empty()) {
-    indent(f_service_) << "val processMap = Hashtbl.create " << functions.size() << endl;
+    indent(f_service_) << "val processMap = Hashtbl.create " << functions.size() << '\n';
   }
   indent(f_service_i_)
-      << "val processMap : (string, int * Protocol.t * Protocol.t -> unit) Hashtbl.t" << endl;
+      << "val processMap : (string, int * Protocol.t * Protocol.t -> unit) Hashtbl.t" << '\n';
 
   // Generate the server implementation
-  indent(f_service_) << "method process iprot oprot =" << endl;
-  indent(f_service_i_) << "method process : Protocol.t -> Protocol.t -> bool" << endl;
+  indent(f_service_) << "method process iprot oprot =" << '\n';
+  indent(f_service_i_) << "method process : Protocol.t -> Protocol.t -> bool" << '\n';
   indent_up();
 
-  f_service_ << indent() << "let (name, typ, seqid)  = iprot#readMessageBegin in" << endl;
+  f_service_ << indent() << "let (name, typ, seqid)  = iprot#readMessageBegin in" << '\n';
   indent_up();
   // TODO(mcslee): validate message
 
   // HOT: dictionary function lookup
-  f_service_ << indent() << "if Hashtbl.mem processMap name then" << endl << indent()
-             << "  (Hashtbl.find processMap name) (seqid, iprot, oprot)" << endl << indent()
-             << "else (" << endl << indent() << "  iprot#skip(Protocol.T_STRUCT);" << endl
-             << indent() << "  iprot#readMessageEnd;" << endl << indent()
+  f_service_ << indent() << "if Hashtbl.mem processMap name then" << '\n' << indent()
+             << "  (Hashtbl.find processMap name) (seqid, iprot, oprot)" << '\n' << indent()
+             << "else (" << '\n' << indent() << "  iprot#skip(Protocol.T_STRUCT);" << '\n'
+             << indent() << "  iprot#readMessageEnd;" << '\n' << indent()
              << "  let x = Application_Exn.create Application_Exn.UNKNOWN_METHOD (\"Unknown "
-                "function \"^name) in" << endl << indent()
-             << "    oprot#writeMessageBegin(name, Protocol.EXCEPTION, seqid);" << endl << indent()
-             << "    x#write oprot;" << endl << indent() << "    oprot#writeMessageEnd;" << endl
-             << indent() << "    oprot#getTransport#flush" << endl << indent() << ");" << endl;
+                "function \"^name) in" << '\n' << indent()
+             << "    oprot#writeMessageBegin(name, Protocol.EXCEPTION, seqid);" << '\n' << indent()
+             << "    x#write oprot;" << '\n' << indent() << "    oprot#writeMessageEnd;" << '\n'
+             << indent() << "    oprot#getTransport#flush" << '\n' << indent() << ");" << '\n';
 
   // Read end of args field, the T_STOP, and the struct close
-  f_service_ << indent() << "true" << endl;
+  f_service_ << indent() << "true" << '\n';
   indent_down();
   indent_down();
   // Generate the process subfunctions
@@ -1193,17 +1191,17 @@
     generate_process_function(tservice, *f_iter);
   }
 
-  indent(f_service_) << "initializer" << endl;
+  indent(f_service_) << "initializer" << '\n';
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ << indent() << "Hashtbl.add processMap \"" << (*f_iter)->get_name()
-               << "\" self#process_" << (*f_iter)->get_name() << ";" << endl;
+               << "\" self#process_" << (*f_iter)->get_name() << ";" << '\n';
   }
   indent_down();
 
   indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
+  indent(f_service_) << "end" << '\n' << '\n';
+  indent(f_service_i_) << "end" << '\n' << '\n';
 }
 
 /**
@@ -1215,7 +1213,7 @@
   (void)tservice;
   // Open function
   indent(f_service_) << "method private process_" << tfunction->get_name()
-                     << " (seqid, iprot, oprot) =" << endl;
+                     << " (seqid, iprot, oprot) =" << '\n';
   indent_up();
 
   string argsname = decapitalize(tfunction->get_name()) + "_args";
@@ -1231,9 +1229,9 @@
     args = "_";
   }
 
-  f_service_ << indent() << "let " << args << " = read_" << argsname << " iprot in" << endl;
+  f_service_ << indent() << "let " << args << " = read_" << argsname << " iprot in" << '\n';
   indent_up();
-  f_service_ << indent() << "iprot#readMessageEnd;" << endl;
+  f_service_ << indent() << "iprot#readMessageEnd;" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -1241,13 +1239,13 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "let result = new " << resultname << " in" << endl;
+    f_service_ << indent() << "let result = new " << resultname << " in" << '\n';
     indent_up();
   }
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    f_service_ << indent() << "(try" << endl;
+    f_service_ << indent() << "(try" << '\n';
     indent_up();
   }
 
@@ -1259,20 +1257,20 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     f_service_ << " args#get_" << (*f_iter)->get_name();
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   if (xceptions.size() > 0) {
     indent_down();
-    indent(f_service_) << "with" << endl;
+    indent(f_service_) << "with" << '\n';
     indent_up();
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << indent() << "| " << capitalize(exception_ctor((*x_iter)->get_type())) << " "
-                 << (*x_iter)->get_name() << " -> " << endl;
+                 << (*x_iter)->get_name() << " -> " << '\n';
       indent_up();
       indent_up();
       if (!tfunction->is_oneway()) {
         f_service_ << indent() << "result#set_" << (*x_iter)->get_name() << " "
-                   << (*x_iter)->get_name() << endl;
+                   << (*x_iter)->get_name() << '\n';
       } else {
         indent(f_service_) << "()";
       }
@@ -1280,21 +1278,21 @@
       indent_down();
     }
     indent_down();
-    f_service_ << indent() << ");" << endl;
+    f_service_ << indent() << ");" << '\n';
   }
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    f_service_ << indent() << "()" << endl;
+    f_service_ << indent() << "()" << '\n';
     indent_down();
     indent_down();
     return;
   }
 
   f_service_ << indent() << "oprot#writeMessageBegin (\"" << tfunction->get_name()
-             << "\", Protocol.REPLY, seqid);" << endl << indent() << "result#write oprot;" << endl
-             << indent() << "oprot#writeMessageEnd;" << endl << indent()
-             << "oprot#getTransport#flush" << endl;
+             << "\", Protocol.REPLY, seqid);" << '\n' << indent() << "result#write oprot;" << '\n'
+             << indent() << "oprot#writeMessageEnd;" << '\n' << indent()
+             << "oprot#getTransport#flush" << '\n';
 
   // Close function
   indent_down();
@@ -1311,7 +1309,7 @@
   string name = decapitalize(tfield->get_name());
   indent(out) << prefix << "#set_" << name << " ";
   generate_deserialize_type(out, type);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1396,46 +1394,46 @@
   t_field fvtype(g_type_i8, vtype);
   t_field fetype(g_type_i8, etype);
 
-  out << endl;
+  out << '\n';
   indent_up();
   // Declare variables, read header
   if (ttype->is_map()) {
     indent(out) << "(let (" << ktype << "," << vtype << "," << size << ") = iprot#readMapBegin in"
-                << endl;
-    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << endl;
+                << '\n';
+    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << '\n';
     indent_up();
-    indent(out) << "for i = 1 to " << size << " do" << endl;
+    indent(out) << "for i = 1 to " << size << " do" << '\n';
     indent_up();
     indent(out) << "let _k = ";
     generate_deserialize_type(out, ((t_map*)ttype)->get_key_type());
-    out << " in" << endl;
+    out << " in" << '\n';
     indent(out) << "let _v = ";
     generate_deserialize_type(out, ((t_map*)ttype)->get_val_type());
-    out << " in" << endl;
+    out << " in" << '\n';
     indent_up();
-    indent(out) << "Hashtbl.add " << con << " _k _v" << endl;
+    indent(out) << "Hashtbl.add " << con << " _k _v" << '\n';
     indent_down();
     indent_down();
     indent(out) << "done; iprot#readMapEnd; " << con << ")";
     indent_down();
   } else if (ttype->is_set()) {
-    indent(out) << "(let (" << etype << "," << size << ") = iprot#readSetBegin in" << endl;
-    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << endl;
+    indent(out) << "(let (" << etype << "," << size << ") = iprot#readSetBegin in" << '\n';
+    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << '\n';
     indent_up();
-    indent(out) << "for i = 1 to " << size << " do" << endl;
+    indent(out) << "for i = 1 to " << size << " do" << '\n';
     indent_up();
     indent(out) << "Hashtbl.add " << con << " ";
     generate_deserialize_type(out, ((t_set*)ttype)->get_elem_type());
-    out << " true" << endl;
+    out << " true" << '\n';
     indent_down();
     indent(out) << "done; iprot#readSetEnd; " << con << ")";
     indent_down();
   } else if (ttype->is_list()) {
-    indent(out) << "(let (" << etype << "," << size << ") = iprot#readListBegin in" << endl;
+    indent(out) << "(let (" << etype << "," << size << ") = iprot#readListBegin in" << '\n';
     indent_up();
     indent(out) << "let " << con << " = (Array.to_list (Array.init " << size << " (fun _ -> ";
     generate_deserialize_type(out, ((t_list*)ttype)->get_elem_type());
-    out << "))) in" << endl;
+    out << "))) in" << '\n';
     indent_up();
     indent(out) << "iprot#readListEnd; " << con << ")";
     indent_down();
@@ -1510,7 +1508,7 @@
            tfield->get_name().c_str(),
            type->get_name().c_str());
   }
-  out << ";" << endl;
+  out << ";" << '\n';
 }
 
 /**
@@ -1528,38 +1526,38 @@
   if (ttype->is_map()) {
     indent(out) << "oprot#writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ",";
     out << type_to_enum(((t_map*)ttype)->get_val_type()) << ",";
-    out << "Hashtbl.length " << prefix << ");" << endl;
+    out << "Hashtbl.length " << prefix << ");" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot#writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ",";
-    out << "Hashtbl.length " << prefix << ");" << endl;
+    out << "Hashtbl.length " << prefix << ");" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot#writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
                 << ",";
-    out << "List.length " << prefix << ");" << endl;
+    out << "List.length " << prefix << ");" << '\n';
   }
 
   if (ttype->is_map()) {
     string kiter = tmp("_kiter");
     string viter = tmp("_viter");
-    indent(out) << "Hashtbl.iter (fun " << kiter << " -> fun " << viter << " -> " << endl;
+    indent(out) << "Hashtbl.iter (fun " << kiter << " -> fun " << viter << " -> " << '\n';
     indent_up();
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
     indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
+    indent(out) << ") " << prefix << ";" << '\n';
   } else if (ttype->is_set()) {
     string iter = tmp("_iter");
     indent(out) << "Hashtbl.iter (fun " << iter << " -> fun _ -> ";
     indent_up();
     generate_serialize_set_element(out, (t_set*)ttype, iter);
     indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
+    indent(out) << ") " << prefix << ";" << '\n';
   } else if (ttype->is_list()) {
     string iter = tmp("_iter");
     indent(out) << "List.iter (fun " << iter << " -> ";
     indent_up();
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
+    indent(out) << ") " << prefix << ";" << '\n';
   }
 
   if (ttype->is_map()) {
diff --git a/compiler/cpp/src/thrift/generate/t_oop_generator.h b/compiler/cpp/src/thrift/generate/t_oop_generator.h
index 8841962..07b6216 100644
--- a/compiler/cpp/src/thrift/generate/t_oop_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_oop_generator.h
@@ -42,13 +42,13 @@
    */
 
   void scope_up(std::ostream& out) {
-    indent(out) << "{" << std::endl;
+    indent(out) << "{" << '\n';
     indent_up();
   }
 
   void scope_down(std::ostream& out) {
     indent_down();
-    indent(out) << "}" << std::endl;
+    indent(out) << "}" << '\n';
   }
 
   std::string upcase_string(std::string original) {
diff --git a/compiler/cpp/src/thrift/generate/t_perl_generator.cc b/compiler/cpp/src/thrift/generate/t_perl_generator.cc
index d133b24..8e533ca 100644
--- a/compiler/cpp/src/thrift/generate/t_perl_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_perl_generator.cc
@@ -37,8 +37,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * PERL code generator.
  *
@@ -246,8 +244,8 @@
   f_types_ << autogen_comment() << perl_includes();
 
   // Print header
-  f_consts_ << autogen_comment() << "package " << perl_namespace(program_) << "Constants;" << endl
-            << perl_includes() << endl;
+  f_consts_ << autogen_comment() << "package " << perl_namespace(program_) << "Constants;" << '\n'
+            << perl_includes() << '\n';
 }
 
 /**
@@ -271,10 +269,10 @@
  */
 void t_perl_generator::close_generator() {
   // Close types file
-  f_types_ << "1;" << endl;
+  f_types_ << "1;" << '\n';
   f_types_.close();
 
-  f_consts_ << "1;" << endl;
+  f_consts_ << "1;" << '\n';
   f_consts_.close();
 }
 
@@ -294,13 +292,13 @@
  * @param tenum The enumeration
  */
 void t_perl_generator::generate_enum(t_enum* tenum) {
-  f_types_ << "package " << perl_namespace(program_) << tenum->get_name() << ";" << endl;
+  f_types_ << "package " << perl_namespace(program_) << tenum->get_name() << ";" << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    f_types_ << "use constant " << (*c_iter)->get_name() << " => " << value << ";" << endl;
+    f_types_ << "use constant " << (*c_iter)->get_name() << " => " << value << ";" << '\n';
   }
 }
 
@@ -314,7 +312,7 @@
 
   f_consts_ << "use constant " << name << " => ";
   f_consts_ << render_const_value(type, value);
-  f_consts_ << ";" << endl << endl;
+  f_consts_ << ";" << '\n' << '\n';
 }
 
 /**
@@ -355,7 +353,7 @@
   } else if (type->is_enum()) {
     out << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << perl_namespace(type->get_program()) << type->get_name() << "->new({" << endl;
+    out << perl_namespace(type->get_program()) << type->get_name() << "->new({" << '\n';
     indent_up();
 
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
@@ -376,14 +374,14 @@
       out << " => ";
       out << render_const_value(field_type, v_iter->second);
       out << ",";
-      out << endl;
+      out << '\n';
     }
     indent_down();
     indent(out) << "})";
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
+    out << "{" << '\n';
     indent_up();
 
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
@@ -392,7 +390,7 @@
       indent(out) << render_const_value(ktype, v_iter->first);
       out << " => ";
       out << render_const_value(vtype, v_iter->second);
-      out << "," << endl;
+      out << "," << '\n';
     }
     indent_down();
     indent(out) << "}";
@@ -403,7 +401,7 @@
     } else {
       etype = ((t_set*)type)->get_elem_type();
     }
-    out << "[" << endl;
+    out << "[" << '\n';
     indent_up();
 
     const vector<t_const_value*>& val = value->get_list();
@@ -414,7 +412,7 @@
       if (type->is_set()) {
         out << " => 1";
       }
-      out << "," << endl;
+      out << "," << '\n';
     }
     indent_down();
     indent(out) << "]";
@@ -480,12 +478,12 @@
     out << ") );\n";
   }
 
-  out << endl;
+  out << '\n';
 
   // new()
   indent_up();
-  out << "sub new {" << endl << indent() << "my $classname = shift;" << endl << indent()
-      << "my $self      = {};" << endl << indent() << "my $vals      = shift || {};" << endl;
+  out << "sub new {" << '\n' << indent() << "my $classname = shift;" << '\n' << indent()
+      << "my $self      = {};" << '\n' << indent() << "my $vals      = shift || {};" << '\n';
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     string dval = "undef";
@@ -493,7 +491,7 @@
     if ((*m_iter)->get_value() != nullptr && !(t->is_struct() || t->is_xception())) {
       dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
     }
-    out << indent() << "$self->{" << (*m_iter)->get_name() << "} = " << dval << ";" << endl;
+    out << indent() << "$self->{" << (*m_iter)->get_name() << "} = " << dval << ";" << '\n';
   }
 
   // Generate constructor from array
@@ -503,27 +501,27 @@
       t_type* t = get_true_type((*m_iter)->get_type());
       if ((*m_iter)->get_value() != nullptr && (t->is_struct() || t->is_xception())) {
         indent(out) << "$self->{" << (*m_iter)->get_name()
-                    << "} = " << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
+                    << "} = " << render_const_value(t, (*m_iter)->get_value()) << ";" << '\n';
       }
     }
 
-    out << indent() << "if (UNIVERSAL::isa($vals,'HASH')) {" << endl;
+    out << indent() << "if (UNIVERSAL::isa($vals,'HASH')) {" << '\n';
     indent_up();
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      out << indent() << "if (defined $vals->{" << (*m_iter)->get_name() << "}) {" << endl
+      out << indent() << "if (defined $vals->{" << (*m_iter)->get_name() << "}) {" << '\n'
           << indent() << "  $self->{" << (*m_iter)->get_name() << "} = $vals->{"
-          << (*m_iter)->get_name() << "};" << endl << indent() << "}" << endl;
+          << (*m_iter)->get_name() << "};" << '\n' << indent() << "}" << '\n';
     }
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
 
-  out << indent() << "return bless ($self, $classname);" << endl;
+  out << indent() << "return bless ($self, $classname);" << '\n';
   indent_down();
   out << "}\n\n";
 
-  out << "sub getName {" << endl << indent() << "  return '" << tstruct->get_name() << "';" << endl
-      << indent() << "}" << endl << endl;
+  out << "sub getName {" << '\n' << indent() << "  return '" << tstruct->get_name() << "';" << '\n'
+      << indent() << "}" << '\n' << '\n';
 
   generate_perl_struct_reader(out, tstruct);
   generate_perl_struct_writer(out, tstruct);
@@ -536,32 +534,32 @@
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out << "sub read {" << endl;
+  out << "sub read {" << '\n';
 
   indent_up();
 
-  out << indent() << "my ($self, $input) = @_;" << endl << indent() << "my $xfer  = 0;" << endl
-      << indent() << "my $fname;" << endl << indent() << "my $ftype = 0;" << endl << indent()
-      << "my $fid   = 0;" << endl;
+  out << indent() << "my ($self, $input) = @_;" << '\n' << indent() << "my $xfer  = 0;" << '\n'
+      << indent() << "my $fname;" << '\n' << indent() << "my $ftype = 0;" << '\n' << indent()
+      << "my $fid   = 0;" << '\n';
 
-  indent(out) << "$xfer += $input->readStructBegin(\\$fname);" << endl;
+  indent(out) << "$xfer += $input->readStructBegin(\\$fname);" << '\n';
 
   // Loop over reading in fields
-  indent(out) << "while (1)" << endl;
+  indent(out) << "while (1)" << '\n';
 
   scope_up(out);
 
-  indent(out) << "$xfer += $input->readFieldBegin(\\$fname, \\$ftype, \\$fid);" << endl;
+  indent(out) << "$xfer += $input->readFieldBegin(\\$fname, \\$ftype, \\$fid);" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if ($ftype == Thrift::TType::STOP) {" << endl;
+  indent(out) << "if ($ftype == Thrift::TType::STOP) {" << '\n';
   indent_up();
-  indent(out) << "last;" << endl;
+  indent(out) << "last;" << '\n';
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 
   // Switch statement on the field we are reading
-  indent(out) << "SWITCH: for($fid)" << endl;
+  indent(out) << "SWITCH: for($fid)" << '\n';
 
   scope_up(out);
 
@@ -569,34 +567,34 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
 
     indent(out) << "/^" << (*f_iter)->get_key() << "$/ && do{";
-    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
 
     indent_up();
     generate_deserialize_field(out, *f_iter, "self->");
     indent_down();
 
-    indent(out) << "} else {" << endl;
+    indent(out) << "} else {" << '\n';
 
-    indent(out) << "  $xfer += $input->skip($ftype);" << endl;
+    indent(out) << "  $xfer += $input->skip($ftype);" << '\n';
 
-    out << indent() << "}" << endl << indent() << "last; };" << endl;
+    out << indent() << "}" << '\n' << indent() << "last; };" << '\n';
   }
   // In the default case we skip the field
 
-  indent(out) << "  $xfer += $input->skip($ftype);" << endl;
+  indent(out) << "  $xfer += $input->skip($ftype);" << '\n';
 
   scope_down(out);
 
-  indent(out) << "$xfer += $input->readFieldEnd();" << endl;
+  indent(out) << "$xfer += $input->readFieldEnd();" << '\n';
 
   scope_down(out);
 
-  indent(out) << "$xfer += $input->readStructEnd();" << endl;
+  indent(out) << "$xfer += $input->readStructEnd();" << '\n';
 
-  indent(out) << "return $xfer;" << endl;
+  indent(out) << "return $xfer;" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -607,38 +605,38 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out << "sub write {" << endl;
+  out << "sub write {" << '\n';
 
   indent_up();
-  indent(out) << "my ($self, $output) = @_;" << endl;
-  indent(out) << "my $xfer   = 0;" << endl;
+  indent(out) << "my ($self, $output) = @_;" << '\n';
+  indent(out) << "my $xfer   = 0;" << '\n';
 
-  indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << endl;
+  indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if (defined $self->{" << (*f_iter)->get_name() << "}) {" << endl;
+    out << indent() << "if (defined $self->{" << (*f_iter)->get_name() << "}) {" << '\n';
     indent_up();
 
     indent(out) << "$xfer += $output->writeFieldBegin("
                 << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ");" << endl;
+                << ", " << (*f_iter)->get_key() << ");" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "self->");
 
-    indent(out) << "$xfer += $output->writeFieldEnd();" << endl;
+    indent(out) << "$xfer += $output->writeFieldEnd();" << '\n';
 
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
-  out << indent() << "$xfer += $output->writeFieldStop();" << endl << indent()
-      << "$xfer += $output->writeStructEnd();" << endl;
+  out << indent() << "$xfer += $output->writeFieldStop();" << '\n' << indent()
+      << "$xfer += $output->writeStructEnd();" << '\n';
 
-  out << indent() << "return $xfer;" << endl;
+  out << indent() << "return $xfer;" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 }
 
 /**
@@ -655,13 +653,13 @@
     std::vector<t_program*>& currInc = current->get_includes();
     std::vector<t_program*>::size_type numInc = currInc.size();
     if (selfish) {
-      os << "use " << perl_namespace(current) << "Types;" << endl;
+      os << "use " << perl_namespace(current) << "Types;" << '\n';
     }
     for (std::vector<t_program*>::size_type i = 0; i < numInc; ++i) {
       t_program* incProgram = currInc.at(i);
-      os << "use " << perl_namespace(incProgram) << "Types;" << endl;
+      os << "use " << perl_namespace(incProgram) << "Types;" << '\n';
     }
-    os << endl;
+    os << '\n';
     done = true;
   }
 }
@@ -683,10 +681,10 @@
   t_service* extends_s = tservice->get_extends();
   if (extends_s != nullptr) {
     f_service_ << "use " << perl_namespace(extends_s->get_program()) << extends_s->get_name() << ";"
-               << endl;
+               << '\n';
   }
 
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the three main parts of the service (well, two for now in PERL)
   generate_service_helpers(tservice);
@@ -696,7 +694,7 @@
   generate_service_processor(tservice);
 
   // Close service file
-  f_service_ << "1;" << endl;
+  f_service_ << "1;" << '\n';
   f_service_.close();
 }
 
@@ -721,59 +719,59 @@
   indent_up();
 
   // Generate the header portion
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Processor;" << endl
-             << endl << "use strict;" << endl << extends_processor << endl << endl;
+  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Processor;" << '\n'
+             << '\n' << "use strict;" << '\n' << extends_processor << '\n' << '\n';
 
   if (extends.empty()) {
-    f_service_ << "sub new {" << endl;
+    f_service_ << "sub new {" << '\n';
 
     indent_up();
 
-    f_service_ << indent() << "my ($classname, $handler) = @_;" << endl << indent()
-               << "my $self      = {};" << endl;
+    f_service_ << indent() << "my ($classname, $handler) = @_;" << '\n' << indent()
+               << "my $self      = {};" << '\n';
 
-    f_service_ << indent() << "$self->{handler} = $handler;" << endl;
+    f_service_ << indent() << "$self->{handler} = $handler;" << '\n';
 
-    f_service_ << indent() << "return bless ($self, $classname);" << endl;
+    f_service_ << indent() << "return bless ($self, $classname);" << '\n';
 
     indent_down();
 
-    f_service_ << "}" << endl << endl;
+    f_service_ << "}" << '\n' << '\n';
   }
 
   // Generate the server implementation
-  f_service_ << "sub process {" << endl;
+  f_service_ << "sub process {" << '\n';
   indent_up();
 
-  f_service_ << indent() << "my ($self, $input, $output) = @_;" << endl;
+  f_service_ << indent() << "my ($self, $input, $output) = @_;" << '\n';
 
-  f_service_ << indent() << "my $rseqid = 0;" << endl << indent() << "my $fname  = undef;" << endl
-             << indent() << "my $mtype  = 0;" << endl << endl;
+  f_service_ << indent() << "my $rseqid = 0;" << '\n' << indent() << "my $fname  = undef;" << '\n'
+             << indent() << "my $mtype  = 0;" << '\n' << '\n';
 
-  f_service_ << indent() << "$input->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);" << endl;
+  f_service_ << indent() << "$input->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);" << '\n';
 
   // HOT: check for method implementation
-  f_service_ << indent() << "my $methodname = 'process_'.$fname;" << endl << indent()
-             << "if (!$self->can($methodname)) {" << endl;
+  f_service_ << indent() << "my $methodname = 'process_'.$fname;" << '\n' << indent()
+             << "if (!$self->can($methodname)) {" << '\n';
   indent_up();
 
-  f_service_ << indent() << "$input->skip(Thrift::TType::STRUCT);" << endl << indent()
-             << "$input->readMessageEnd();" << endl << indent()
+  f_service_ << indent() << "$input->skip(Thrift::TType::STRUCT);" << '\n' << indent()
+             << "$input->readMessageEnd();" << '\n' << indent()
              << "my $x = Thrift::TApplicationException->new('Function '.$fname.' not implemented.', "
-                "Thrift::TApplicationException::UNKNOWN_METHOD);" << endl << indent()
-             << "$output->writeMessageBegin($fname, Thrift::TMessageType::EXCEPTION, $rseqid);" << endl
-             << indent() << "$x->write($output);" << endl << indent()
-             << "$output->writeMessageEnd();" << endl << indent()
-             << "$output->getTransport()->flush();" << endl << indent() << "return;" << endl;
+                "Thrift::TApplicationException::UNKNOWN_METHOD);" << '\n' << indent()
+             << "$output->writeMessageBegin($fname, Thrift::TMessageType::EXCEPTION, $rseqid);" << '\n'
+             << indent() << "$x->write($output);" << '\n' << indent()
+             << "$output->writeMessageEnd();" << '\n' << indent()
+             << "$output->getTransport()->flush();" << '\n' << indent() << "return;" << '\n';
 
   indent_down();
-  f_service_ << indent() << "}" << endl << indent()
-             << "$self->$methodname($rseqid, $input, $output);" << endl << indent() << "return 1;"
-             << endl;
+  f_service_ << indent() << "}" << '\n' << indent()
+             << "$self->$methodname($rseqid, $input, $output);" << '\n' << indent() << "return 1;"
+             << '\n';
 
   indent_down();
 
-  f_service_ << "}" << endl << endl;
+  f_service_ << "}" << '\n' << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -788,21 +786,21 @@
  */
 void t_perl_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
   // Open function
-  f_service_ << "sub process_" << tfunction->get_name() << " {" << endl;
+  f_service_ << "sub process_" << tfunction->get_name() << " {" << '\n';
 
   indent_up();
 
-  f_service_ << indent() << "my ($self, $seqid, $input, $output) = @_;" << endl;
+  f_service_ << indent() << "my ($self, $seqid, $input, $output) = @_;" << '\n';
 
   string argsname = perl_namespace(tservice->get_program()) + service_name_ + "_"
                     + tfunction->get_name() + "_args";
   string resultname = perl_namespace(tservice->get_program()) + service_name_ + "_"
                       + tfunction->get_name() + "_result";
 
-  f_service_ << indent() << "my $args = " << argsname << "->new();" << endl << indent()
-             << "$args->read($input);" << endl;
+  f_service_ << indent() << "my $args = " << argsname << "->new();" << '\n' << indent()
+             << "$args->read($input);" << '\n';
 
-  f_service_ << indent() << "$input->readMessageEnd();" << endl;
+  f_service_ << indent() << "$input->readMessageEnd();" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -810,12 +808,12 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "my $result = " << resultname << "->new();" << endl;
+    f_service_ << indent() << "my $result = " << resultname << "->new();" << '\n';
   }
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    f_service_ << indent() << "eval {" << endl;
+    f_service_ << indent() << "eval {" << '\n';
     indent_up();
   }
 
@@ -838,55 +836,55 @@
     }
     f_service_ << "$args->" << (*f_iter)->get_name();
   }
-  f_service_ << ");" << endl;
+  f_service_ << ");" << '\n';
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
     indent_down();
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << indent() << "}; if( UNIVERSAL::isa($@,'"
                  << perl_namespace((*x_iter)->get_type()->get_program())
-                 << (*x_iter)->get_type()->get_name() << "') ){ " << endl;
+                 << (*x_iter)->get_type()->get_name() << "') ){ " << '\n';
 
       indent_up();
-      f_service_ << indent() << "$result->{" << (*x_iter)->get_name() << "} = $@;" << endl;
-      f_service_ << indent() << "$@ = undef;" << endl;
+      f_service_ << indent() << "$result->{" << (*x_iter)->get_name() << "} = $@;" << '\n';
+      f_service_ << indent() << "$@ = undef;" << '\n';
       indent_down();
       f_service_ << indent();
     }
-    f_service_ << "}" << endl;
+    f_service_ << "}" << '\n';
 
     // catch-all for unexpected exceptions (THRIFT-3191)
-    f_service_ << indent() << "if ($@) {" << endl;
+    f_service_ << indent() << "if ($@) {" << '\n';
     indent_up();
-    f_service_ << indent() << "$@ =~ s/^\\s+|\\s+$//g;" << endl
-               << indent() << "my $err = Thrift::TApplicationException->new(\"Unexpected Exception: \" . $@, Thrift::TApplicationException::INTERNAL_ERROR);" << endl
-               << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', Thrift::TMessageType::EXCEPTION, $seqid);" << endl
-               << indent() << "$err->write($output);" << endl
-               << indent() << "$output->writeMessageEnd();" << endl
-               << indent() << "$output->getTransport()->flush();" << endl
-               << indent() << "$@ = undef;" << endl
-               << indent() << "return;" << endl;
+    f_service_ << indent() << "$@ =~ s/^\\s+|\\s+$//g;" << '\n'
+               << indent() << "my $err = Thrift::TApplicationException->new(\"Unexpected Exception: \" . $@, Thrift::TApplicationException::INTERNAL_ERROR);" << '\n'
+               << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', Thrift::TMessageType::EXCEPTION, $seqid);" << '\n'
+               << indent() << "$err->write($output);" << '\n'
+               << indent() << "$output->writeMessageEnd();" << '\n'
+               << indent() << "$output->getTransport()->flush();" << '\n'
+               << indent() << "$@ = undef;" << '\n'
+               << indent() << "return;" << '\n';
     indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << indent() << "}" << '\n';
   }
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
+    f_service_ << indent() << "return;" << '\n';
     indent_down();
-    f_service_ << "}" << endl;
+    f_service_ << "}" << '\n';
     return;
   }
 
   // Serialize the reply
-  f_service_ << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', Thrift::TMessageType::REPLY, $seqid);" << endl
-             << indent() << "$result->write($output);" << endl
-             << indent() << "$output->writeMessageEnd();" << endl
-             << indent() << "$output->getTransport()->flush();" << endl;
+  f_service_ << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', Thrift::TMessageType::REPLY, $seqid);" << '\n'
+             << indent() << "$result->write($output);" << '\n'
+             << indent() << "$output->writeMessageEnd();" << '\n'
+             << indent() << "$output->getTransport()->flush();" << '\n';
 
   // Close function
   indent_down();
-  f_service_ << "}" << endl << endl;
+  f_service_ << "}" << '\n' << '\n';
 }
 
 /**
@@ -898,7 +896,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  f_service_ << "# HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+  f_service_ << "# HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -945,15 +943,15 @@
                  + "If);";
   }
 
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "If;" << endl << endl
-             << "use strict;" << endl << extends_if << endl << endl;
+  f_service_ << "package " << perl_namespace(program_) << service_name_ << "If;" << '\n' << '\n'
+             << "use strict;" << '\n' << extends_if << '\n' << '\n';
 
   indent_up();
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << "sub " << function_signature(*f_iter) << endl << "  die 'implement interface';\n}"
-               << endl << endl;
+    f_service_ << "sub " << function_signature(*f_iter) << '\n' << "  die 'implement interface';\n}"
+               << '\n' << '\n';
   }
   indent_down();
 }
@@ -970,31 +968,31 @@
     extends_if = "use base qw(" + perl_namespace(extends_s->get_program()) + extends_s->get_name()
                  + "Rest);";
   }
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Rest;" << endl << endl
-             << "use strict;" << endl << extends_if << endl << endl;
+  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Rest;" << '\n' << '\n'
+             << "use strict;" << '\n' << extends_if << '\n' << '\n';
 
   if (extends.empty()) {
-    f_service_ << "sub new {" << endl;
+    f_service_ << "sub new {" << '\n';
 
     indent_up();
 
-    f_service_ << indent() << "my ($classname, $impl) = @_;" << endl << indent()
-               << "my $self     ={ impl => $impl };" << endl << endl << indent()
-               << "return bless($self,$classname);" << endl;
+    f_service_ << indent() << "my ($classname, $impl) = @_;" << '\n' << indent()
+               << "my $self     ={ impl => $impl };" << '\n' << '\n' << indent()
+               << "return bless($self,$classname);" << '\n';
 
     indent_down();
 
-    f_service_ << "}" << endl << endl;
+    f_service_ << "}" << '\n' << '\n';
   }
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << "sub " << (*f_iter)->get_name() << "{" << endl;
+    f_service_ << "sub " << (*f_iter)->get_name() << "{" << '\n';
 
     indent_up();
 
-    f_service_ << indent() << "my ($self, $request) = @_;" << endl << endl;
+    f_service_ << indent() << "my ($self, $request) = @_;" << '\n' << '\n';
 
     const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
     vector<t_field*>::const_iterator a_iter;
@@ -1002,19 +1000,19 @@
       //t_type* atype = get_true_type((*a_iter)->get_type());
       string req = "$request->{'" + (*a_iter)->get_name() + "'}";
       f_service_ << indent() << "my $" << (*a_iter)->get_name() << " = (" << req << ") ? " << req
-                 << " : undef;" << endl;
+                 << " : undef;" << '\n';
       /* slist no longer supported
       if (atype->is_string() && ((t_base_type*)atype)->is_string_list()) {
         f_service_ << indent() << "my @" << (*a_iter)->get_name() << " = split(/,/, $"
-                   << (*a_iter)->get_name() << ");" << endl << indent() << "$"
-                   << (*a_iter)->get_name() << " = \\@" << (*a_iter)->get_name() << endl;
+                   << (*a_iter)->get_name() << ");" << '\n' << indent() << "$"
+                   << (*a_iter)->get_name() << " = \\@" << (*a_iter)->get_name() << '\n';
       }
       */
     }
     f_service_ << indent() << "return $self->{impl}->" << (*f_iter)->get_name() << "("
-               << argument_list((*f_iter)->get_arglist()) << ");" << endl;
+               << argument_list((*f_iter)->get_arglist()) << ");" << '\n';
     indent_down();
-    indent(f_service_) << "}" << endl << endl;
+    indent(f_service_) << "}" << '\n' << '\n';
   }
 }
 
@@ -1032,31 +1030,31 @@
     extends_client = "use base qw(" + extends + "Client);";
   }
 
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Client;" << endl << endl
-             << extends_client << endl << "use base qw(" << perl_namespace(program_)
-             << service_name_ << "If);" << endl;
+  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Client;" << '\n' << '\n'
+             << extends_client << '\n' << "use base qw(" << perl_namespace(program_)
+             << service_name_ << "If);" << '\n';
 
   // Constructor function
-  f_service_ << "sub new {" << endl;
+  f_service_ << "sub new {" << '\n';
 
   indent_up();
 
-  f_service_ << indent() << "my ($classname, $input, $output) = @_;" << endl << indent()
-             << "my $self      = {};" << endl;
+  f_service_ << indent() << "my ($classname, $input, $output) = @_;" << '\n' << indent()
+             << "my $self      = {};" << '\n';
 
   if (!extends.empty()) {
-    f_service_ << indent() << "$self = $classname->SUPER::new($input, $output);" << endl;
+    f_service_ << indent() << "$self = $classname->SUPER::new($input, $output);" << '\n';
   } else {
-    f_service_ << indent() << "$self->{input}  = $input;" << endl << indent()
-               << "$self->{output} = defined $output ? $output : $input;" << endl << indent()
-               << "$self->{seqid}  = 0;" << endl;
+    f_service_ << indent() << "$self->{input}  = $input;" << '\n' << indent()
+               << "$self->{output} = defined $output ? $output : $input;" << '\n' << indent()
+               << "$self->{seqid}  = 0;" << '\n';
   }
 
-  f_service_ << indent() << "return bless($self,$classname);" << endl;
+  f_service_ << indent() << "return bless($self,$classname);" << '\n';
 
   indent_down();
 
-  f_service_ << "}" << endl << endl;
+  f_service_ << "}" << '\n' << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -1068,7 +1066,7 @@
     string funname = (*f_iter)->get_name();
 
     // Open function
-    f_service_ << "sub " << function_signature(*f_iter) << endl;
+    f_service_ << "sub " << function_signature(*f_iter) << '\n';
 
     indent_up();
 
@@ -1083,21 +1081,21 @@
       }
       f_service_ << "$" << (*fld_iter)->get_name();
     }
-    f_service_ << ");" << endl;
+    f_service_ << ");" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_ << indent();
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_ << "return ";
       }
-      f_service_ << "$self->recv_" << funname << "();" << endl;
+      f_service_ << "$self->recv_" << funname << "();" << '\n';
     }
 
     indent_down();
 
-    f_service_ << "}" << endl << endl;
+    f_service_ << "}" << '\n' << '\n';
 
-    f_service_ << "sub send_" << function_signature(*f_iter) << endl;
+    f_service_ << "sub send_" << function_signature(*f_iter) << '\n';
 
     indent_up();
 
@@ -1107,23 +1105,23 @@
     // Serialize the request header
     f_service_ << indent() << "$self->{output}->writeMessageBegin('" << (*f_iter)->get_name()
                << "', " << ((*f_iter)->is_oneway() ? "Thrift::TMessageType::ONEWAY" : "Thrift::TMessageType::CALL")
-               << ", $self->{seqid});" << endl;
+               << ", $self->{seqid});" << '\n';
 
-    f_service_ << indent() << "my $args = " << argsname << "->new();" << endl;
+    f_service_ << indent() << "my $args = " << argsname << "->new();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "$args->{" << (*fld_iter)->get_name() << "} = $"
-                 << (*fld_iter)->get_name() << ";" << endl;
+                 << (*fld_iter)->get_name() << ";" << '\n';
     }
 
     // Write to the stream
-    f_service_ << indent() << "$args->write($self->{output});" << endl << indent()
-               << "$self->{output}->writeMessageEnd();" << endl << indent()
-               << "$self->{output}->getTransport()->flush();" << endl;
+    f_service_ << indent() << "$args->write($self->{output});" << '\n' << indent()
+               << "$self->{output}->writeMessageEnd();" << '\n' << indent()
+               << "$self->{output}->getTransport()->flush();" << '\n';
 
     indent_down();
 
-    f_service_ << "}" << endl;
+    f_service_ << "}" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       std::string resultname = perl_namespace(tservice->get_program()) + service_name_ + "_"
@@ -1134,29 +1132,29 @@
                                string("recv_") + (*f_iter)->get_name(),
                                &noargs);
       // Open function
-      f_service_ << endl << "sub " << function_signature(&recv_function) << endl;
+      f_service_ << '\n' << "sub " << function_signature(&recv_function) << '\n';
 
       indent_up();
 
-      f_service_ << indent() << "my $rseqid = 0;" << endl << indent() << "my $fname;" << endl
-                 << indent() << "my $mtype = 0;" << endl << endl;
+      f_service_ << indent() << "my $rseqid = 0;" << '\n' << indent() << "my $fname;" << '\n'
+                 << indent() << "my $mtype = 0;" << '\n' << '\n';
 
       f_service_ << indent() << "$self->{input}->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);"
-                 << endl << indent() << "if ($mtype == Thrift::TMessageType::EXCEPTION) {" << endl
-                 << indent() << "  my $x = Thrift::TApplicationException->new();" << endl << indent()
-                 << "  $x->read($self->{input});" << endl << indent()
-                 << "  $self->{input}->readMessageEnd();" << endl << indent() << "  die $x;" << endl
-                 << indent() << "}" << endl;
+                 << '\n' << indent() << "if ($mtype == Thrift::TMessageType::EXCEPTION) {" << '\n'
+                 << indent() << "  my $x = Thrift::TApplicationException->new();" << '\n' << indent()
+                 << "  $x->read($self->{input});" << '\n' << indent()
+                 << "  $self->{input}->readMessageEnd();" << '\n' << indent() << "  die $x;" << '\n'
+                 << indent() << "}" << '\n';
 
-      f_service_ << indent() << "my $result = " << resultname << "->new();" << endl << indent()
-                 << "$result->read($self->{input});" << endl;
+      f_service_ << indent() << "my $result = " << resultname << "->new();" << '\n' << indent()
+                 << "$result->read($self->{input});" << '\n';
 
-      f_service_ << indent() << "$self->{input}->readMessageEnd();" << endl << endl;
+      f_service_ << indent() << "$self->{input}->readMessageEnd();" << '\n' << '\n';
 
       // Careful, only return result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (defined $result->{success} ) {" << endl << indent()
-                   << "  return $result->{success};" << endl << indent() << "}" << endl;
+        f_service_ << indent() << "if (defined $result->{success} ) {" << '\n' << indent()
+                   << "  return $result->{success};" << '\n' << indent() << "}" << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -1164,21 +1162,21 @@
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         f_service_ << indent() << "if (defined $result->{" << (*x_iter)->get_name() << "}) {"
-                   << endl << indent() << "  die $result->{" << (*x_iter)->get_name() << "};"
-                   << endl << indent() << "}" << endl;
+                   << '\n' << indent() << "  die $result->{" << (*x_iter)->get_name() << "};"
+                   << '\n' << indent() << "}" << '\n';
       }
 
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
+        indent(f_service_) << "return;" << '\n';
       } else {
         f_service_ << indent() << "die \"" << (*f_iter)->get_name() << " failed: unknown result\";"
-                   << endl;
+                   << '\n';
       }
 
       // Close function
       indent_down();
-      f_service_ << "}" << endl;
+      f_service_ << "}" << '\n';
     }
   }
 }
@@ -1244,7 +1242,7 @@
     } else if (type->is_enum()) {
       out << "readI32(\\$" << name << ");";
     }
-    out << endl;
+    out << '\n';
 
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
@@ -1263,8 +1261,8 @@
                                                    t_struct* tstruct,
                                                    string prefix) {
   out << indent() << "$" << prefix << " = " << perl_namespace(tstruct->get_program())
-      << tstruct->get_name() << "->new();" << endl << indent() << "$xfer += $" << prefix
-      << "->read($input);" << endl;
+      << tstruct->get_name() << "->new();" << '\n' << indent() << "$xfer += $" << prefix
+      << "->read($input);" << '\n';
 }
 
 void t_perl_generator::generate_deserialize_container(ostream& out, t_type* ttype, string prefix) {
@@ -1280,33 +1278,33 @@
   t_field fvtype(g_type_i8, vtype);
   t_field fetype(g_type_i8, etype);
 
-  out << indent() << "my $" << size << " = 0;" << endl;
+  out << indent() << "my $" << size << " = 0;" << '\n';
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << "$" << prefix << " = {};" << endl << indent() << "my $" << ktype << " = 0;"
-        << endl << indent() << "my $" << vtype << " = 0;" << endl;
+    out << indent() << "$" << prefix << " = {};" << '\n' << indent() << "my $" << ktype << " = 0;"
+        << '\n' << indent() << "my $" << vtype << " = 0;" << '\n';
 
     out << indent() << "$xfer += $input->readMapBegin("
-        << "\\$" << ktype << ", \\$" << vtype << ", \\$" << size << ");" << endl;
+        << "\\$" << ktype << ", \\$" << vtype << ", \\$" << size << ");" << '\n';
 
   } else if (ttype->is_set()) {
 
-    out << indent() << "$" << prefix << " = {};" << endl << indent() << "my $" << etype << " = 0;"
-        << endl << indent() << "$xfer += $input->readSetBegin("
-        << "\\$" << etype << ", \\$" << size << ");" << endl;
+    out << indent() << "$" << prefix << " = {};" << '\n' << indent() << "my $" << etype << " = 0;"
+        << '\n' << indent() << "$xfer += $input->readSetBegin("
+        << "\\$" << etype << ", \\$" << size << ");" << '\n';
 
   } else if (ttype->is_list()) {
 
-    out << indent() << "$" << prefix << " = [];" << endl << indent() << "my $" << etype << " = 0;"
-        << endl << indent() << "$xfer += $input->readListBegin("
-        << "\\$" << etype << ", \\$" << size << ");" << endl;
+    out << indent() << "$" << prefix << " = [];" << '\n' << indent() << "my $" << etype << " = 0;"
+        << '\n' << indent() << "$xfer += $input->readListBegin("
+        << "\\$" << etype << ", \\$" << size << ");" << '\n';
   }
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) << "for (my $" << i << " = 0; $" << i << " < $" << size << "; ++$" << i << ")"
-              << endl;
+              << '\n';
 
   scope_up(out);
 
@@ -1322,11 +1320,11 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "$xfer += $input->readMapEnd();" << endl;
+    indent(out) << "$xfer += $input->readMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "$xfer += $input->readSetEnd();" << endl;
+    indent(out) << "$xfer += $input->readSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "$xfer += $input->readListEnd();" << endl;
+    indent(out) << "$xfer += $input->readListEnd();" << '\n';
   }
 
   scope_down(out);
@@ -1341,24 +1339,24 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey, true, true) << endl;
-  indent(out) << declare_field(&fval, true, true) << endl;
+  indent(out) << declare_field(&fkey, true, true) << '\n';
+  indent(out) << declare_field(&fval, true, true) << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << "$" << prefix << "->{$" << key << "} = $" << val << ";" << endl;
+  indent(out) << "$" << prefix << "->{$" << key << "} = $" << val << ";" << '\n';
 }
 
 void t_perl_generator::generate_deserialize_set_element(ostream& out, t_set* tset, string prefix) {
   string elem = tmp("elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << "my $" << elem << " = undef;" << endl;
+  indent(out) << "my $" << elem << " = undef;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << "$" << prefix << "->{$" << elem << "} = 1;" << endl;
+  indent(out) << "$" << prefix << "->{$" << elem << "} = 1;" << '\n';
 }
 
 void t_perl_generator::generate_deserialize_list_element(ostream& out,
@@ -1367,11 +1365,11 @@
   string elem = tmp("elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << "my $" << elem << " = undef;" << endl;
+  indent(out) << "my $" << elem << " = undef;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << "push(@{$" << prefix << "},$" << elem << ");" << endl;
+  indent(out) << "push(@{$" << prefix << "},$" << elem << ");" << '\n';
 }
 
 /**
@@ -1435,7 +1433,7 @@
     } else if (type->is_enum()) {
       out << "writeI32($" << name << ");";
     }
-    out << endl;
+    out << '\n';
 
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
@@ -1453,7 +1451,7 @@
  */
 void t_perl_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << "$xfer += $" << prefix << "->write($output);" << endl;
+  indent(out) << "$xfer += $" << prefix << "->write($output);" << '\n';
 }
 
 /**
@@ -1466,17 +1464,17 @@
     indent(out) << "$xfer += $output->writeMapBegin("
                 << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                 << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "scalar(keys %{$" << prefix << "}));" << endl;
+                << "scalar(keys %{$" << prefix << "}));" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "$xfer += $output->writeSetBegin("
                 << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "scalar(@{$" << prefix << "}));" << endl;
+                << "scalar(@{$" << prefix << "}));" << '\n';
 
   } else if (ttype->is_list()) {
 
     indent(out) << "$xfer += $output->writeListBegin("
                 << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", "
-                << "scalar(@{$" << prefix << "}));" << endl;
+                << "scalar(@{$" << prefix << "}));" << '\n';
   }
 
   scope_up(out);
@@ -1485,7 +1483,7 @@
     string kiter = tmp("kiter");
     string viter = tmp("viter");
     indent(out) << "while( my ($" << kiter << ",$" << viter << ") = each %{$" << prefix << "}) "
-                << endl;
+                << '\n';
 
     scope_up(out);
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
@@ -1493,14 +1491,14 @@
 
   } else if (ttype->is_set()) {
     string iter = tmp("iter");
-    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "})" << endl;
+    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "})" << '\n';
     scope_up(out);
     generate_serialize_set_element(out, (t_set*)ttype, iter);
     scope_down(out);
 
   } else if (ttype->is_list()) {
     string iter = tmp("iter");
-    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "}) " << endl;
+    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "}) " << '\n';
     scope_up(out);
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     scope_down(out);
@@ -1509,11 +1507,11 @@
   scope_down(out);
 
   if (ttype->is_map()) {
-    indent(out) << "$xfer += $output->writeMapEnd();" << endl;
+    indent(out) << "$xfer += $output->writeMapEnd();" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "$xfer += $output->writeSetEnd();" << endl;
+    indent(out) << "$xfer += $output->writeSetEnd();" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "$xfer += $output->writeListEnd();" << endl;
+    indent(out) << "$xfer += $output->writeListEnd();" << '\n';
   }
 
   scope_down(out);
diff --git a/compiler/cpp/src/thrift/generate/t_php_generator.cc b/compiler/cpp/src/thrift/generate/t_php_generator.cc
index 8373858..6879501 100644
--- a/compiler/cpp/src/thrift/generate/t_php_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_php_generator.cc
@@ -35,8 +35,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 #define NSGLOBAL (nsglobal_.size() ? nsglobal_ : "")
 #define NSGLOBAL_A ("\\" + NSGLOBAL)
 #define NSGLOBAL_B (NSGLOBAL + "\\")
@@ -62,7 +60,7 @@
     validate_ = false;
     json_serializable_ = false;
     getters_setters_ = false;
-        
+
     nsglobal_ = ""; // by default global namespace is empty
     classmap_ = false;
     for (iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
@@ -513,28 +511,28 @@
  * Generates service header contains namespace suffix and includes inside file specified
  */
 void t_php_generator::generate_service_header(t_service* tservice, std::ostream& file) {
-  file << "<?php" << endl;
+  file << "<?php" << '\n';
   if (!php_namespace_suffix(tservice->get_program()).empty()) {
-    file << "namespace " << php_namespace_suffix(tservice->get_program()) << ";" << endl
-         << endl;
+    file << "namespace " << php_namespace_suffix(tservice->get_program()) << ";" << '\n'
+         << '\n';
   }
   file << autogen_comment() << php_includes();
 
-  file << endl;
+  file << '\n';
 }
 
 /**
  * Generates program header contains namespace suffix and includes inside file specified
  */
 void t_php_generator::generate_program_header(std::ostream& file) {
-  file << "<?php" << endl;
+  file << "<?php" << '\n';
   if (!php_namespace_suffix(get_program()).empty()) {
-    file << "namespace " << php_namespace_suffix(get_program()) << ";" << endl
-         << endl;
+    file << "namespace " << php_namespace_suffix(get_program()) << ";" << '\n'
+         << '\n';
   }
   file << autogen_comment() << php_includes();
 
-  file << endl;
+  file << '\n';
 }
 
 /**
@@ -558,30 +556,30 @@
   // code but you can't do things like an 'extract' on it, which is a bit of
   // a downer.
   generate_php_doc(f_enum, tenum);
-  f_enum << "final class " << tenum->get_name() << endl
-         << "{" << endl;
+  f_enum << "final class " << tenum->get_name() << '\n'
+         << "{" << '\n';
   indent_up();
 
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
     generate_php_doc(f_enum, *c_iter);
-    indent(f_enum) << "const " << (*c_iter)->get_name() << " = " << value << ";" << endl
-                   << endl;
+    indent(f_enum) << "const " << (*c_iter)->get_name() << " = " << value << ";" << '\n'
+                   << '\n';
   }
 
-  indent(f_enum) << "static public $__names = array(" << endl;
+  indent(f_enum) << "static public $__names = array(" << '\n';
 
   indent_up();
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    indent(f_enum) << value << " => '" << (*c_iter)->get_name() << "'," << endl;
+    indent(f_enum) << value << " => '" << (*c_iter)->get_name() << "'," << '\n';
   }
   indent_down();
-  indent(f_enum) << ");" << endl;
+  indent(f_enum) << ");" << '\n';
 
   indent_down();
 
-  f_enum << "}" << endl << endl;
+  f_enum << "}" << '\n' << '\n';
   if (!classmap_) {
     f_enum.close();
   }
@@ -604,8 +602,8 @@
       f_consts.open(f_consts_name.c_str());
       generate_program_header(f_consts);
     }
-    f_consts << "final class Constant extends \\Thrift\\Type\\TConstant"<< endl
-             << "{" << endl;
+    f_consts << "final class Constant extends \\Thrift\\Type\\TConstant"<< '\n'
+             << "{" << '\n';
 
     indent_up();
 
@@ -613,30 +611,30 @@
     for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
       string name = (*c_iter)->get_name();
 
-      indent(f_consts) << "static protected $" << name << ";" << endl;
+      indent(f_consts) << "static protected $" << name << ";" << '\n';
     }
 
     // Create init function
     for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
       string name = (*c_iter)->get_name();
 
-      f_consts << endl;
+      f_consts << '\n';
 
-      f_consts << indent() << "protected static function init_" << name << "()" <<endl
-               << indent() << "{" << endl;
+      f_consts << indent() << "protected static function init_" << name << "()" << '\n'
+               << indent() << "{" << '\n';
       indent_up();
 
       indent(f_consts) << "return ";
       generate_php_doc(f_consts, *c_iter);
       f_consts << render_const_value((*c_iter)->get_type(), (*c_iter)->get_value());
-      f_consts << ";" << endl;
+      f_consts << ";" << '\n';
 
       indent_down();
-      indent(f_consts) << "}" << endl;
+      indent(f_consts) << "}" << '\n';
     }
 
     indent_down();
-    f_consts << "}" << endl;
+    f_consts << "}" << '\n';
     if (!classmap_) {
       f_consts.close();
     }
@@ -679,7 +677,7 @@
   } else if (type->is_enum()) {
     indent(out) << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << "new " << php_namespace(type->get_program()) << type->get_name() << "(array(" << endl;
+    out << "new " << php_namespace(type->get_program()) << type->get_name() << "(array(" << '\n';
     indent_up();
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -699,14 +697,14 @@
       out << render_const_value(g_type_string, v_iter->first);
       out << " => ";
       out << render_const_value(field_type, v_iter->second);
-      out << "," << endl;
+      out << "," << '\n';
     }
     indent_down();
     indent(out) << "))";
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "array(" << endl;
+    out << "array(" << '\n';
     indent_up();
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
@@ -715,7 +713,7 @@
       out << render_const_value(ktype, v_iter->first);
       out << " => ";
       out << render_const_value(vtype, v_iter->second);
-      out << "," << endl;
+      out << "," << '\n';
     }
     indent_down();
     indent(out) << ")";
@@ -726,7 +724,7 @@
     } else {
       etype = ((t_set*)type)->get_elem_type();
     }
-    out << "array(" << endl;
+    out << "array(" << '\n';
     indent_up();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
@@ -736,7 +734,7 @@
       if (type->is_set()) {
         out << " => true";
       }
-      out << "," << endl;
+      out << "," << '\n';
     }
     indent_down();
     indent(out) << ")";
@@ -779,27 +777,27 @@
 
 void t_php_generator::generate_php_type_spec(ostream& out, t_type* t) {
   t = get_true_type(t);
-  indent(out) << "'type' => " << type_to_enum(t) << "," << endl;
+  indent(out) << "'type' => " << type_to_enum(t) << "," << '\n';
 
   if (t->is_base_type()) {
     // Noop, type is all we need
   } else if (t->is_struct() || t->is_xception() || t->is_enum()) {
     indent(out) << "'class' => '" << php_namespace(t->get_program()) << t->get_name() << "',"
-                << endl;
+                << '\n';
   } else if (t->is_map()) {
     t_type* ktype = get_true_type(((t_map*)t)->get_key_type());
     t_type* vtype = get_true_type(((t_map*)t)->get_val_type());
-    indent(out) << "'ktype' => " << type_to_enum(ktype) << "," << endl;
-    indent(out) << "'vtype' => " << type_to_enum(vtype) << "," << endl;
-    indent(out) << "'key' => array(" << endl;
+    indent(out) << "'ktype' => " << type_to_enum(ktype) << "," << '\n';
+    indent(out) << "'vtype' => " << type_to_enum(vtype) << "," << '\n';
+    indent(out) << "'key' => array(" << '\n';
     indent_up();
     generate_php_type_spec(out, ktype);
     indent_down();
-    indent(out) << ")," << endl;
-    indent(out) << "'val' => array(" << endl;
+    indent(out) << ")," << '\n';
+    indent(out) << "'val' => array(" << '\n';
     indent_up();
     generate_php_type_spec(out, vtype);
-    indent(out) << ")," << endl;
+    indent(out) << ")," << '\n';
     indent_down();
   } else if (t->is_list() || t->is_set()) {
     t_type* etype;
@@ -808,11 +806,11 @@
     } else {
       etype = get_true_type(((t_set*)t)->get_elem_type());
     }
-    indent(out) << "'etype' => " << type_to_enum(etype) << "," << endl;
-    indent(out) << "'elem' => array(" << endl;
+    indent(out) << "'etype' => " << type_to_enum(etype) << "," << '\n';
+    indent(out) << "'elem' => array(" << '\n';
     indent_up();
     generate_php_type_spec(out, etype);
-    indent(out) << ")," << endl;
+    indent(out) << ")," << '\n';
     indent_down();
   } else {
     throw "compiler error: no type for php struct spec field";
@@ -824,24 +822,24 @@
  * type information to generalize serialization routines.
  */
 void t_php_generator::generate_php_struct_spec(ostream& out, t_struct* tstruct) {
-  indent(out) << "static public $_TSPEC = array(" << endl;
+  indent(out) << "static public $_TSPEC = array(" << '\n';
   indent_up();
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
-    indent(out) << (*m_iter)->get_key() << " => array(" << endl;
+    indent(out) << (*m_iter)->get_key() << " => array(" << '\n';
     indent_up();
-    out << indent() << "'var' => '" << (*m_iter)->get_name() << "'," << endl;
-    out << indent() << "'isRequired' => " << ((*m_iter)->get_req() == t_field::T_REQUIRED ? "true" : "false") << "," << endl;
+    out << indent() << "'var' => '" << (*m_iter)->get_name() << "'," << '\n';
+    out << indent() << "'isRequired' => " << ((*m_iter)->get_req() == t_field::T_REQUIRED ? "true" : "false") << "," << '\n';
     generate_php_type_spec(out, t);
     indent_down();
-    indent(out) << ")," << endl;
+    indent(out) << ")," << '\n';
   }
 
   indent_down();
-  indent(out) << ");" << endl << endl;
+  indent(out) << ");" << '\n' << '\n';
 }
 /**
  * Generates necessary accessors and mutators for the fields
@@ -865,10 +863,10 @@
     indent_down();
   }
 
-  indent(out) << endl;
+  indent(out) << '\n';
   out << getter_stream.str();
   out << setter_stream.str();
-  indent(out) << endl;
+  indent(out) << '\n';
 }
 /**
  * Generates a getter for the generated private fields
@@ -878,16 +876,16 @@
                                                    string cap_name) {
 
 
-  out << indent() << "public function " << "get" << cap_name << "()" << endl
-      << indent() << "{" << endl;
+  out << indent() << "public function " << "get" << cap_name << "()" << '\n'
+      << indent() << "{" << '\n';
 
   indent_up();
 
-  out << indent() << "return $this->" << field_name << ";" << endl;
+  out << indent() << "return $this->" << field_name << ";" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl;
-  out << endl;
+  out << indent() << "}" << '\n';
+  out << '\n';
 }
 /**
  * Generates a setter for the generated private fields
@@ -896,17 +894,17 @@
                           string field_name,
                           string cap_name) {
 
-  out << indent() << "public function set" << cap_name << "(" << "$" << field_name << ")" << endl
-      << indent() << "{" << endl;
+  out << indent() << "public function set" << cap_name << "(" << "$" << field_name << ")" << '\n'
+      << indent() << "{" << '\n';
 
   indent_up();
 
-  out << indent() << "$this->" << field_name << " = $" << field_name << ";" << endl;
+  out << indent() << "$this->" << field_name << " = $" << field_name << ";" << '\n';
 
 
   indent_down();
-  out << indent() << "}" << endl;
-  out << endl;
+  out << indent() << "}" << '\n';
+  out << '\n';
 }
 /**
  * Gets the first-letter capitalized name for the field
@@ -943,11 +941,11 @@
   if (json_serializable_) {
     out << " implements JsonSerializable";
   }
-  out << endl
-      << "{" << endl;
+  out << '\n'
+      << "{" << '\n';
   indent_up();
 
-  out << indent() << "static public $isValidate = " << (validate_ ? "true" : "false") << ";" << endl << endl;
+  out << indent() << "static public $isValidate = " << (validate_ ? "true" : "false") << ";" << '\n' << '\n';
 
   generate_php_struct_spec(out, tstruct);
 
@@ -959,15 +957,15 @@
     }
     generate_php_doc(out, *m_iter);
     string access = (getters_setters_) ? "private" : "public";
-    indent(out) << access << " $" << (*m_iter)->get_name() << " = " << dval << ";" << endl;
+    indent(out) << access << " $" << (*m_iter)->get_name() << " = " << dval << ";" << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   // Generate constructor from array
   string param = (members.size() > 0) ? "$vals = null" : "";
-  out << indent() << "public function __construct(" << param << ")"<< endl
-      << indent() << "{" << endl;
+  out << indent() << "public function __construct(" << param << ")"<< '\n'
+      << indent() << "{" << '\n';
   indent_up();
 
   if (members.size() > 0) {
@@ -975,62 +973,62 @@
       t_type* t = get_true_type((*m_iter)->get_type());
       if ((*m_iter)->get_value() != nullptr && (t->is_struct() || t->is_xception())) {
         indent(out) << "$this->" << (*m_iter)->get_name() << " = "
-                    << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
+                    << render_const_value(t, (*m_iter)->get_value()) << ";" << '\n';
       }
     }
-    out << indent() << "if (is_array($vals)) {" << endl;
+    out << indent() << "if (is_array($vals)) {" << '\n';
     indent_up();
     if (oop_) {
-      out << indent() << "parent::__construct(self::$_TSPEC, $vals);" << endl;
+      out << indent() << "parent::__construct(self::$_TSPEC, $vals);" << '\n';
     } else {
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        out << indent() << "if (isset($vals['" << (*m_iter)->get_name() << "'])) {" << endl;
+        out << indent() << "if (isset($vals['" << (*m_iter)->get_name() << "'])) {" << '\n';
 
         indent_up();
         out << indent() << "$this->" << (*m_iter)->get_name() << " = $vals['"
-            << (*m_iter)->get_name() << "'];" << endl;
+            << (*m_iter)->get_name() << "'];" << '\n';
 
         indent_down();
-        out << indent() << "}" << endl;
+        out << indent() << "}" << '\n';
       }
     }
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
   }
   scope_down(out);
-  out << endl;
+  out << '\n';
 
-  out << indent() << "public function getName()" << endl
-      << indent() << "{" << endl;
+  out << indent() << "public function getName()" << '\n'
+      << indent() << "{" << '\n';
 
   indent_up();
-  out << indent() << "return '" << tstruct->get_name() << "';" << endl;
+  out << indent() << "return '" << tstruct->get_name() << "';" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl << endl;
+  out << indent() << "}" << '\n' << '\n';
 
-  out << endl;
+  out << '\n';
   if (getters_setters_) {
     generate_generic_field_getters_setters(out, tstruct);
   }
   generate_php_struct_reader(out, tstruct, is_result);
-  out << endl;
+  out << '\n';
   generate_php_struct_writer(out, tstruct, is_result);
   if (needs_php_read_validator(tstruct, is_result)) {
-    out << endl;
+    out << '\n';
     generate_php_struct_read_validator(out, tstruct);
   }
   if (needs_php_write_validator(tstruct, is_result)) {
-    out << endl;
+    out << '\n';
     generate_php_struct_write_validator(out, tstruct);
   }
   if (json_serializable_) {
-    out << endl;
+    out << '\n';
     generate_php_struct_json_serialize(out, tstruct, is_result);
   }
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 }
 
 /**
@@ -1040,34 +1038,34 @@
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "public function read($input)" << endl;
+  indent(out) << "public function read($input)" << '\n';
   scope_up(out);
 
   if (oop_) {
     if (needs_php_read_validator(tstruct, is_result)) {
       indent(out) << "$tmp = $this->_read('" << tstruct->get_name() << "', self::$_TSPEC, $input);"
-                  << endl;
-      indent(out) << "$this->_validateForRead();" << endl;
-      indent(out) << "return $tmp;" << endl;
+                  << '\n';
+      indent(out) << "$this->_validateForRead();" << '\n';
+      indent(out) << "return $tmp;" << '\n';
     } else {
       indent(out) << "return $this->_read('" << tstruct->get_name() << "', self::$_TSPEC, $input);"
-                  << endl;
+                  << '\n';
     }
     scope_down(out);
-    out << endl;
+    out << '\n';
     return;
   }
 
-  out << indent() << "$xfer = 0;" << endl << indent() << "$fname = null;" << endl << indent()
-      << "$ftype = 0;" << endl << indent() << "$fid = 0;" << endl;
+  out << indent() << "$xfer = 0;" << '\n' << indent() << "$fname = null;" << '\n' << indent()
+      << "$ftype = 0;" << '\n' << indent() << "$fid = 0;" << '\n';
 
   // Declare stack tmp variables
   if (!binary_inline_) {
-    indent(out) << "$xfer += $input->readStructBegin($fname);" << endl;
+    indent(out) << "$xfer += $input->readStructBegin($fname);" << '\n';
   }
 
   // Loop over reading in fields
-  indent(out) << "while (true) {" << endl;
+  indent(out) << "while (true) {" << '\n';
 
   indent_up();
 
@@ -1077,80 +1075,80 @@
     t_field ffid(g_type_i16, "fid");
     generate_deserialize_field(out, &fftype);
     out << indent() << "if ($ftype == "
-        << "TType::STOP) {" << endl << indent() << "  break;" << endl << indent() << "}" << endl;
+        << "TType::STOP) {" << '\n' << indent() << "  break;" << '\n' << indent() << "}" << '\n';
     generate_deserialize_field(out, &ffid);
   } else {
-    indent(out) << "$xfer += $input->readFieldBegin($fname, $ftype, $fid);" << endl;
+    indent(out) << "$xfer += $input->readFieldBegin($fname, $ftype, $fid);" << '\n';
     // Check for field STOP marker and break
     indent(out) << "if ($ftype == "
-                << "TType::STOP) {" << endl;
+                << "TType::STOP) {" << '\n';
     indent_up();
-    indent(out) << "break;" << endl;
+    indent(out) << "break;" << '\n';
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
   // Switch statement on the field we are reading
-  indent(out) << "switch ($fid) {" << endl;
+  indent(out) << "switch ($fid) {" << '\n';
 
   indent_up();
 
   // Generate deserialization code for known cases
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
+    indent(out) << "case " << (*f_iter)->get_key() << ":" << '\n';
     indent_up();
-    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
+    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << '\n';
     indent_up();
     generate_deserialize_field(out, *f_iter, "this->");
     indent_down();
-    out << indent() << "} else {" << endl;
+    out << indent() << "} else {" << '\n';
 
     indent_up();
     if (binary_inline_) {
-      indent(out) << "$xfer += TProtocol::skipBinary($input, $ftype);" << endl;
+      indent(out) << "$xfer += TProtocol::skipBinary($input, $ftype);" << '\n';
     } else {
-      indent(out) << "$xfer += $input->skip($ftype);" << endl;
+      indent(out) << "$xfer += $input->skip($ftype);" << '\n';
     }
 
     indent_down();
-    out << indent() << "}" << endl << indent() << "break;" << endl;
+    out << indent() << "}" << '\n' << indent() << "break;" << '\n';
     indent_down();
   }
 
   // In the default case we skip the field
-  indent(out) << "default:" << endl;
+  indent(out) << "default:" << '\n';
 
   indent_up();
   if (binary_inline_) {
     indent(out) << "$xfer += "
-                << "TProtocol::skipBinary($input, $ftype);" << endl;
+                << "TProtocol::skipBinary($input, $ftype);" << '\n';
   } else {
-    indent(out) << "$xfer += $input->skip($ftype);" << endl;
+    indent(out) << "$xfer += $input->skip($ftype);" << '\n';
   }
-  indent(out) << "break;" << endl;
+  indent(out) << "break;" << '\n';
   indent_down();
 
   scope_down(out);
 
   if (!binary_inline_) {
     // Read field end marker
-    indent(out) << "$xfer += $input->readFieldEnd();" << endl;
+    indent(out) << "$xfer += $input->readFieldEnd();" << '\n';
   }
 
   scope_down(out);
 
   if (!binary_inline_) {
-    indent(out) << "$xfer += $input->readStructEnd();" << endl;
+    indent(out) << "$xfer += $input->readStructEnd();" << '\n';
   }
 
   if (needs_php_read_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForRead();" << endl;
+    indent(out) << "$this->_validateForRead();" << '\n';
   }
 
-  indent(out) << "return $xfer;" << endl;
+  indent(out) << "return $xfer;" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 }
 
 /**
@@ -1162,33 +1160,33 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (binary_inline_) {
-    indent(out) << "public function write(&$output)" << endl;
+    indent(out) << "public function write(&$output)" << '\n';
   } else {
-    indent(out) << "public function write($output)" << endl;
+    indent(out) << "public function write($output)" << '\n';
   }
-  indent(out) << "{" << endl;
+  indent(out) << "{" << '\n';
   indent_up();
 
   if (needs_php_write_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForWrite();" << endl;
+    indent(out) << "$this->_validateForWrite();" << '\n';
   }
 
   if (oop_) {
     indent(out) << "return $this->_write('" << tstruct->get_name() << "', self::$_TSPEC, $output);"
-                << endl;
+                << '\n';
     scope_down(out);
-    out << endl;
+    out << '\n';
     return;
   }
 
-  indent(out) << "$xfer = 0;" << endl;
+  indent(out) << "$xfer = 0;" << '\n';
 
   if (!binary_inline_) {
-    indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << endl;
+    indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << '\n';
   }
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if ($this->" << (*f_iter)->get_name() << " !== null) {" << endl;
+    out << indent() << "if ($this->" << (*f_iter)->get_name() << " !== null) {" << '\n';
     indent_up();
 
     t_type* type = get_true_type((*f_iter)->get_type());
@@ -1200,22 +1198,22 @@
     }
     if (!expect.empty()) {
       out << indent() << "if (!is_" << expect << "($this->" << (*f_iter)->get_name() << ")) {"
-          << endl;
+          << '\n';
       indent_up();
       out << indent() << "throw new "
           << "TProtocolException('Bad type in structure.', "
-          << "TProtocolException::INVALID_DATA);" << endl;
+          << "TProtocolException::INVALID_DATA);" << '\n';
       scope_down(out);
     }
 
     // Write field header
     if (binary_inline_) {
       out << indent() << "$output .= pack('c', " << type_to_enum((*f_iter)->get_type()) << ");"
-          << endl << indent() << "$output .= pack('n', " << (*f_iter)->get_key() << ");" << endl;
+          << '\n' << indent() << "$output .= pack('n', " << (*f_iter)->get_key() << ");" << '\n';
     } else {
       indent(out) << "$xfer += $output->writeFieldBegin("
                   << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                  << ", " << (*f_iter)->get_key() << ");" << endl;
+                  << ", " << (*f_iter)->get_key() << ");" << '\n';
     }
 
     // Write field contents
@@ -1223,25 +1221,25 @@
 
     // Write field closer
     if (!binary_inline_) {
-      indent(out) << "$xfer += $output->writeFieldEnd();" << endl;
+      indent(out) << "$xfer += $output->writeFieldEnd();" << '\n';
     }
 
     indent_down();
-    indent(out) << "}" << endl;
+    indent(out) << "}" << '\n';
   }
 
   if (binary_inline_) {
     out << indent() << "$output .= pack('c', "
-        << "TType::STOP);" << endl;
+        << "TType::STOP);" << '\n';
   } else {
-    out << indent() << "$xfer += $output->writeFieldStop();" << endl << indent()
-        << "$xfer += $output->writeStructEnd();" << endl;
+    out << indent() << "$xfer += $output->writeFieldStop();" << '\n' << indent()
+        << "$xfer += $output->writeStructEnd();" << '\n';
   }
 
-  out << indent() << "return $xfer;" << endl;
+  out << indent() << "return $xfer;" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 }
 
 void t_php_generator::generate_php_struct_read_validator(ostream& out, t_struct* tstruct) {
@@ -1256,7 +1254,7 @@
                                                              t_struct* tstruct,
                                                              std::string method_name,
                                                              bool write_mode) {
-  indent(out) << "private function " << method_name << "() {" << endl;
+  indent(out) << "private function " << method_name << "() {" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -1268,32 +1266,32 @@
       t_field* field = (*f_iter);
       if (field->get_req() == t_field::T_REQUIRED
           || (field->get_req() == t_field::T_OPT_IN_REQ_OUT && write_mode)) {
-        indent(out) << "if ($this->" << field->get_name() << " === null) {" << endl;
+        indent(out) << "if ($this->" << field->get_name() << " === null) {" << '\n';
         indent_up();
         indent(out) << "throw new TProtocolException('Required field " << tstruct->get_name() << "."
-                    << field->get_name() << " is unset!');" << endl;
+                    << field->get_name() << " is unset!');" << '\n';
         indent_down();
-        indent(out) << "}" << endl;
+        indent(out) << "}" << '\n';
       }
     }
   }
 
   indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 void t_php_generator::generate_php_struct_json_serialize(ostream& out,
                                                          t_struct* tstruct,
                                                          bool is_result) {
-  indent(out) << "#[\\ReturnTypeWillChange]" << endl;                                                          
-  indent(out) << "public function jsonSerialize() {" << endl;
+  indent(out) << "#[\\ReturnTypeWillChange]" << '\n';
+  indent(out) << "public function jsonSerialize() {" << '\n';
   indent_up();
 
   if (needs_php_write_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForWrite();" << endl;
+    indent(out) << "$this->_validateForWrite();" << '\n';
   }
 
-  indent(out) << "$json = new stdClass;" << endl;
+  indent(out) << "$json = new stdClass;" << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
 
@@ -1312,7 +1310,7 @@
           continue;
         }
       }
-      indent(out) << "if ($this->" << name << " !== null) {" << endl;
+      indent(out) << "if ($this->" << name << " !== null) {" << '\n';
       indent_up();
       indent(out) << "$json->" << name << " = ";
       if (type->is_map()) {
@@ -1320,16 +1318,16 @@
       } else {
         out << type_to_cast(type);
       }
-      out << "$this->" << name << ";" << endl;
+      out << "$this->" << name << ";" << '\n';
       indent_down();
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   }
 
-  indent(out) << "return $json;" << endl;
+  indent(out) << "return $json;" << '\n';
   indent_down();
 
-  indent(out) << "}" << endl;
+  indent(out) << "}" << '\n';
 }
 
 int t_php_generator::get_php_num_required_fields(const vector<t_field*>& fields, bool write_mode) {
@@ -1382,7 +1380,7 @@
 
   if(classmap_) {
     // Close service file
-    f_service_ << endl;
+    f_service_ << '\n';
     f_service_.close();
   }
 }
@@ -1413,34 +1411,34 @@
   }
 
   // Generate the header portion
-  f_service_processor << "class " << service_name_ << "Processor" << extends_processor << endl
-                      << "{" << endl;
+  f_service_processor << "class " << service_name_ << "Processor" << extends_processor << '\n'
+                      << "{" << '\n';
   indent_up();
 
   if (extends.empty()) {
-    f_service_processor << indent() << "protected $handler_ = null;" << endl;
+    f_service_processor << indent() << "protected $handler_ = null;" << '\n';
   }
 
-  f_service_processor << indent() << "public function __construct($handler)"<< endl
-                      << indent() << "{" << endl;
+  f_service_processor << indent() << "public function __construct($handler)"<< '\n'
+                      << indent() << "{" << '\n';
 
   indent_up();
   if (extends.empty()) {
-    f_service_processor << indent() << "$this->handler_ = $handler;" << endl;
+    f_service_processor << indent() << "$this->handler_ = $handler;" << '\n';
   } else {
-    f_service_processor << indent() << "parent::__construct($handler);" << endl;
+    f_service_processor << indent() << "parent::__construct($handler);" << '\n';
   }
 
   indent_down();
-  f_service_processor << indent() << "}" << endl << endl;
+  f_service_processor << indent() << "}" << '\n' << '\n';
 
   // Generate the server implementation
-  f_service_processor << indent() << "public function process($input, $output)" << endl
-                      << indent() << "{" << endl;
+  f_service_processor << indent() << "public function process($input, $output)" << '\n'
+                      << indent() << "{" << '\n';
   indent_up();
 
-  f_service_processor << indent() << "$rseqid = 0;" << endl << indent() << "$fname = null;" << endl
-                      << indent() << "$mtype = 0;" << endl << endl;
+  f_service_processor << indent() << "$rseqid = 0;" << '\n' << indent() << "$fname = null;" << '\n'
+                      << indent() << "$mtype = 0;" << '\n' << '\n';
 
   if (binary_inline_) {
     t_field ffname(g_type_string, "fname");
@@ -1450,36 +1448,36 @@
     generate_deserialize_field(f_service_processor, &fmtype, "", true);
     generate_deserialize_field(f_service_processor, &fseqid, "", true);
   } else {
-    f_service_processor << indent() << "$input->readMessageBegin($fname, $mtype, $rseqid);" << endl;
+    f_service_processor << indent() << "$input->readMessageBegin($fname, $mtype, $rseqid);" << '\n';
   }
 
   // HOT: check for method implementation
-  f_service_processor << indent() << "$methodname = 'process_'.$fname;" << endl
-                      << indent() << "if (!method_exists($this, $methodname)) {" << endl;
+  f_service_processor << indent() << "$methodname = 'process_'.$fname;" << '\n'
+                      << indent() << "if (!method_exists($this, $methodname)) {" << '\n';
 
   indent_up();
   if (binary_inline_) {
-    f_service_processor << indent() << "throw new \\Exception('Function '.$fname.' not implemented.');" << endl;
+    f_service_processor << indent() << "throw new \\Exception('Function '.$fname.' not implemented.');" << '\n';
   } else {
     f_service_processor << indent() << "  $input->skip("
-                        << "TType::STRUCT);" << endl << indent() << "  $input->readMessageEnd();" << endl
+                        << "TType::STRUCT);" << '\n' << indent() << "  $input->readMessageEnd();" << '\n'
                         << indent() << "  $x = new "
                         << "TApplicationException('Function '.$fname.' not implemented.', "
-                        << "TApplicationException::UNKNOWN_METHOD);" << endl << indent()
+                        << "TApplicationException::UNKNOWN_METHOD);" << '\n' << indent()
                         << "  $output->writeMessageBegin($fname, "
-                        << "TMessageType::EXCEPTION, $rseqid);" << endl << indent()
-                        << "  $x->write($output);" << endl << indent() << "  $output->writeMessageEnd();"
-                        << endl << indent() << "  $output->getTransport()->flush();" << endl << indent()
-                        << "  return;" << endl;
+                        << "TMessageType::EXCEPTION, $rseqid);" << '\n' << indent()
+                        << "  $x->write($output);" << '\n' << indent() << "  $output->writeMessageEnd();"
+                        << '\n' << indent() << "  $output->getTransport()->flush();" << '\n' << indent()
+                        << "  return;" << '\n';
   }
 
   indent_down();
-  f_service_processor << indent() << "}" << endl
-                      << indent() << "$this->$methodname($rseqid, $input, $output);" << endl
-                      << indent() << "return true;" << endl;
+  f_service_processor << indent() << "}" << '\n'
+                      << indent() << "$this->$methodname($rseqid, $input, $output);" << '\n'
+                      << indent() << "return true;" << '\n';
 
   indent_down();
-  f_service_processor << indent() << "}" << endl << endl;
+  f_service_processor << indent() << "}" << '\n' << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1487,7 +1485,7 @@
   }
 
   indent_down();
-  f_service_processor << "}" << endl;
+  f_service_processor << "}" << '\n';
 
   if (!classmap_) {
     f_service_processor.close();
@@ -1501,8 +1499,8 @@
  */
 void t_php_generator::generate_process_function(std::ostream& out, t_service* tservice, t_function* tfunction) {
   // Open function
-  out << indent() << "protected function process_" << tfunction->get_name() << "($seqid, $input, $output)" << endl
-      << indent() << "{" << endl;
+  out << indent() << "protected function process_" << tfunction->get_name() << "($seqid, $input, $output)" << '\n'
+      << indent() << "{" << '\n';
   indent_up();
 
   string argsname = php_namespace(tservice->get_program()) + service_name_ + "_"
@@ -1512,32 +1510,32 @@
 
   out << indent() << "$bin_accel = ($input instanceof "
              << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary_after_message_begin');"
-             << endl;
-  out << indent() << "if ($bin_accel) {" << endl;
+             << '\n';
+  out << indent() << "if ($bin_accel) {" << '\n';
   indent_up();
 
-  out << indent() << "$args = thrift_protocol_read_binary_after_message_begin(" <<endl;
+  out << indent() << "$args = thrift_protocol_read_binary_after_message_begin(" << '\n';
 
   indent_up();
-  out << indent() << "$input,"<<endl
-      << indent() << "'" << argsname << "'," << endl
-      << indent() << "$input->isStrictRead()" <<endl;
+  out << indent() << "$input," << '\n'
+      << indent() << "'" << argsname << "'," << '\n'
+      << indent() << "$input->isStrictRead()" << '\n';
 
   indent_down();
-  out << indent() <<");" << endl;
+  out << indent() <<");" << '\n';
 
   indent_down();
-  out << indent() << "} else {" << endl;
+  out << indent() << "} else {" << '\n';
 
   indent_up();
-  out << indent() << "$args = new " << argsname << "();" << endl
-      << indent() << "$args->read($input);" << endl;
+  out << indent() << "$args = new " << argsname << "();" << '\n'
+      << indent() << "$args->read($input);" << '\n';
 
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 
   if (!binary_inline_) {
-    out << indent() << "$input->readMessageEnd();" << endl;
+    out << indent() << "$input->readMessageEnd();" << '\n';
   }
 
   t_struct* xs = tfunction->get_xceptions();
@@ -1546,12 +1544,12 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    out << indent() << "$result = new " << resultname << "();" << endl;
+    out << indent() << "$result = new " << resultname << "();" << '\n';
   }
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    out << indent() << "try {" << endl;
+    out << indent() << "try {" << '\n';
     indent_up();
   }
 
@@ -1574,7 +1572,7 @@
     }
     out << "$args->" << (*f_iter)->get_name();
   }
-  out << ");" << endl;
+  out << ");" << '\n';
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
     indent_down();
@@ -1582,70 +1580,70 @@
       out << indent() << "} catch ("
                  << php_namespace(get_true_type((*x_iter)->get_type())->get_program())
                  << (*x_iter)->get_type()->get_name() << " $" << (*x_iter)->get_name() << ") {"
-                 << endl;
+                 << '\n';
       if (!tfunction->is_oneway()) {
         indent_up();
         out << indent() << "$result->" << (*x_iter)->get_name() << " = $"
-                   << (*x_iter)->get_name() << ";" << endl;
+                   << (*x_iter)->get_name() << ";" << '\n';
         indent_down();
         out << indent();
       }
     }
-    out << "}" << endl;
+    out << "}" << '\n';
   }
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    out << indent() << "return;" << endl;
+    out << indent() << "return;" << '\n';
     indent_down();
-    out << indent() << "}" << endl;
+    out << indent() << "}" << '\n';
     return;
   }
 
   out << indent() << "$bin_accel = ($output instanceof "
              << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');"
-             << endl;
+             << '\n';
 
-  out << indent() << "if ($bin_accel) {" << endl;
+  out << indent() << "if ($bin_accel) {" << '\n';
   indent_up();
 
-  out << indent() << "thrift_protocol_write_binary(" << endl;
+  out << indent() << "thrift_protocol_write_binary(" << '\n';
 
   indent_up();
-  out << indent() << "$output,"<<endl
-      << indent() << "'" << tfunction->get_name()<< "'," <<endl
-      << indent() << "TMessageType::REPLY,"<< endl
-      << indent() << "$result," << endl
-      << indent() << "$seqid," << endl
-      << indent() << "$output->isStrictWrite()"<<endl;
+  out << indent() << "$output,"<< '\n'
+      << indent() << "'" << tfunction->get_name()<< "'," << '\n'
+      << indent() << "TMessageType::REPLY,"<< '\n'
+      << indent() << "$result," << '\n'
+      << indent() << "$seqid," << '\n'
+      << indent() << "$output->isStrictWrite()"<< '\n';
 
   indent_down();
-  out << indent() << ");" << endl;
+  out << indent() << ");" << '\n';
 
   indent_down();
-  out << indent() << "} else {" << endl;
+  out << indent() << "} else {" << '\n';
   indent_up();
 
   // Serialize the request header
   if (binary_inline_) {
     out << indent() << "$buff = pack('N', (0x80010000 | "
-        << "TMessageType::REPLY)); " << endl << indent() << "$buff .= pack('N', strlen('"
-        << tfunction->get_name() << "'));" << endl << indent() << "$buff .= '"
-        << tfunction->get_name() << "';" << endl << indent() << "$buff .= pack('N', $seqid);"
-        << endl << indent() << "$result->write($buff);" << endl << indent()
-        << "$output->write($buff);" << endl << indent() << "$output->flush();" << endl;
+        << "TMessageType::REPLY)); " << '\n' << indent() << "$buff .= pack('N', strlen('"
+        << tfunction->get_name() << "'));" << '\n' << indent() << "$buff .= '"
+        << tfunction->get_name() << "';" << '\n' << indent() << "$buff .= pack('N', $seqid);"
+        << '\n' << indent() << "$result->write($buff);" << '\n' << indent()
+        << "$output->write($buff);" << '\n' << indent() << "$output->flush();" << '\n';
   } else {
     out << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', "
-        << "TMessageType::REPLY, $seqid);" << endl << indent() << "$result->write($output);"
-        << endl << indent() << "$output->writeMessageEnd();" << endl << indent()
-        << "$output->getTransport()->flush();" << endl;
+        << "TMessageType::REPLY, $seqid);" << '\n' << indent() << "$result->write($output);"
+        << '\n' << indent() << "$output->writeMessageEnd();" << '\n' << indent()
+        << "$output->getTransport()->flush();" << '\n';
   }
 
   scope_down(out);
 
   // Close function
   indent_down();
-  out << indent() << "}" << endl;
+  out << indent() << "}" << '\n';
 }
 
 /**
@@ -1659,7 +1657,7 @@
 
   ofstream_with_content_based_conditional_update& f_struct_definition = f_service_;
   if (classmap_) {
-    f_struct_definition << "// HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+    f_struct_definition << "// HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
   }
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1738,18 +1736,18 @@
                  + tservice->get_extends()->get_name() + "If";
   }
   generate_php_doc(f_service_interface, tservice);
-  f_service_interface << "interface " << php_namespace_declaration(tservice) << "If" << extends_if << endl
-                      << "{" << endl;
+  f_service_interface << "interface " << php_namespace_declaration(tservice) << "If" << extends_if << '\n'
+                      << "{" << '\n';
 
   indent_up();
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     generate_php_doc(f_service_interface, *f_iter);
-    indent(f_service_interface) << "public function " << function_signature(*f_iter) << ";" << endl;
+    indent(f_service_interface) << "public function " << function_signature(*f_iter) << ";" << '\n';
   }
   indent_down();
-  f_service_interface << "}" << endl;
+  f_service_interface << "}" << '\n';
 
   // Close service interface file
   if (!classmap_) {
@@ -1776,21 +1774,21 @@
     extends_if = " extends " + php_namespace(tservice->get_extends()->get_program())
                  + tservice->get_extends()->get_name() + "Rest";
   }
-  f_service_rest << "class " << service_name_ << "Rest" << extends_if << endl
-                 << "{" << endl;
+  f_service_rest << "class " << service_name_ << "Rest" << extends_if << '\n'
+                 << "{" << '\n';
   indent_up();
 
   if (extends.empty()) {
-    f_service_rest << indent() << "protected $impl_;" << endl << endl;
+    f_service_rest << indent() << "protected $impl_;" << '\n' << '\n';
   }
 
-  f_service_rest << indent() << "public function __construct($impl) {" << endl << indent()
-             << "  $this->impl_ = $impl;" << endl << indent() << "}" << endl << endl;
+  f_service_rest << indent() << "public function __construct($impl) {" << '\n' << indent()
+             << "  $this->impl_ = $impl;" << '\n' << indent() << "}" << '\n' << '\n';
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent(f_service_rest) << "public function " << (*f_iter)->get_name() << "($request) {" << endl;
+    indent(f_service_rest) << "public function " << (*f_iter)->get_name() << "($request) {" << '\n';
     indent_up();
     const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
     vector<t_field*>::const_iterator a_iter;
@@ -1800,39 +1798,39 @@
       string req = "$request['" + (*a_iter)->get_name() + "']";
       if (atype->is_bool()) {
         f_service_rest << indent() << "$" << (*a_iter)->get_name() << " = " << cast << "(!empty(" << req
-                   << ") && (" << req << " !== 'false'));" << endl;
+                   << ") && (" << req << " !== 'false'));" << '\n';
       } else {
         f_service_rest << indent() << "$" << (*a_iter)->get_name() << " = isset(" << req << ") ? "
-                   << cast << req << " : null;" << endl;
+                   << cast << req << " : null;" << '\n';
       }
       /* slist no longer supported
       if (atype->is_string() && ((t_base_type*)atype)->is_string_list()) {
         f_service_rest << indent() << "$" << (*a_iter)->get_name() << " = explode(',', $"
-                       << (*a_iter)->get_name() << ");" << endl;
+                       << (*a_iter)->get_name() << ");" << '\n';
       } else */
       if (atype->is_map() || atype->is_list()) {
         f_service_rest << indent() << "$" << (*a_iter)->get_name() << " = json_decode($"
-                       << (*a_iter)->get_name() << ", true);" << endl;
+                       << (*a_iter)->get_name() << ", true);" << '\n';
       } else if (atype->is_set()) {
         f_service_rest << indent() << "$" << (*a_iter)->get_name() << " = array_fill_keys(json_decode($"
-                       << (*a_iter)->get_name() << ", true), 1);" << endl;
+                       << (*a_iter)->get_name() << ", true), 1);" << '\n';
       } else if (atype->is_struct() || atype->is_xception()) {
-        f_service_rest << indent() << "if ($" << (*a_iter)->get_name() << " !== null) {" << endl
+        f_service_rest << indent() << "if ($" << (*a_iter)->get_name() << " !== null) {" << '\n'
                        << indent() << "  $" << (*a_iter)->get_name() << " = new "
                        << php_namespace(atype->get_program()) << atype->get_name() << "(json_decode($"
-                       << (*a_iter)->get_name() << ", true));" << endl << indent() << "}" << endl;
+                       << (*a_iter)->get_name() << ", true));" << '\n' << indent() << "}" << '\n';
       }
     }
     f_service_rest << indent() << "return $this->impl_->" << (*f_iter)->get_name() << "("
-               << argument_list((*f_iter)->get_arglist(), false) << ");" << endl;
+               << argument_list((*f_iter)->get_arglist(), false) << ");" << '\n';
     indent_down();
-    indent(f_service_rest) << "}" << endl << endl;
+    indent(f_service_rest) << "}" << '\n' << '\n';
   }
   indent_down();
-  f_service_rest << "}" << endl << endl;
+  f_service_rest << "}" << '\n' << '\n';
 
   // Close service rest file
-  f_service_rest << endl;
+  f_service_rest << '\n';
   if (!classmap_) {
     f_service_rest.close();
   }
@@ -1860,31 +1858,31 @@
   }
 
   f_service_client << "class " << php_namespace_declaration(tservice) << "Client" << extends_client
-             << " implements " << php_namespace(tservice->get_program()) << service_name_ << "If" << endl
-             <<"{"<< endl;
+             << " implements " << php_namespace(tservice->get_program()) << service_name_ << "If" << '\n'
+             <<"{"<< '\n';
   indent_up();
 
   // Private members
   if (extends.empty()) {
-    f_service_client << indent() << "protected $input_ = null;" << endl << indent()
-               << "protected $output_ = null;" << endl << endl;
-    f_service_client << indent() << "protected $seqid_ = 0;" << endl << endl;
+    f_service_client << indent() << "protected $input_ = null;" << '\n' << indent()
+               << "protected $output_ = null;" << '\n' << '\n';
+    f_service_client << indent() << "protected $seqid_ = 0;" << '\n' << '\n';
   }
 
   // Constructor function
-  f_service_client << indent() << "public function __construct($input, $output = null)" << endl
-                   << indent() << "{" << endl;
+  f_service_client << indent() << "public function __construct($input, $output = null)" << '\n'
+                   << indent() << "{" << '\n';
 
   indent_up();
   if (!extends.empty()) {
-    f_service_client << indent() << "parent::__construct($input, $output);" << endl;
+    f_service_client << indent() << "parent::__construct($input, $output);" << '\n';
   } else {
-    f_service_client << indent() << "$this->input_ = $input;" << endl
-                     << indent() << "$this->output_ = $output ? $output : $input;" << endl;
+    f_service_client << indent() << "$this->input_ = $input;" << '\n'
+                     << indent() << "$this->output_ = $output ? $output : $input;" << '\n';
   }
 
   indent_down();
-  f_service_client << indent() << "}" << endl << endl;
+  f_service_client << indent() << "}" << '\n' << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -1895,10 +1893,10 @@
     vector<t_field*>::const_iterator fld_iter;
     string funname = (*f_iter)->get_name();
 
-    f_service_client << endl;
+    f_service_client << '\n';
 
     // Open function
-    indent(f_service_client) << "public function " << function_signature(*f_iter) << endl;
+    indent(f_service_client) << "public function " << function_signature(*f_iter) << '\n';
     scope_up(f_service_client);
     indent(f_service_client) << "$this->send_" << funname << "(";
 
@@ -1911,77 +1909,77 @@
       }
       f_service_client << "$" << (*fld_iter)->get_name();
     }
-    f_service_client << ");" << endl;
+    f_service_client << ");" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_client << indent();
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_client << "return ";
       }
-      f_service_client << "$this->recv_" << funname << "();" << endl;
+      f_service_client << "$this->recv_" << funname << "();" << '\n';
     }
     scope_down(f_service_client);
-    f_service_client << endl;
+    f_service_client << '\n';
 
-    indent(f_service_client) << "public function send_" << function_signature(*f_iter) << endl;
+    indent(f_service_client) << "public function send_" << function_signature(*f_iter) << '\n';
     scope_up(f_service_client);
 
     std::string argsname = php_namespace(tservice->get_program()) + service_name_ + "_"
                            + (*f_iter)->get_name() + "_args";
 
-    f_service_client << indent() << "$args = new " << argsname << "();" << endl;
+    f_service_client << indent() << "$args = new " << argsname << "();" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_client << indent() << "$args->" << (*fld_iter)->get_name() << " = $"
-                 << (*fld_iter)->get_name() << ";" << endl;
+                 << (*fld_iter)->get_name() << ";" << '\n';
     }
 
     f_service_client << indent() << "$bin_accel = ($this->output_ instanceof "
                << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');"
-               << endl;
+               << '\n';
 
-    f_service_client << indent() << "if ($bin_accel) {" << endl;
+    f_service_client << indent() << "if ($bin_accel) {" << '\n';
     indent_up();
 
     string messageType = (*f_iter)->is_oneway() ? "TMessageType::ONEWAY" : "TMessageType::CALL";
 
-    f_service_client << indent() << "thrift_protocol_write_binary(" << endl;
+    f_service_client << indent() << "thrift_protocol_write_binary(" << '\n';
 
     indent_up();
-    f_service_client << indent() << "$this->output_," << endl
-               << indent() << "'" << (*f_iter)->get_name() << "'," << endl
-               << indent() << messageType << "," << endl
-               << indent() << "$args," << endl
-               << indent() << "$this->seqid_," << endl
-               << indent() << "$this->output_->isStrictWrite()" << endl;
+    f_service_client << indent() << "$this->output_," << '\n'
+               << indent() << "'" << (*f_iter)->get_name() << "'," << '\n'
+               << indent() << messageType << "," << '\n'
+               << indent() << "$args," << '\n'
+               << indent() << "$this->seqid_," << '\n'
+               << indent() << "$this->output_->isStrictWrite()" << '\n';
 
     indent_down();
-    f_service_client << indent() << ");" << endl;
+    f_service_client << indent() << ");" << '\n';
 
     indent_down();
-    f_service_client << indent() << "} else {" << endl;
+    f_service_client << indent() << "} else {" << '\n';
     indent_up();
 
     // Serialize the request header
     if (binary_inline_) {
-      f_service_client << indent() << "$buff = pack('N', (0x80010000 | " << messageType << "));" << endl
-                       << indent() << "$buff .= pack('N', strlen('" << funname << "'));" << endl
-                       << indent() << "$buff .= '" << funname << "';" << endl << indent()
-                       << "$buff .= pack('N', $this->seqid_);" << endl;
+      f_service_client << indent() << "$buff = pack('N', (0x80010000 | " << messageType << "));" << '\n'
+                       << indent() << "$buff .= pack('N', strlen('" << funname << "'));" << '\n'
+                       << indent() << "$buff .= '" << funname << "';" << '\n' << indent()
+                       << "$buff .= pack('N', $this->seqid_);" << '\n';
     } else {
       f_service_client << indent() << "$this->output_->writeMessageBegin('" << (*f_iter)->get_name()
-                       << "', " << messageType << ", $this->seqid_);" << endl;
+                       << "', " << messageType << ", $this->seqid_);" << '\n';
     }
 
     // Write to the stream
     if (binary_inline_) {
-      f_service_client << indent() << "$args->write($buff);" << endl << indent()
-                       << "$this->output_->write($buff);" << endl << indent()
-                       << "$this->output_->flush();" << endl;
+      f_service_client << indent() << "$args->write($buff);" << '\n' << indent()
+                       << "$this->output_->write($buff);" << '\n' << indent()
+                       << "$this->output_->flush();" << '\n';
     } else {
-      f_service_client << indent() << "$args->write($this->output_);" << endl << indent()
-                       << "$this->output_->writeMessageEnd();" << endl << indent()
-                       << "$this->output_->getTransport()->flush();" << endl;
+      f_service_client << indent() << "$args->write($this->output_);" << '\n' << indent()
+                       << "$this->output_->writeMessageEnd();" << '\n' << indent()
+                       << "$this->output_->getTransport()->flush();" << '\n';
     }
 
     scope_down(f_service_client);
@@ -1997,98 +1995,98 @@
                                string("recv_") + (*f_iter)->get_name(),
                                &noargs);
       // Open function
-      f_service_client << endl << indent() << "public function " << function_signature(&recv_function)
-                       << endl;
+      f_service_client << '\n' << indent() << "public function " << function_signature(&recv_function)
+                       << '\n';
       scope_up(f_service_client);
 
       f_service_client << indent() << "$bin_accel = ($this->input_ instanceof "
                        << "TBinaryProtocolAccelerated)"
-                       << " && function_exists('thrift_protocol_read_binary');" << endl;
+                       << " && function_exists('thrift_protocol_read_binary');" << '\n';
 
-      f_service_client << indent() << "if ($bin_accel) {" << endl;
+      f_service_client << indent() << "if ($bin_accel) {" << '\n';
 
       indent_up();
-      f_service_client << indent() << "$result = thrift_protocol_read_binary(" << endl;
+      f_service_client << indent() << "$result = thrift_protocol_read_binary(" << '\n';
 
       indent_up();
-      f_service_client << indent() << "$this->input_," << endl
-                       << indent() << "'" << resultname << "'," << endl
-                       << indent() << "$this->input_->isStrictRead()" << endl;
+      f_service_client << indent() << "$this->input_," << '\n'
+                       << indent() << "'" << resultname << "'," << '\n'
+                       << indent() << "$this->input_->isStrictRead()" << '\n';
 
       indent_down();
-      f_service_client << indent() << ");" << endl;
+      f_service_client << indent() << ");" << '\n';
 
       indent_down();
-      f_service_client << indent() << "} else {" << endl;
+      f_service_client << indent() << "} else {" << '\n';
 
       indent_up();
-      f_service_client << indent() << "$rseqid = 0;" << endl
-                       << indent() << "$fname = null;" << endl
-                       << indent() << "$mtype = 0;" << endl << endl;
+      f_service_client << indent() << "$rseqid = 0;" << '\n'
+                       << indent() << "$fname = null;" << '\n'
+                       << indent() << "$mtype = 0;" << '\n' << '\n';
 
       if (binary_inline_) {
         t_field ffname(g_type_string, "fname");
         t_field fseqid(g_type_i32, "rseqid");
-        f_service_client << indent() << "$ver = unpack('N', $this->input_->readAll(4));" << endl
-                         << indent() << "$ver = $ver[1];" << endl << indent() << "$mtype = $ver & 0xff;"
-                         << endl << indent() << "$ver = $ver & 0xffff0000;" << endl << indent()
+        f_service_client << indent() << "$ver = unpack('N', $this->input_->readAll(4));" << '\n'
+                         << indent() << "$ver = $ver[1];" << '\n' << indent() << "$mtype = $ver & 0xff;"
+                         << '\n' << indent() << "$ver = $ver & 0xffff0000;" << '\n' << indent()
                          << "if ($ver != 0x80010000) throw new "
                          << "TProtocolException('Bad version identifier: '.$ver, "
-                         << "TProtocolException::BAD_VERSION);" << endl;
+                         << "TProtocolException::BAD_VERSION);" << '\n';
         generate_deserialize_field(f_service_client, &ffname, "", true);
         generate_deserialize_field(f_service_client, &fseqid, "", true);
       } else {
-        f_service_client << indent() << "$this->input_->readMessageBegin($fname, $mtype, $rseqid);" << endl
-                         << indent() << "if ($mtype == TMessageType::EXCEPTION) {" << endl;
+        f_service_client << indent() << "$this->input_->readMessageBegin($fname, $mtype, $rseqid);" << '\n'
+                         << indent() << "if ($mtype == TMessageType::EXCEPTION) {" << '\n';
 
         indent_up();
-        f_service_client << indent() << "$x = new TApplicationException();" << endl
-                         << indent() << "$x->read($this->input_);" << endl
-                         << indent() << "$this->input_->readMessageEnd();" << endl
-                         << indent() << "throw $x;" << endl;
+        f_service_client << indent() << "$x = new TApplicationException();" << '\n'
+                         << indent() << "$x->read($this->input_);" << '\n'
+                         << indent() << "$this->input_->readMessageEnd();" << '\n'
+                         << indent() << "throw $x;" << '\n';
         indent_down();
-        f_service_client << indent() << "}" << endl;
+        f_service_client << indent() << "}" << '\n';
       }
 
-      f_service_client << indent() << "$result = new " << resultname << "();" << endl
-                       << indent() << "$result->read($this->input_);" << endl;
+      f_service_client << indent() << "$result = new " << resultname << "();" << '\n'
+                       << indent() << "$result->read($this->input_);" << '\n';
 
       if (!binary_inline_) {
-        f_service_client << indent() << "$this->input_->readMessageEnd();" << endl;
+        f_service_client << indent() << "$this->input_->readMessageEnd();" << '\n';
       }
 
       scope_down(f_service_client);
 
       // Careful, only return result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_client << indent() << "if ($result->success !== null) {" << endl;
+        f_service_client << indent() << "if ($result->success !== null) {" << '\n';
 
         indent_up();
-        f_service_client << indent() << "return $result->success;" << endl;
+        f_service_client << indent() << "return $result->success;" << '\n';
 
         indent_down();
-        f_service_client << indent() << "}" << endl;
+        f_service_client << indent() << "}" << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
       const std::vector<t_field*>& xceptions = xs->get_members();
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_client << indent() << "if ($result->" << (*x_iter)->get_name() << " !== null) {" << endl;
+        f_service_client << indent() << "if ($result->" << (*x_iter)->get_name() << " !== null) {" << '\n';
 
         indent_up();
-        f_service_client << indent() << "throw $result->" << (*x_iter)->get_name() << ";" << endl;
+        f_service_client << indent() << "throw $result->" << (*x_iter)->get_name() << ";" << '\n';
 
         indent_down();
-        f_service_client << indent() << "}" << endl;
+        f_service_client << indent() << "}" << '\n';
       }
 
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_client) << "return;" << endl;
+        indent(f_service_client) << "return;" << '\n';
       } else {
         f_service_client << indent() << "throw new \\Exception(\"" << (*f_iter)->get_name()
-                         << " failed: unknown result\");" << endl;
+                         << " failed: unknown result\");" << '\n';
       }
 
       // Close function
@@ -2097,7 +2095,7 @@
   }
 
   indent_down();
-  f_service_client << "}" << endl;
+  f_service_client << "}" << '\n';
 
   // Close service client file
   if (!classmap_) {
@@ -2138,54 +2136,54 @@
             throw "compiler error: cannot serialize void field in a struct: " + name;
             break;
           case t_base_type::TYPE_STRING:
-            out << indent() << "$len = unpack('N', " << itrans << "->readAll(4));" << endl
-                << indent() << "$len = $len[1];" << endl << indent() << "if ($len > 0x7fffffff) {"
-                << endl << indent() << "  $len = 0 - (($len - 1) ^ 0xffffffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = " << itrans << "->readAll($len);"
-                << endl;
+            out << indent() << "$len = unpack('N', " << itrans << "->readAll(4));" << '\n'
+                << indent() << "$len = $len[1];" << '\n' << indent() << "if ($len > 0x7fffffff) {"
+                << '\n' << indent() << "  $len = 0 - (($len - 1) ^ 0xffffffff);" << '\n' << indent()
+                << "}" << '\n' << indent() << "$" << name << " = " << itrans << "->readAll($len);"
+                << '\n';
             break;
           case t_base_type::TYPE_BOOL:
             out << indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));"
-                << endl << indent() << "$" << name << " = (bool)$" << name << "[1];" << endl;
+                << '\n' << indent() << "$" << name << " = (bool)$" << name << "[1];" << '\n';
             break;
           case t_base_type::TYPE_I8:
             out << indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));"
-                << endl << indent() << "$" << name << " = $" << name << "[1];" << endl;
+                << '\n' << indent() << "$" << name << " = $" << name << "[1];" << '\n';
             break;
           case t_base_type::TYPE_I16:
-            out << indent() << "$val = unpack('n', " << itrans << "->readAll(2));" << endl
-                << indent() << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fff) {"
-                << endl << indent() << "  $val = 0 - (($val - 1) ^ 0xffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = $val;" << endl;
+            out << indent() << "$val = unpack('n', " << itrans << "->readAll(2));" << '\n'
+                << indent() << "$val = $val[1];" << '\n' << indent() << "if ($val > 0x7fff) {"
+                << '\n' << indent() << "  $val = 0 - (($val - 1) ^ 0xffff);" << '\n' << indent()
+                << "}" << '\n' << indent() << "$" << name << " = $val;" << '\n';
             break;
           case t_base_type::TYPE_I32:
-            out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << endl
-                << indent() << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fffffff) {"
-                << endl << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = $val;" << endl;
+            out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << '\n'
+                << indent() << "$val = $val[1];" << '\n' << indent() << "if ($val > 0x7fffffff) {"
+                << '\n' << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << '\n' << indent()
+                << "}" << '\n' << indent() << "$" << name << " = $val;" << '\n';
             break;
           case t_base_type::TYPE_I64:
-            out << indent() << "$arr = unpack('N2', " << itrans << "->readAll(8));" << endl
-                << indent() << "if ($arr[1] & 0x80000000) {" << endl << indent()
-                << "  $arr[1] = $arr[1] ^ 0xFFFFFFFF;" << endl << indent()
-                << "  $arr[2] = $arr[2] ^ 0xFFFFFFFF;" << endl << indent() << "  $" << name
-                << " = 0 - $arr[1]*4294967296 - $arr[2] - 1;" << endl << indent() << "} else {"
-                << endl << indent() << "  $" << name << " = $arr[1]*4294967296 + $arr[2];" << endl
-                << indent() << "}" << endl;
+            out << indent() << "$arr = unpack('N2', " << itrans << "->readAll(8));" << '\n'
+                << indent() << "if ($arr[1] & 0x80000000) {" << '\n' << indent()
+                << "  $arr[1] = $arr[1] ^ 0xFFFFFFFF;" << '\n' << indent()
+                << "  $arr[2] = $arr[2] ^ 0xFFFFFFFF;" << '\n' << indent() << "  $" << name
+                << " = 0 - $arr[1]*4294967296 - $arr[2] - 1;" << '\n' << indent() << "} else {"
+                << '\n' << indent() << "  $" << name << " = $arr[1]*4294967296 + $arr[2];" << '\n'
+                << indent() << "}" << '\n';
             break;
           case t_base_type::TYPE_DOUBLE:
-            out << indent() << "$arr = unpack('d', strrev(" << itrans << "->readAll(8)));" << endl
-                << indent() << "$" << name << " = $arr[1];" << endl;
+            out << indent() << "$arr = unpack('d', strrev(" << itrans << "->readAll(8)));" << '\n'
+                << indent() << "$" << name << " = $arr[1];" << '\n';
             break;
           default:
             throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase)
                 + tfield->get_name();
           }
         } else if (type->is_enum()) {
-          out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << endl << indent()
-              << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fffffff) {" << endl
-              << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << endl << indent() << "}"
-              << endl << indent() << "$" << name << " = $val;" << endl;
+          out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << '\n' << indent()
+              << "$val = $val[1];" << '\n' << indent() << "if ($val > 0x7fffffff) {" << '\n'
+              << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << '\n' << indent() << "}"
+              << '\n' << indent() << "$" << name << " = $val;" << '\n';
         }
       } else {
 
@@ -2224,7 +2222,7 @@
         } else if (type->is_enum()) {
           out << "readI32($" << name << ");";
         }
-        out << endl;
+        out << '\n';
       }
     } else {
       printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
@@ -2242,8 +2240,8 @@
  */
 void t_php_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   out << indent() << "$" << prefix << " = new " << php_namespace(tstruct->get_program())
-      << tstruct->get_name() << "();" << endl << indent() << "$xfer += $" << prefix
-      << "->read($input);" << endl;
+      << tstruct->get_name() << "();" << '\n' << indent() << "$xfer += $" << prefix
+      << "->read($input);" << '\n';
 }
 
 void t_php_generator::generate_deserialize_container(ostream& out, t_type* ttype, string prefix) {
@@ -2257,44 +2255,44 @@
   t_field fvtype(g_type_i8, vtype);
   t_field fetype(g_type_i8, etype);
 
-  out << indent() << "$" << prefix << " = array();" << endl << indent() << "$" << size << " = 0;"
-      << endl;
+  out << indent() << "$" << prefix << " = array();" << '\n' << indent() << "$" << size << " = 0;"
+      << '\n';
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << "$" << ktype << " = 0;" << endl << indent() << "$" << vtype << " = 0;"
-        << endl;
+    out << indent() << "$" << ktype << " = 0;" << '\n' << indent() << "$" << vtype << " = 0;"
+        << '\n';
     if (binary_inline_) {
       generate_deserialize_field(out, &fktype);
       generate_deserialize_field(out, &fvtype);
       generate_deserialize_field(out, &fsize);
     } else {
       out << indent() << "$xfer += $input->readMapBegin("
-          << "$" << ktype << ", $" << vtype << ", $" << size << ");" << endl;
+          << "$" << ktype << ", $" << vtype << ", $" << size << ");" << '\n';
     }
   } else if (ttype->is_set()) {
     if (binary_inline_) {
       generate_deserialize_field(out, &fetype);
       generate_deserialize_field(out, &fsize);
     } else {
-      out << indent() << "$" << etype << " = 0;" << endl << indent()
+      out << indent() << "$" << etype << " = 0;" << '\n' << indent()
           << "$xfer += $input->readSetBegin("
-          << "$" << etype << ", $" << size << ");" << endl;
+          << "$" << etype << ", $" << size << ");" << '\n';
     }
   } else if (ttype->is_list()) {
     if (binary_inline_) {
       generate_deserialize_field(out, &fetype);
       generate_deserialize_field(out, &fsize);
     } else {
-      out << indent() << "$" << etype << " = 0;" << endl << indent()
+      out << indent() << "$" << etype << " = 0;" << '\n' << indent()
           << "$xfer += $input->readListBegin("
-          << "$" << etype << ", $" << size << ");" << endl;
+          << "$" << etype << ", $" << size << ");" << '\n';
     }
   }
 
   // For loop iterates over elements
   string i = tmp("_i");
-  indent(out) << "for ($" << i << " = 0; $" << i << " < $" << size << "; ++$" << i << ") {" << endl;
+  indent(out) << "for ($" << i << " = 0; $" << i << " < $" << size << "; ++$" << i << ") {" << '\n';
 
   indent_up();
 
@@ -2311,11 +2309,11 @@
   if (!binary_inline_) {
     // Read container end
     if (ttype->is_map()) {
-      indent(out) << "$xfer += $input->readMapEnd();" << endl;
+      indent(out) << "$xfer += $input->readMapEnd();" << '\n';
     } else if (ttype->is_set()) {
-      indent(out) << "$xfer += $input->readSetEnd();" << endl;
+      indent(out) << "$xfer += $input->readSetEnd();" << '\n';
     } else if (ttype->is_list()) {
-      indent(out) << "$xfer += $input->readListEnd();" << endl;
+      indent(out) << "$xfer += $input->readListEnd();" << '\n';
     }
   }
 }
@@ -2329,28 +2327,28 @@
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(out) << declare_field(&fkey, true, true) << endl;
-  indent(out) << declare_field(&fval, true, true) << endl;
+  indent(out) << declare_field(&fkey, true, true) << '\n';
+  indent(out) << declare_field(&fval, true, true) << '\n';
 
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << "$" << prefix << "[$" << key << "] = $" << val << ";" << endl;
+  indent(out) << "$" << prefix << "[$" << key << "] = $" << val << ";" << '\n';
 }
 
 void t_php_generator::generate_deserialize_set_element(ostream& out, t_set* tset, string prefix) {
   string elem = tmp("elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(out) << "$" << elem << " = null;" << endl;
+  indent(out) << "$" << elem << " = null;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
   t_type* elem_type = tset->get_elem_type();
   if(php_is_scalar(elem_type)) {
-    indent(out) << "$" << prefix << "[$" << elem << "] = true;" << endl;
+    indent(out) << "$" << prefix << "[$" << elem << "] = true;" << '\n';
   } else {
-    indent(out) << "$" << prefix << "[] = $" << elem << ";" << endl;
+    indent(out) << "$" << prefix << "[] = $" << elem << ";" << '\n';
   }
 }
 
@@ -2360,11 +2358,11 @@
   string elem = tmp("elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(out) << "$" << elem << " = null;" << endl;
+  indent(out) << "$" << elem << " = null;" << '\n';
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << "$" << prefix << " []= $" << elem << ";" << endl;
+  indent(out) << "$" << prefix << " []= $" << elem << ";" << '\n';
 }
 
 /**
@@ -2397,33 +2395,33 @@
           throw "compiler error: cannot serialize void field in a struct: " + name;
           break;
         case t_base_type::TYPE_STRING:
-          out << indent() << "$output .= pack('N', strlen($" << name << "));" << endl << indent()
-              << "$output .= $" << name << ";" << endl;
+          out << indent() << "$output .= pack('N', strlen($" << name << "));" << '\n' << indent()
+              << "$output .= $" << name << ";" << '\n';
           break;
         case t_base_type::TYPE_BOOL:
-          out << indent() << "$output .= pack('c', $" << name << " ? 1 : 0);" << endl;
+          out << indent() << "$output .= pack('c', $" << name << " ? 1 : 0);" << '\n';
           break;
         case t_base_type::TYPE_I8:
-          out << indent() << "$output .= pack('c', $" << name << ");" << endl;
+          out << indent() << "$output .= pack('c', $" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_I16:
-          out << indent() << "$output .= pack('n', $" << name << ");" << endl;
+          out << indent() << "$output .= pack('n', $" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_I32:
-          out << indent() << "$output .= pack('N', $" << name << ");" << endl;
+          out << indent() << "$output .= pack('N', $" << name << ");" << '\n';
           break;
         case t_base_type::TYPE_I64:
           out << indent() << "$output .= pack('N2', $" << name << " >> 32, $" << name
-              << " & 0xFFFFFFFF);" << endl;
+              << " & 0xFFFFFFFF);" << '\n';
           break;
         case t_base_type::TYPE_DOUBLE:
-          out << indent() << "$output .= strrev(pack('d', $" << name << "));" << endl;
+          out << indent() << "$output .= strrev(pack('d', $" << name << "));" << '\n';
           break;
         default:
           throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
         }
       } else if (type->is_enum()) {
-        out << indent() << "$output .= pack('N', $" << name << ");" << endl;
+        out << indent() << "$output .= pack('N', $" << name << ");" << '\n';
       }
     } else {
 
@@ -2462,7 +2460,7 @@
       } else if (type->is_enum()) {
         out << "writeI32($" << name << ");";
       }
-      out << endl;
+      out << '\n';
     }
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
@@ -2480,7 +2478,7 @@
  */
 void t_php_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << "$xfer += $" << prefix << "->write($output);" << endl;
+  indent(out) << "$xfer += $" << prefix << "->write($output);" << '\n';
 }
 
 /**
@@ -2490,35 +2488,35 @@
   if (ttype->is_map()) {
     if (binary_inline_) {
       out << indent() << "$output .= pack('c', " << type_to_enum(((t_map*)ttype)->get_key_type())
-          << ");" << endl << indent() << "$output .= pack('c', "
-          << type_to_enum(((t_map*)ttype)->get_val_type()) << ");" << endl << indent()
-          << "$output .= strrev(pack('l', count($" << prefix << ")));" << endl;
+          << ");" << '\n' << indent() << "$output .= pack('c', "
+          << type_to_enum(((t_map*)ttype)->get_val_type()) << ");" << '\n' << indent()
+          << "$output .= strrev(pack('l', count($" << prefix << ")));" << '\n';
     } else {
       indent(out) << "$output->writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type())
                   << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                  << "count($" << prefix << "));" << endl;
+                  << "count($" << prefix << "));" << '\n';
     }
   } else if (ttype->is_set()) {
     if (binary_inline_) {
       out << indent() << "$output .= pack('c', " << type_to_enum(((t_set*)ttype)->get_elem_type())
-          << ");" << endl << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
-          << endl;
+          << ");" << '\n' << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
+          << '\n';
 
     } else {
       indent(out) << "$output->writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type())
                   << ", "
-                  << "count($" << prefix << "));" << endl;
+                  << "count($" << prefix << "));" << '\n';
     }
   } else if (ttype->is_list()) {
     if (binary_inline_) {
       out << indent() << "$output .= pack('c', " << type_to_enum(((t_list*)ttype)->get_elem_type())
-          << ");" << endl << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
-          << endl;
+          << ");" << '\n' << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
+          << '\n';
 
     } else {
       indent(out) << "$output->writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
                   << ", "
-                  << "count($" << prefix << "));" << endl;
+                  << "count($" << prefix << "));" << '\n';
     }
   }
 
@@ -2526,14 +2524,14 @@
     string kiter = tmp("kiter");
     string viter = tmp("viter");
     indent(out) << "foreach ($" << prefix << " as "
-                << "$" << kiter << " => $" << viter << ") {" << endl;
+                << "$" << kiter << " => $" << viter << ") {" << '\n';
     indent_up();
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
     scope_down(out);
   } else if (ttype->is_set()) {
     string iter = tmp("iter");
     string iter_val = tmp("iter");
-    indent(out) << "foreach ($" << prefix << " as $" << iter << " => $" << iter_val << ") {" << endl;
+    indent(out) << "foreach ($" << prefix << " as $" << iter << " => $" << iter_val << ") {" << '\n';
     indent_up();
 
     t_type* elem_type = ((t_set*)ttype)->get_elem_type();
@@ -2545,7 +2543,7 @@
     scope_down(out);
   } else if (ttype->is_list()) {
     string iter = tmp("iter");
-    indent(out) << "foreach ($" << prefix << " as $" << iter << ") {" << endl;
+    indent(out) << "foreach ($" << prefix << " as $" << iter << ") {" << '\n';
     indent_up();
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     scope_down(out);
@@ -2553,11 +2551,11 @@
 
   if (!binary_inline_) {
     if (ttype->is_map()) {
-      indent(out) << "$output->writeMapEnd();" << endl;
+      indent(out) << "$output->writeMapEnd();" << '\n';
     } else if (ttype->is_set()) {
-      indent(out) << "$output->writeSetEnd();" << endl;
+      indent(out) << "$output->writeSetEnd();" << '\n';
     } else if (ttype->is_list()) {
-      indent(out) << "$output->writeListEnd();" << endl;
+      indent(out) << "$output->writeListEnd();" << '\n';
     }
   }
 }
@@ -2617,12 +2615,12 @@
 
   // prepend free-style doc if available
   if (field->has_doc()) {
-    ss << field->get_doc() << endl;
+    ss << field->get_doc() << '\n';
   }
 
   // append @var tag
   t_type* type = get_true_type(field->get_type());
-  ss << "@var " << type_to_phpdoc(type) << endl;
+  ss << "@var " << type_to_phpdoc(type) << '\n';
 
   generate_php_docstring_comment(out, ss.str());
 }
@@ -2633,7 +2631,7 @@
 void t_php_generator::generate_php_doc(ostream& out, t_function* function) {
   stringstream ss;
   if (function->has_doc()) {
-    ss << function->get_doc() << endl;
+    ss << function->get_doc() << '\n';
   }
 
   // generate parameter types doc
@@ -2645,7 +2643,7 @@
     if (arg->has_doc()) {
       ss << " " << arg->get_doc();
     }
-    ss << endl;
+    ss << '\n';
   }
 
   // generate return type doc
@@ -2655,7 +2653,7 @@
     if (ret_type->has_doc()) {
       ss << " " << ret_type->get_doc();
     }
-    ss << endl;
+    ss << '\n';
   }
 
   // generate exceptions doc
@@ -2667,7 +2665,7 @@
     if (exc->has_doc()) {
       ss << " " << exc->get_doc();
     }
-    ss << endl;
+    ss << '\n';
   }
 
   generate_docstring_comment(out, "/**\n", " * ", ss.str(), " */\n");
diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc
index ffabd56..d3f23b6 100644
--- a/compiler/cpp/src/thrift/generate/t_py_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc
@@ -40,8 +40,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Python code generator.
  *
@@ -414,22 +412,22 @@
   for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
     f_init << ", '" << (*sv_iter)->get_name() << "'";
   }
-  f_init << "]" << endl;
+  f_init << "]" << '\n';
   f_init.close();
 
   // Print header
-  f_types_ << py_autogen_comment() << endl
-           << py_imports() << endl
-           << render_includes() << endl
-           << "from thrift.transport import TTransport" << endl
+  f_types_ << py_autogen_comment() << '\n'
+           << py_imports() << '\n'
+           << render_includes() << '\n'
+           << "from thrift.transport import TTransport" << '\n'
            << import_dynbase_;
 
-  f_types_ << "all_structs = []" << endl;
+  f_types_ << "all_structs = []" << '\n';
 
   f_consts_ <<
-    py_autogen_comment() << endl <<
-    py_imports() << endl <<
-    "from .ttypes import *" << endl;
+    py_autogen_comment() << '\n' <<
+    py_imports() << '\n' <<
+    "from .ttypes import *" << '\n';
 }
 
 /**
@@ -464,16 +462,16 @@
   ostringstream ss;
   ss << "from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, "
         "TApplicationException"
-     << endl
+     << '\n'
      << "from thrift.protocol.TProtocol import TProtocolException"
-     << endl
+     << '\n'
      << "from thrift.TRecursive import fix_spec"
-     << endl;
+     << '\n';
   if (gen_enum_) {
-    ss << "from enum import IntEnum" << endl;
+    ss << "from enum import IntEnum" << '\n';
   }
   if (gen_utf8strings_) {
-    ss << endl << "import sys";
+    ss << '\n' << "import sys";
   }
   return ss.str();
 }
@@ -484,8 +482,8 @@
 void t_py_generator::close_generator() {
 
   // Fix thrift_spec definitions for recursive structs.
-  f_types_ << "fix_spec(all_structs)" << endl;
-  f_types_ << "del all_structs" << endl;
+  f_types_ << "fix_spec(all_structs)" << '\n';
+  f_types_ << "del all_structs" << '\n';
 
   // Close types file
   f_types_.close();
@@ -519,37 +517,37 @@
     base_class = gen_dynbaseclass_;
   }
 
-  f_types_ << endl
-           << endl
+  f_types_ << '\n'
+           << '\n'
            << "class " << tenum->get_name()
            << (base_class.empty() ? "" : "(" + base_class + ")")
            << ":"
-           << endl;
+           << '\n';
   indent_up();
   generate_python_docstring(f_types_, tenum);
 
-  to_string_mapping << indent() << "_VALUES_TO_NAMES = {" << endl;
-  from_string_mapping << indent() << "_NAMES_TO_VALUES = {" << endl;
+  to_string_mapping << indent() << "_VALUES_TO_NAMES = {" << '\n';
+  from_string_mapping << indent() << "_NAMES_TO_VALUES = {" << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    indent(f_types_) << (*c_iter)->get_name() << " = " << value << endl;
+    indent(f_types_) << (*c_iter)->get_name() << " = " << value << '\n';
 
     // Dictionaries to/from string names of enums
     to_string_mapping << indent() << indent() << value << ": \""
-                      << escape_string((*c_iter)->get_name()) << "\"," << endl;
+                      << escape_string((*c_iter)->get_name()) << "\"," << '\n';
     from_string_mapping << indent() << indent() << '"' << escape_string((*c_iter)->get_name())
-                        << "\": " << value << ',' << endl;
+                        << "\": " << value << ',' << '\n';
   }
-  to_string_mapping << indent() << "}" << endl;
-  from_string_mapping << indent() << "}" << endl;
+  to_string_mapping << indent() << "}" << '\n';
+  from_string_mapping << indent() << "}" << '\n';
 
   indent_down();
-  f_types_ << endl;
+  f_types_ << '\n';
   if (!gen_enum_) {
-    f_types_ << to_string_mapping.str() << endl << from_string_mapping.str();
+    f_types_ << to_string_mapping.str() << '\n' << from_string_mapping.str();
   }
 }
 
@@ -562,7 +560,7 @@
   t_const_value* value = tconst->get_value();
 
   indent(f_consts_) << name << " = " << render_const_value(type, value);
-  f_consts_ << endl;
+  f_consts_ << '\n';
 }
 
 /**
@@ -612,7 +610,7 @@
       out << int_val;
     }
   } else if (type->is_struct() || type->is_xception()) {
-    out << type_name(type) << "(**{" << endl;
+    out << type_name(type) << "(**{" << '\n';
     indent_up();
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -629,7 +627,7 @@
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
       indent(out) << render_const_value(g_type_string, v_iter->first) << ": "
-          << render_const_value(field_type, v_iter->second) << "," << endl;
+          << render_const_value(field_type, v_iter->second) << "," << '\n';
     }
     indent_down();
     indent(out) << "})";
@@ -639,13 +637,13 @@
     if (is_immutable(type)) {
       out << "TFrozenDict(";
     }
-    out << "{" << endl;
+    out << "{" << '\n';
     indent_up();
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       indent(out) << render_const_value(ktype, v_iter->first) << ": "
-          << render_const_value(vtype, v_iter->second) << "," << endl;
+          << render_const_value(vtype, v_iter->second) << "," << '\n';
     }
     indent_down();
     indent(out) << "}";
@@ -666,15 +664,15 @@
       out << "set(";
     }
     if (is_immutable(type) || type->is_set()) {
-      out << "(" << endl;
+      out << "(" << '\n';
     } else {
-      out << "[" << endl;
+      out << "[" << '\n';
     }
     indent_up();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      indent(out) << render_const_value(etype, *v_iter) << "," << endl;
+      indent(out) << render_const_value(etype, *v_iter) << "," << '\n';
     }
     indent_down();
     if (is_immutable(type) || type->is_set()) {
@@ -743,17 +741,17 @@
   vector<t_field*>::const_iterator m_iter;
 
   // Add struct definition to list so thrift_spec can be fixed for recursive structures.
-  indent(out) << "all_structs.append(" << tstruct->get_name() << ")" << endl;
+  indent(out) << "all_structs.append(" << tstruct->get_name() << ")" << '\n';
 
   if (sorted_members.empty() || (sorted_members[0]->get_key() >= 0)) {
-    indent(out) << tstruct->get_name() << ".thrift_spec = (" << endl;
+    indent(out) << tstruct->get_name() << ".thrift_spec = (" << '\n';
     indent_up();
 
     int sorted_keys_pos = 0;
     for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
 
       for (; sorted_keys_pos != (*m_iter)->get_key(); sorted_keys_pos++) {
-        indent(out) << "None,  # " << sorted_keys_pos << endl;
+        indent(out) << "None,  # " << sorted_keys_pos << '\n';
       }
 
       indent(out) << "(" << (*m_iter)->get_key() << ", " << type_to_enum((*m_iter)->get_type())
@@ -762,15 +760,15 @@
                   << ", " << type_to_spec_args((*m_iter)->get_type()) << ", "
                   << render_field_default_value(*m_iter) << ", "
                   << "),"
-                  << "  # " << sorted_keys_pos << endl;
+                  << "  # " << sorted_keys_pos << '\n';
 
       sorted_keys_pos++;
     }
 
     indent_down();
-    indent(out) << ")" << endl;
+    indent(out) << ")" << '\n';
   } else {
-    indent(out) << tstruct->get_name() << ".thrift_spec = ()" << endl;
+    indent(out) << tstruct->get_name() << ".thrift_spec = ()" << '\n';
   }
 }
 
@@ -786,7 +784,7 @@
   const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator m_iter;
 
-  out << endl << endl << "class " << tstruct->get_name();
+  out << '\n' << '\n' << "class " << tstruct->get_name();
   if (is_exception) {
     if (gen_dynamic_) {
       if (is_immutable(tstruct)) {
@@ -806,11 +804,11 @@
   } else if (gen_newstyle_) {
     out << "(object)";
   }
-  out << ":" << endl;
+  out << ":" << '\n';
   indent_up();
   generate_python_docstring(out, tstruct);
 
-  out << endl;
+  out << '\n';
 
   /*
      Here we generate the structure specification for the fastbinary codec.
@@ -833,13 +831,13 @@
   */
 
   if (gen_slots_) {
-    indent(out) << "__slots__ = (" << endl;
+    indent(out) << "__slots__ = (" << '\n';
     indent_up();
     for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
-      indent(out) << "'" << (*m_iter)->get_name() << "'," << endl;
+      indent(out) << "'" << (*m_iter)->get_name() << "'," << '\n';
     }
     indent_down();
-    indent(out) << ")" << endl << endl;
+    indent(out) << ")" << '\n' << '\n';
   }
 
   // TODO(dreiss): Look into generating an empty tuple instead of None
@@ -848,13 +846,13 @@
   // don't have thrift_spec.
 
   if (members.size() > 0) {
-    out << endl;
+    out << '\n';
     out << indent() << "def __init__(self,";
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       out << " " << declare_argument(*m_iter) << ",";
     }
-    out << "):" << endl;
+    out << "):" << '\n';
 
     indent_up();
 
@@ -863,10 +861,10 @@
       t_type* type = (*m_iter)->get_type();
       if (!type->is_base_type() && !type->is_enum() && (*m_iter)->get_value() != nullptr) {
         indent(out) << "if " << (*m_iter)->get_name() << " is "
-                    << "self.thrift_spec[" << (*m_iter)->get_key() << "][4]:" << endl;
+                    << "self.thrift_spec[" << (*m_iter)->get_key() << "][4]:" << '\n';
         indent_up();
         indent(out) << (*m_iter)->get_name() << " = " << render_field_default_value(*m_iter)
-                    << endl;
+                    << '\n';
         indent_down();
       }
 
@@ -875,16 +873,16 @@
           indent(out) << "super(" << tstruct->get_name() << ", self).__setattr__('"
                       << (*m_iter)->get_name() << "', " << (*m_iter)->get_name()
                       << " if hasattr("  << (*m_iter)->get_name() << ", 'value') else "
-                      << type_name(type) << ".__members__.get(" << (*m_iter)->get_name() << "))" << endl;
+                      << type_name(type) << ".__members__.get(" << (*m_iter)->get_name() << "))" << '\n';
         } else if (gen_newstyle_ || gen_dynamic_) {
           indent(out) << "super(" << tstruct->get_name() << ", self).__setattr__('"
-                      << (*m_iter)->get_name() << "', " << (*m_iter)->get_name() << ")" << endl;
+                      << (*m_iter)->get_name() << "', " << (*m_iter)->get_name() << ")" << '\n';
         } else {
           indent(out) << "self.__dict__['" << (*m_iter)->get_name()
-                      << "'] = " << (*m_iter)->get_name() << endl;
+                      << "'] = " << (*m_iter)->get_name() << '\n';
         }
       } else {
-        indent(out) << "self." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << endl;
+        indent(out) << "self." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << '\n';
       }
     }
 
@@ -892,8 +890,8 @@
   }
 
   if (is_immutable(tstruct)) {
-    out << endl;
-    out << indent() << "def __setattr__(self, *args):" << endl;
+    out << '\n';
+    out << indent() << "def __setattr__(self, *args):" << '\n';
     indent_up();
 
     // Not user-provided fields should be editable so that the Python Standard Library can edit
@@ -902,16 +900,16 @@
     // trivial because we know which fields are user-provided, without slots we need to build a
     // way to know which fields are user-provided.
     if (gen_slots_ && !gen_dynamic_) {
-        out << indent() << "if args[0] not in self.__slots__:" << endl;
+        out << indent() << "if args[0] not in self.__slots__:" << '\n';
         indent_up();
-        out << indent() << "super().__setattr__(*args)" << endl
-            << indent() << "return" << endl;
+        out << indent() << "super().__setattr__(*args)" << '\n'
+            << indent() << "return" << '\n';
         indent_down();
     }
-    out << indent() << "raise TypeError(\"can't modify immutable instance\")" << endl;
+    out << indent() << "raise TypeError(\"can't modify immutable instance\")" << '\n';
     indent_down();
-    out << endl;
-    out << indent() << "def __delattr__(self, *args):" << endl;
+    out << '\n';
+    out << indent() << "def __delattr__(self, *args):" << '\n';
     indent_up();
 
     // Not user-provided fields should be editable so that the Python Standard Library can edit
@@ -920,26 +918,26 @@
     // trivial because we know which fields are user-provided, without slots we need to build a
     // way to know which fields are user-provided.
     if (gen_slots_ && !gen_dynamic_) {
-        out << indent() << "if args[0] not in self.__slots__:" << endl;
+        out << indent() << "if args[0] not in self.__slots__:" << '\n';
         indent_up();
-        out << indent() << "super().__delattr__(*args)" << endl
-            << indent() << "return" << endl;
+        out << indent() << "super().__delattr__(*args)" << '\n'
+            << indent() << "return" << '\n';
         indent_down();
     }
-    out << indent() << "raise TypeError(\"can't modify immutable instance\")" << endl;
+    out << indent() << "raise TypeError(\"can't modify immutable instance\")" << '\n';
     indent_down();
-    out << endl;
+    out << '\n';
 
     // Hash all of the members in order, and also hash in the class
     // to avoid collisions for stuff like single-field structures.
-    out << indent() << "def __hash__(self):" << endl
+    out << indent() << "def __hash__(self):" << '\n'
         << indent() << indent_str() << "return hash(self.__class__) ^ hash((";
 
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
       out << "self." << (*m_iter)->get_name() << ", ";
     }
 
-    out << "))" << endl;
+    out << "))" << '\n';
   } else if (gen_enum_) {
     bool has_enum = false;
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -951,25 +949,25 @@
     }
 
     if (has_enum) {
-      out << endl;
-      indent(out) << "def __setattr__(self, name, value):" << endl;
+      out << '\n';
+      indent(out) << "def __setattr__(self, name, value):" << '\n';
       indent_up();
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         t_type* type = (*m_iter)->get_type();
         if (type->is_enum()) {
-          out << indent() << "if name == \"" << (*m_iter)->get_name() << "\":" << endl
+          out << indent() << "if name == \"" << (*m_iter)->get_name() << "\":" << '\n'
               << indent() << indent_str() << "super().__setattr__(name, value if hasattr(value, 'value') else "
-              << type_name(type) << ".__members__.get(value))" << endl
-              << indent() << indent_str() << "return" << endl;
+              << type_name(type) << ".__members__.get(value))" << '\n'
+              << indent() << indent_str() << "return" << '\n';
         }
       }
-      indent(out) << "super().__setattr__(name, value)" << endl << endl;
+      indent(out) << "super().__setattr__(name, value)" << '\n' << '\n';
       indent_down();
     }
   }
 
   if (!gen_dynamic_) {
-    out << endl;
+    out << '\n';
     generate_py_struct_reader(out, tstruct);
     generate_py_struct_writer(out, tstruct);
   }
@@ -978,64 +976,64 @@
   // because when raised exceptions are printed to the console, __repr__
   // isn't used. See python bug #5882
   if (is_exception) {
-    out << endl;
-    out << indent() << "def __str__(self):" << endl
-        << indent() << indent_str() << "return repr(self)" << endl;
+    out << '\n';
+    out << indent() << "def __str__(self):" << '\n'
+        << indent() << indent_str() << "return repr(self)" << '\n';
   }
 
   if (!gen_slots_) {
-    out << endl;
+    out << '\n';
     // Printing utilities so that on the command line thrift
     // structs look pretty like dictionaries
-    indent(out) << "def __repr__(self):" << endl;
+    indent(out) << "def __repr__(self):" << '\n';
     indent_up();
-    out << indent() << "L = ['%s=%r' % (key, value)" << endl
-        << indent() << "     for key, value in self.__dict__.items()]" << endl
-        << indent() << "return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << endl
-        << endl;
+    out << indent() << "L = ['%s=%r' % (key, value)" << '\n'
+        << indent() << "     for key, value in self.__dict__.items()]" << '\n'
+        << indent() << "return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << '\n'
+        << '\n';
     indent_down();
 
     // Equality and inequality methods that compare by value
-    out << indent() << "def __eq__(self, other):" << endl;
+    out << indent() << "def __eq__(self, other):" << '\n';
     indent_up();
     out << indent() << "return isinstance(other, self.__class__) and "
-                       "self.__dict__ == other.__dict__" << endl;
+                       "self.__dict__ == other.__dict__" << '\n';
     indent_down();
-    out << endl;
+    out << '\n';
 
-    out << indent() << "def __ne__(self, other):" << endl;
+    out << indent() << "def __ne__(self, other):" << '\n';
     indent_up();
 
-    out << indent() << "return not (self == other)" << endl;
+    out << indent() << "return not (self == other)" << '\n';
     indent_down();
   } else if (!gen_dynamic_) {
-    out << endl;
+    out << '\n';
     // no base class available to implement __eq__ and __repr__ and __ne__ for us
     // so we must provide one that uses __slots__
-    indent(out) << "def __repr__(self):" << endl;
+    indent(out) << "def __repr__(self):" << '\n';
     indent_up();
-    out << indent() << "L = ['%s=%r' % (key, getattr(self, key))" << endl
-        << indent() << "     for key in self.__slots__]" << endl
-        << indent() << "return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << endl
-        << endl;
+    out << indent() << "L = ['%s=%r' % (key, getattr(self, key))" << '\n'
+        << indent() << "     for key in self.__slots__]" << '\n'
+        << indent() << "return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << '\n'
+        << '\n';
     indent_down();
 
     // Equality method that compares each attribute by value and type, walking __slots__
-    out << indent() << "def __eq__(self, other):" << endl;
+    out << indent() << "def __eq__(self, other):" << '\n';
     indent_up();
-    out << indent() << "if not isinstance(other, self.__class__):" << endl
-        << indent() << indent_str() << "return False" << endl
-        << indent() << "for attr in self.__slots__:" << endl
-        << indent() << indent_str() << "my_val = getattr(self, attr)" << endl
-        << indent() << indent_str() << "other_val = getattr(other, attr)" << endl
-        << indent() << indent_str() << "if my_val != other_val:" << endl
-        << indent() << indent_str() << indent_str() << "return False" << endl
-        << indent() << "return True" << endl
-        << endl;
+    out << indent() << "if not isinstance(other, self.__class__):" << '\n'
+        << indent() << indent_str() << "return False" << '\n'
+        << indent() << "for attr in self.__slots__:" << '\n'
+        << indent() << indent_str() << "my_val = getattr(self, attr)" << '\n'
+        << indent() << indent_str() << "other_val = getattr(other, attr)" << '\n'
+        << indent() << indent_str() << "if my_val != other_val:" << '\n'
+        << indent() << indent_str() << indent_str() << "return False" << '\n'
+        << indent() << "return True" << '\n'
+        << '\n';
     indent_down();
 
-    out << indent() << "def __ne__(self, other):" << endl
-        << indent() << indent_str() << "return not (self == other)" << endl;
+    out << indent() << "def __ne__(self, other):" << '\n'
+        << indent() << indent_str() << "return not (self == other)" << '\n';
   }
   indent_down();
 }
@@ -1048,9 +1046,9 @@
   vector<t_field*>::const_iterator f_iter;
 
   if (is_immutable(tstruct)) {
-    out << indent() << "@classmethod" << endl << indent() << "def read(cls, iprot):" << endl;
+    out << indent() << "@classmethod" << '\n' << indent() << "def read(cls, iprot):" << '\n';
   } else {
-    indent(out) << "def read(self, iprot):" << endl;
+    indent(out) << "def read(self, iprot):" << '\n';
   }
   indent_up();
 
@@ -1059,18 +1057,18 @@
   indent(out) << "if iprot._fast_decode is not None "
                  "and isinstance(iprot.trans, TTransport.CReadableTransport) "
                  "and "
-              << id << ".thrift_spec is not None:" << endl;
+              << id << ".thrift_spec is not None:" << '\n';
   indent_up();
 
   if (is_immutable(tstruct)) {
-    indent(out) << "return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec])" << endl;
+    indent(out) << "return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec])" << '\n';
   } else {
-    indent(out) << "iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])" << endl;
-    indent(out) << "return" << endl;
+    indent(out) << "iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])" << '\n';
+    indent(out) << "return" << '\n';
   }
   indent_down();
 
-  indent(out) << "iprot.readStructBegin()" << endl;
+  indent(out) << "iprot.readStructBegin()" << '\n';
 
   if (is_immutable(tstruct)) {
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -1082,21 +1080,21 @@
       } else {
         result << "None";
       }
-      indent(out) << result.str() << endl;
+      indent(out) << result.str() << '\n';
      }
   }
 
   // Loop over reading in fields
-  indent(out) << "while True:" << endl;
+  indent(out) << "while True:" << '\n';
   indent_up();
 
   // Read beginning field marker
-  indent(out) << "(fname, ftype, fid) = iprot.readFieldBegin()" << endl;
+  indent(out) << "(fname, ftype, fid) = iprot.readFieldBegin()" << '\n';
 
   // Check for field STOP marker and break
-  indent(out) << "if ftype == TType.STOP:" << endl;
+  indent(out) << "if ftype == TType.STOP:" << '\n';
   indent_up();
-  indent(out) << "break" << endl;
+  indent(out) << "break" << '\n';
   indent_down();
 
   // Switch statement on the field we are reading
@@ -1110,9 +1108,9 @@
     } else {
       out << indent() << "elif ";
     }
-    out << "fid == " << (*f_iter)->get_key() << ":" << endl;
+    out << "fid == " << (*f_iter)->get_key() << ":" << '\n';
     indent_up();
-    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << ":" << endl;
+    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << ":" << '\n';
     indent_up();
     if (is_immutable(tstruct)) {
       generate_deserialize_field(out, *f_iter);
@@ -1120,32 +1118,32 @@
       generate_deserialize_field(out, *f_iter, "self.");
     }
     indent_down();
-    out << indent() << "else:" << endl << indent() << indent_str() << "iprot.skip(ftype)" << endl;
+    out << indent() << "else:" << '\n' << indent() << indent_str() << "iprot.skip(ftype)" << '\n';
     indent_down();
   }
 
   // In the default case we skip the field
-  out << indent() << "else:" << endl << indent() << indent_str() << "iprot.skip(ftype)" << endl;
+  out << indent() << "else:" << '\n' << indent() << indent_str() << "iprot.skip(ftype)" << '\n';
 
   // Read field end marker
-  indent(out) << "iprot.readFieldEnd()" << endl;
+  indent(out) << "iprot.readFieldEnd()" << '\n';
 
   indent_down();
 
-  indent(out) << "iprot.readStructEnd()" << endl;
+  indent(out) << "iprot.readStructEnd()" << '\n';
 
   if (is_immutable(tstruct)) {
-    indent(out) << "return cls(" << endl;
+    indent(out) << "return cls(" << '\n';
     indent_up();
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      indent(out) << (*f_iter)->get_name() << "=" << (*f_iter)->get_name() << "," << endl;
+      indent(out) << (*f_iter)->get_name() << "=" << (*f_iter)->get_name() << "," << '\n';
     }
     indent_down();
-    indent(out) << ")" << endl;
+    indent(out) << ")" << '\n';
   }
 
   indent_down();
-  out << endl;
+  out << '\n';
 }
 
 void t_py_generator::generate_py_struct_writer(ostream& out, t_struct* tstruct) {
@@ -1153,49 +1151,49 @@
   const vector<t_field*>& fields = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "def write(self, oprot):" << endl;
+  indent(out) << "def write(self, oprot):" << '\n';
   indent_up();
 
-  indent(out) << "if oprot._fast_encode is not None and self.thrift_spec is not None:" << endl;
+  indent(out) << "if oprot._fast_encode is not None and self.thrift_spec is not None:" << '\n';
   indent_up();
 
   indent(out)
       << "oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))"
-      << endl;
-  indent(out) << "return" << endl;
+      << '\n';
+  indent(out) << "return" << '\n';
   indent_down();
 
-  indent(out) << "oprot.writeStructBegin('" << name << "')" << endl;
+  indent(out) << "oprot.writeStructBegin('" << name << "')" << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     // Write field header
-    indent(out) << "if self." << (*f_iter)->get_name() << " is not None:" << endl;
+    indent(out) << "if self." << (*f_iter)->get_name() << " is not None:" << '\n';
     indent_up();
     indent(out) << "oprot.writeFieldBegin("
                 << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ")" << endl;
+                << ", " << (*f_iter)->get_key() << ")" << '\n';
 
     // Write field contents
     generate_serialize_field(out, *f_iter, "self.");
 
     // Write field closer
-    indent(out) << "oprot.writeFieldEnd()" << endl;
+    indent(out) << "oprot.writeFieldEnd()" << '\n';
 
     indent_down();
   }
 
   // Write the struct map
-  out << indent() << "oprot.writeFieldStop()" << endl << indent() << "oprot.writeStructEnd()"
-      << endl;
+  out << indent() << "oprot.writeFieldStop()" << '\n' << indent() << "oprot.writeStructEnd()"
+      << '\n';
 
-  out << endl;
+  out << '\n';
 
   indent_down();
   generate_py_struct_required_validator(out, tstruct);
 }
 
 void t_py_generator::generate_py_struct_required_validator(ostream& out, t_struct* tstruct) {
-  indent(out) << "def validate(self):" << endl;
+  indent(out) << "def validate(self):" << '\n';
   indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -1206,14 +1204,14 @@
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       t_field* field = (*f_iter);
       if (field->get_req() == t_field::T_REQUIRED) {
-        indent(out) << "if self." << field->get_name() << " is None:" << endl;
+        indent(out) << "if self." << field->get_name() << " is None:" << '\n';
         indent(out) << indent_str() << "raise TProtocolException(message='Required field "
-                    << field->get_name() << " is unset!')" << endl;
+                    << field->get_name() << " is unset!')" << '\n';
       }
     }
   }
 
-  indent(out) << "return" << endl;
+  indent(out) << "return" << '\n';
   indent_down();
 }
 
@@ -1226,32 +1224,32 @@
   string f_service_name = package_dir_ + "/" + service_name_ + ".py";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << py_autogen_comment() << endl << py_imports() << endl;
+  f_service_ << py_autogen_comment() << '\n' << py_imports() << '\n';
 
   if (tservice->get_extends() != nullptr) {
     f_service_ << "import "
                << get_real_py_module(tservice->get_extends()->get_program(), gen_twisted_, package_prefix_) << "."
-               << tservice->get_extends()->get_name() << endl;
+               << tservice->get_extends()->get_name() << '\n';
   }
 
-  f_service_ << "import logging" << endl
-             << "from .ttypes import *" << endl
-             << "from thrift.Thrift import TProcessor" << endl
-             << "from thrift.transport import TTransport" << endl
+  f_service_ << "import logging" << '\n'
+             << "from .ttypes import *" << '\n'
+             << "from thrift.Thrift import TProcessor" << '\n'
+             << "from thrift.transport import TTransport" << '\n'
              << import_dynbase_;
   if (gen_zope_interface_) {
-    f_service_ << "from zope.interface import Interface, implementer" << endl;
+    f_service_ << "from zope.interface import Interface, implementer" << '\n';
   }
 
   if (gen_twisted_) {
-    f_service_ << "from twisted.internet import defer" << endl
-               << "from thrift.transport import TTwisted" << endl;
+    f_service_ << "from twisted.internet import defer" << '\n'
+               << "from thrift.transport import TTwisted" << '\n';
   } else if (gen_tornado_) {
-    f_service_ << "from tornado import gen" << endl;
-    f_service_ << "from tornado import concurrent" << endl;
+    f_service_ << "from tornado import gen" << '\n';
+    f_service_ << "from tornado import concurrent" << '\n';
   }
 
-  f_service_ << "all_structs = []" << endl;
+  f_service_ << "all_structs = []" << '\n';
 
   // Generate the three main parts of the service
   generate_service_interface(tservice);
@@ -1261,8 +1259,8 @@
   generate_service_remote(tservice);
 
   // Close service file
-  f_service_ << "fix_spec(all_structs)" << endl
-             << "del all_structs" << endl;
+  f_service_ << "fix_spec(all_structs)" << '\n'
+             << "del all_structs" << '\n';
   f_service_.close();
 }
 
@@ -1275,7 +1273,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  f_service_ << endl << "# HELPER FUNCTIONS AND STRUCTURES" << endl;
+  f_service_ << '\n' << "# HELPER FUNCTIONS AND STRUCTURES" << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -1328,12 +1326,12 @@
     }
   }
 
-  f_service_ << endl << endl << "class Iface" << extends_if << ":" << endl;
+  f_service_ << '\n' << '\n' << "class Iface" << extends_if << ":" << '\n';
   indent_up();
   generate_python_docstring(f_service_, tservice);
   vector<t_function*> functions = tservice->get_functions();
   if (functions.empty()) {
-    f_service_ << indent() << "pass" << endl;
+    f_service_ << indent() << "pass" << '\n';
   } else {
     vector<t_function*>::iterator f_iter;
     bool first = true;
@@ -1341,12 +1339,12 @@
       if (first) {
         first = false;
       } else {
-        f_service_ << endl;
+        f_service_ << '\n';
       }
-      f_service_ << indent() << "def " << function_signature(*f_iter, true) << ":" << endl;
+      f_service_ << indent() << "def " << function_signature(*f_iter, true) << ":" << '\n';
       indent_up();
       generate_python_docstring(f_service_, (*f_iter));
-      f_service_ << indent() << "pass" << endl;
+      f_service_ << indent() << "pass" << '\n';
       indent_down();
     }
   }
@@ -1375,91 +1373,91 @@
     }
   }
 
-  f_service_ << endl << endl;
+  f_service_ << '\n' << '\n';
 
   if (gen_zope_interface_) {
-    f_service_ << "@implementer(Iface)" << endl
-               << "class Client" << extends_client << ":" << endl
-               << endl;
+    f_service_ << "@implementer(Iface)" << '\n'
+               << "class Client" << extends_client << ":" << '\n'
+               << '\n';
   } else {
-    f_service_ << "class Client(" << extends_client << "Iface):" << endl;
+    f_service_ << "class Client(" << extends_client << "Iface):" << '\n';
   }
   indent_up();
   generate_python_docstring(f_service_, tservice);
 
   // Constructor function
   if (gen_twisted_) {
-    f_service_ << indent() << "def __init__(self, transport, oprot_factory):" << endl;
+    f_service_ << indent() << "def __init__(self, transport, oprot_factory):" << '\n';
   } else if (gen_tornado_) {
     f_service_ << indent()
-               << "def __init__(self, transport, iprot_factory, oprot_factory=None):" << endl;
+               << "def __init__(self, transport, iprot_factory, oprot_factory=None):" << '\n';
   } else {
-    f_service_ << indent() << "def __init__(self, iprot, oprot=None):" << endl;
+    f_service_ << indent() << "def __init__(self, iprot, oprot=None):" << '\n';
   }
   indent_up();
   if (extends.empty()) {
     if (gen_twisted_) {
-      f_service_ << indent() << "self._transport = transport" << endl
-                 << indent() << "self._oprot_factory = oprot_factory" << endl
-                 << indent() << "self._seqid = 0" << endl
-                 << indent() << "self._reqs = {}" << endl;
+      f_service_ << indent() << "self._transport = transport" << '\n'
+                 << indent() << "self._oprot_factory = oprot_factory" << '\n'
+                 << indent() << "self._seqid = 0" << '\n'
+                 << indent() << "self._reqs = {}" << '\n';
     } else if (gen_tornado_) {
-      f_service_ << indent() << "self._transport = transport" << endl
-                 << indent() << "self._iprot_factory = iprot_factory" << endl
+      f_service_ << indent() << "self._transport = transport" << '\n'
+                 << indent() << "self._iprot_factory = iprot_factory" << '\n'
                  << indent() << "self._oprot_factory = (oprot_factory if oprot_factory is not None"
-                 << endl
-                 << indent() << "                       else iprot_factory)" << endl
-                 << indent() << "self._seqid = 0" << endl
-                 << indent() << "self._reqs = {}" << endl
+                 << '\n'
+                 << indent() << "                       else iprot_factory)" << '\n'
+                 << indent() << "self._seqid = 0" << '\n'
+                 << indent() << "self._reqs = {}" << '\n'
                  << indent() << "self._transport.io_loop.spawn_callback(self._start_receiving)"
-                 << endl;
+                 << '\n';
     } else {
-      f_service_ << indent() << "self._iprot = self._oprot = iprot" << endl
-                 << indent() << "if oprot is not None:" << endl
-                 << indent() << indent_str() << "self._oprot = oprot" << endl
-                 << indent() << "self._seqid = 0" << endl;
+      f_service_ << indent() << "self._iprot = self._oprot = iprot" << '\n'
+                 << indent() << "if oprot is not None:" << '\n'
+                 << indent() << indent_str() << "self._oprot = oprot" << '\n'
+                 << indent() << "self._seqid = 0" << '\n';
     }
   } else {
     if (gen_twisted_) {
       f_service_ << indent() << extends
-                 << ".Client.__init__(self, transport, oprot_factory)" << endl;
+                 << ".Client.__init__(self, transport, oprot_factory)" << '\n';
     } else if (gen_tornado_) {
       f_service_ << indent() << extends
-                 << ".Client.__init__(self, transport, iprot_factory, oprot_factory)" << endl;
+                 << ".Client.__init__(self, transport, iprot_factory, oprot_factory)" << '\n';
     } else {
-      f_service_ << indent() << extends << ".Client.__init__(self, iprot, oprot)" << endl;
+      f_service_ << indent() << extends << ".Client.__init__(self, iprot, oprot)" << '\n';
     }
   }
   indent_down();
 
   if (gen_tornado_ && extends.empty()) {
-    f_service_ << endl <<
-      indent() << "@gen.engine" << endl <<
-      indent() << "def _start_receiving(self):" << endl;
+    f_service_ << '\n' <<
+      indent() << "@gen.engine" << '\n' <<
+      indent() << "def _start_receiving(self):" << '\n';
     indent_up();
-    indent(f_service_) << "while True:" << endl;
+    indent(f_service_) << "while True:" << '\n';
     indent_up();
-    f_service_ << indent() << "try:" << endl
-               << indent() << indent_str() << "frame = yield self._transport.readFrame()" << endl
-               << indent() << "except TTransport.TTransportException as e:" << endl
-               << indent() << indent_str() << "for future in self._reqs.values():" << endl
-               << indent() << indent_str() << indent_str() << "future.set_exception(e)" << endl
-               << indent() << indent_str() << "self._reqs = {}" << endl
-               << indent() << indent_str() << "return" << endl
-               << indent() << "tr = TTransport.TMemoryBuffer(frame)" << endl
-               << indent() << "iprot = self._iprot_factory.getProtocol(tr)" << endl
-               << indent() << "(fname, mtype, rseqid) = iprot.readMessageBegin()" << endl
-               << indent() << "method = getattr(self, 'recv_' + fname)" << endl
-               << indent() << "future = self._reqs.pop(rseqid, None)" << endl
-               << indent() << "if not future:" << endl
-               << indent() << indent_str() << "# future has already been discarded" << endl
-               << indent() << indent_str() << "continue" << endl
-               << indent() << "try:" << endl
-               << indent() << indent_str() << "result = method(iprot, mtype, rseqid)" << endl
-               << indent() << "except Exception as e:" << endl
-               << indent() << indent_str() << "future.set_exception(e)" << endl
-               << indent() << "else:" << endl
-               << indent() << indent_str() << "future.set_result(result)" << endl;
+    f_service_ << indent() << "try:" << '\n'
+               << indent() << indent_str() << "frame = yield self._transport.readFrame()" << '\n'
+               << indent() << "except TTransport.TTransportException as e:" << '\n'
+               << indent() << indent_str() << "for future in self._reqs.values():" << '\n'
+               << indent() << indent_str() << indent_str() << "future.set_exception(e)" << '\n'
+               << indent() << indent_str() << "self._reqs = {}" << '\n'
+               << indent() << indent_str() << "return" << '\n'
+               << indent() << "tr = TTransport.TMemoryBuffer(frame)" << '\n'
+               << indent() << "iprot = self._iprot_factory.getProtocol(tr)" << '\n'
+               << indent() << "(fname, mtype, rseqid) = iprot.readMessageBegin()" << '\n'
+               << indent() << "method = getattr(self, 'recv_' + fname)" << '\n'
+               << indent() << "future = self._reqs.pop(rseqid, None)" << '\n'
+               << indent() << "if not future:" << '\n'
+               << indent() << indent_str() << "# future has already been discarded" << '\n'
+               << indent() << indent_str() << "continue" << '\n'
+               << indent() << "try:" << '\n'
+               << indent() << indent_str() << "result = method(iprot, mtype, rseqid)" << '\n'
+               << indent() << "except Exception as e:" << '\n'
+               << indent() << indent_str() << "future.set_exception(e)" << '\n'
+               << indent() << "else:" << '\n'
+               << indent() << indent_str() << "future.set_result(result)" << '\n';
     indent_down();
     indent_down();
   }
@@ -1473,20 +1471,20 @@
     vector<t_field*>::const_iterator fld_iter;
     string funname = (*f_iter)->get_name();
 
-    f_service_ << endl;
+    f_service_ << '\n';
     // Open function
-    indent(f_service_) << "def " << function_signature(*f_iter, false) << ":" << endl;
+    indent(f_service_) << "def " << function_signature(*f_iter, false) << ":" << '\n';
     indent_up();
     generate_python_docstring(f_service_, (*f_iter));
     if (gen_twisted_) {
-      indent(f_service_) << "seqid = self._seqid = self._seqid + 1" << endl;
-      indent(f_service_) << "self._reqs[seqid] = defer.Deferred()" << endl << endl;
+      indent(f_service_) << "seqid = self._seqid = self._seqid + 1" << '\n';
+      indent(f_service_) << "self._reqs[seqid] = defer.Deferred()" << '\n' << '\n';
       indent(f_service_) << "d = defer.maybeDeferred(self.send_" << funname;
 
     } else if (gen_tornado_) {
-      indent(f_service_) << "self._seqid += 1" << endl;
+      indent(f_service_) << "self._seqid += 1" << '\n';
       if (!(*f_iter)->is_oneway()) {
-        indent(f_service_) << "future = self._reqs[self._seqid] = concurrent.Future()" << endl;
+        indent(f_service_) << "future = self._reqs[self._seqid] = concurrent.Future()" << '\n';
       }
       indent(f_service_) << "self.send_" << funname << "(";
 
@@ -1509,19 +1507,19 @@
       f_service_ << (*fld_iter)->get_name();
     }
 
-    f_service_ << ")" << endl;
+    f_service_ << ")" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       if (gen_twisted_) {
         // nothing. See the next block.
       } else if (gen_tornado_) {
-        indent(f_service_) << "return future" << endl;
+        indent(f_service_) << "return future" << '\n';
       } else {
         f_service_ << indent();
         if (!(*f_iter)->get_returntype()->is_void()) {
           f_service_ << "return ";
         }
-        f_service_ << "self.recv_" << funname << "()" << endl;
+        f_service_ << "self.recv_" << funname << "()" << '\n';
       }
     }
     indent_down();
@@ -1529,40 +1527,40 @@
     if (gen_twisted_) {
       // This block injects the body of the send_<> method for twisted (and a cb/eb pair)
       indent_up();
-      indent(f_service_) << "d.addCallbacks(" << endl;
+      indent(f_service_) << "d.addCallbacks(" << '\n';
 
       indent_up();
-      f_service_ << indent() << "callback=self.cb_send_" << funname << "," << endl << indent()
-                 << "callbackArgs=(seqid,)," << endl << indent() << "errback=self.eb_send_"
-                 << funname << "," << endl << indent() << "errbackArgs=(seqid,))" << endl;
+      f_service_ << indent() << "callback=self.cb_send_" << funname << "," << '\n' << indent()
+                 << "callbackArgs=(seqid,)," << '\n' << indent() << "errback=self.eb_send_"
+                 << funname << "," << '\n' << indent() << "errbackArgs=(seqid,))" << '\n';
       indent_down();
 
-      indent(f_service_) << "return d" << endl;
+      indent(f_service_) << "return d" << '\n';
       indent_down();
-      f_service_ << endl;
+      f_service_ << '\n';
 
-      indent(f_service_) << "def cb_send_" << funname << "(self, _, seqid):" << endl;
+      indent(f_service_) << "def cb_send_" << funname << "(self, _, seqid):" << '\n';
       indent_up();
       if ((*f_iter)->is_oneway()) {
         // if one-way, fire the deferred & remove it from _reqs
-        f_service_ << indent() << "d = self._reqs.pop(seqid)" << endl << indent()
-                   << "d.callback(None)" << endl << indent() << "return d" << endl;
+        f_service_ << indent() << "d = self._reqs.pop(seqid)" << '\n' << indent()
+                   << "d.callback(None)" << '\n' << indent() << "return d" << '\n';
       } else {
-        f_service_ << indent() << "return self._reqs[seqid]" << endl;
+        f_service_ << indent() << "return self._reqs[seqid]" << '\n';
       }
       indent_down();
-      f_service_ << endl;
+      f_service_ << '\n';
 
       // add an errback to fail the request if the call to send_<> raised an exception
-      indent(f_service_) << "def eb_send_" << funname << "(self, f, seqid):" << endl;
+      indent(f_service_) << "def eb_send_" << funname << "(self, f, seqid):" << '\n';
       indent_up();
-      f_service_ << indent() << "d = self._reqs.pop(seqid)" << endl << indent() << "d.errback(f)"
-                 << endl << indent() << "return d" << endl;
+      f_service_ << indent() << "d = self._reqs.pop(seqid)" << '\n' << indent() << "d.errback(f)"
+                 << '\n' << indent() << "return d" << '\n';
       indent_down();
     }
 
-    f_service_ << endl;
-    indent(f_service_) << "def send_" << function_signature(*f_iter, false) << ":" << endl;
+    f_service_ << '\n';
+    indent(f_service_) << "def send_" << function_signature(*f_iter, false) << ":" << '\n';
     indent_up();
 
     std::string argsname = (*f_iter)->get_name() + "_args";
@@ -1570,29 +1568,29 @@
 
     // Serialize the request header
     if (gen_twisted_ || gen_tornado_) {
-      f_service_ << indent() << "oprot = self._oprot_factory.getProtocol(self._transport)" << endl
+      f_service_ << indent() << "oprot = self._oprot_factory.getProtocol(self._transport)" << '\n'
                  << indent() << "oprot.writeMessageBegin('" << (*f_iter)->get_name() << "', "
-                 << messageType << ", self._seqid)" << endl;
+                 << messageType << ", self._seqid)" << '\n';
     } else {
       f_service_ << indent() << "self._oprot.writeMessageBegin('" << (*f_iter)->get_name() << "', "
-                 << messageType << ", self._seqid)" << endl;
+                 << messageType << ", self._seqid)" << '\n';
     }
 
-    f_service_ << indent() << "args = " << argsname << "()" << endl;
+    f_service_ << indent() << "args = " << argsname << "()" << '\n';
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "args." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << endl;
+                 << (*fld_iter)->get_name() << '\n';
     }
 
     // Write to the stream
     if (gen_twisted_ || gen_tornado_) {
-      f_service_ << indent() << "args.write(oprot)" << endl << indent() << "oprot.writeMessageEnd()"
-                 << endl << indent() << "oprot.trans.flush()" << endl;
+      f_service_ << indent() << "args.write(oprot)" << '\n' << indent() << "oprot.writeMessageEnd()"
+                 << '\n' << indent() << "oprot.trans.flush()" << '\n';
     } else {
-      f_service_ << indent() << "args.write(self._oprot)" << endl << indent()
-                 << "self._oprot.writeMessageEnd()" << endl << indent()
-                 << "self._oprot.trans.flush()" << endl;
+      f_service_ << indent() << "args.write(self._oprot)" << '\n' << indent()
+                 << "self._oprot.writeMessageEnd()" << '\n' << indent()
+                 << "self._oprot.trans.flush()" << '\n';
     }
 
     indent_down();
@@ -1600,51 +1598,51 @@
     if (!(*f_iter)->is_oneway()) {
       std::string resultname = (*f_iter)->get_name() + "_result";
       // Open function
-      f_service_ << endl;
+      f_service_ << '\n';
       if (gen_twisted_ || gen_tornado_) {
         f_service_ << indent() << "def recv_" << (*f_iter)->get_name()
-                   << "(self, iprot, mtype, rseqid):" << endl;
+                   << "(self, iprot, mtype, rseqid):" << '\n';
       } else {
         t_struct noargs(program_);
         t_function recv_function((*f_iter)->get_returntype(),
                                  string("recv_") + (*f_iter)->get_name(),
                                  &noargs);
-        f_service_ << indent() << "def " << function_signature(&recv_function) << ":" << endl;
+        f_service_ << indent() << "def " << function_signature(&recv_function) << ":" << '\n';
       }
       indent_up();
 
       // TODO(mcslee): Validate message reply here, seq ids etc.
 
       if (gen_twisted_) {
-        f_service_ << indent() << "d = self._reqs.pop(rseqid)" << endl;
+        f_service_ << indent() << "d = self._reqs.pop(rseqid)" << '\n';
       } else if (gen_tornado_) {
       } else {
-        f_service_ << indent() << "iprot = self._iprot" << endl << indent()
-                   << "(fname, mtype, rseqid) = iprot.readMessageBegin()" << endl;
+        f_service_ << indent() << "iprot = self._iprot" << '\n' << indent()
+                   << "(fname, mtype, rseqid) = iprot.readMessageBegin()" << '\n';
       }
 
-      f_service_ << indent() << "if mtype == TMessageType.EXCEPTION:" << endl
-                 << indent() << indent_str() << "x = TApplicationException()" << endl;
+      f_service_ << indent() << "if mtype == TMessageType.EXCEPTION:" << '\n'
+                 << indent() << indent_str() << "x = TApplicationException()" << '\n';
 
       if (gen_twisted_) {
-        f_service_ << indent() << indent_str() << "x.read(iprot)" << endl << indent()
-                   << indent_str() << "iprot.readMessageEnd()" << endl << indent() << indent_str() << "return d.errback(x)"
-                   << endl << indent() << "result = " << resultname << "()" << endl << indent()
-                   << "result.read(iprot)" << endl << indent() << "iprot.readMessageEnd()" << endl;
+        f_service_ << indent() << indent_str() << "x.read(iprot)" << '\n' << indent()
+                   << indent_str() << "iprot.readMessageEnd()" << '\n' << indent() << indent_str() << "return d.errback(x)"
+                   << '\n' << indent() << "result = " << resultname << "()" << '\n' << indent()
+                   << "result.read(iprot)" << '\n' << indent() << "iprot.readMessageEnd()" << '\n';
       } else {
-        f_service_ << indent() << indent_str() << "x.read(iprot)" << endl << indent()
-                   << indent_str() << "iprot.readMessageEnd()" << endl << indent() << indent_str() << "raise x" << endl
-                   << indent() << "result = " << resultname << "()" << endl << indent()
-                   << "result.read(iprot)" << endl << indent() << "iprot.readMessageEnd()" << endl;
+        f_service_ << indent() << indent_str() << "x.read(iprot)" << '\n' << indent()
+                   << indent_str() << "iprot.readMessageEnd()" << '\n' << indent() << indent_str() << "raise x" << '\n'
+                   << indent() << "result = " << resultname << "()" << '\n' << indent()
+                   << "result.read(iprot)" << '\n' << indent() << "iprot.readMessageEnd()" << '\n';
       }
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if result.success is not None:" << endl;
+        f_service_ << indent() << "if result.success is not None:" << '\n';
         if (gen_twisted_) {
-          f_service_ << indent() << indent_str() << "return d.callback(result.success)" << endl;
+          f_service_ << indent() << indent_str() << "return d.callback(result.success)" << '\n';
         } else {
-          f_service_ << indent() << indent_str() << "return result.success" << endl;
+          f_service_ << indent() << indent_str() << "return result.success" << '\n';
         }
       }
 
@@ -1653,32 +1651,32 @@
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         const string& xname = (*x_iter)->get_name();
-        f_service_ << indent() << "if result." << xname << " is not None:" << endl;
+        f_service_ << indent() << "if result." << xname << " is not None:" << '\n';
         if (gen_twisted_) {
           f_service_ << indent() << indent_str() << "return d.errback(result." << xname << ")"
-                     << endl;
+                     << '\n';
         } else {
-          f_service_ << indent() << indent_str() << "raise result." << xname << "" << endl;
+          f_service_ << indent() << indent_str() << "raise result." << xname << "" << '\n';
         }
       }
 
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
         if (gen_twisted_) {
-          f_service_ << indent() << "return d.callback(None)" << endl;
+          f_service_ << indent() << "return d.callback(None)" << '\n';
         } else {
-          f_service_ << indent() << "return" << endl;
+          f_service_ << indent() << "return" << '\n';
         }
       } else {
         if (gen_twisted_) {
           f_service_
               << indent()
               << "return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \""
-              << (*f_iter)->get_name() << " failed: unknown result\"))" << endl;
+              << (*f_iter)->get_name() << " failed: unknown result\"))" << '\n';
         } else {
           f_service_ << indent()
                      << "raise TApplicationException(TApplicationException.MISSING_RESULT, \""
-                     << (*f_iter)->get_name() << " failed: unknown result\")" << endl;
+                     << (*f_iter)->get_name() << " failed: unknown result\")" << '\n';
         }
       }
 
@@ -1711,29 +1709,27 @@
   f_remote.open(f_remote_name.c_str());
 
   f_remote <<
-    "#!/usr/bin/env python" << endl <<
-    py_autogen_comment() << endl <<
-    "import sys" << endl <<
-    "import pprint" << endl <<
-    "if sys.version_info[0] > 2:" << endl <<
-    indent_str() << "from urllib.parse import urlparse" << endl <<
-    "else:" << endl <<
-    indent_str() << "from urlparse import urlparse" << endl <<
-    "from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient" << endl <<
-    "from thrift.protocol.TBinaryProtocol import TBinaryProtocol" << endl <<
-    endl;
+    "#!/usr/bin/env python" << '\n' <<
+    py_autogen_comment() << '\n' <<
+    "import sys" << '\n' <<
+    "import pprint" << '\n' <<
+    "if sys.version_info[0] > 2:" << '\n' <<
+    indent_str() << "from urllib.parse import urlparse" << '\n' <<
+    "else:" << '\n' <<
+    indent_str() << "from urlparse import urlparse" << '\n' <<
+    "from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient" << '\n' <<
+    "from thrift.protocol.TBinaryProtocol import TBinaryProtocol" << '\n' << '\n';
 
   f_remote <<
-    "from " << module_ << " import " << service_name_ << endl <<
-    "from " << module_ << ".ttypes import *" << endl <<
-    endl;
+    "from " << module_ << " import " << service_name_ << '\n' <<
+    "from " << module_ << ".ttypes import *" << '\n' << '\n';
 
   f_remote <<
-    "if len(sys.argv) <= 1 or sys.argv[1] == '--help':" << endl <<
-    indent_str() << "print('')" << endl <<
-    indent_str() << "print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')" << endl <<
-    indent_str() << "print('')" << endl <<
-    indent_str() << "print('Functions:')" << endl;
+    "if len(sys.argv) <= 1 or sys.argv[1] == '--help':" << '\n' <<
+    indent_str() << "print('')" << '\n' <<
+    indent_str() << "print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')" << '\n' <<
+    indent_str() << "print('')" << '\n' <<
+    indent_str() << "print('Functions:')" << '\n';
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_remote << indent_str() << "print('  " << (*f_iter)->get_returntype()->get_name() << " "
              << (*f_iter)->get_name() << "(";
@@ -1749,88 +1745,88 @@
       }
       f_remote << args[i]->get_type()->get_name() << " " << args[i]->get_name();
     }
-    f_remote << ")')" << endl;
+    f_remote << ")')" << '\n';
   }
-  f_remote << indent_str() << "print('')" << endl << indent_str() << "sys.exit(0)" << endl << endl;
+  f_remote << indent_str() << "print('')" << '\n' << indent_str() << "sys.exit(0)" << '\n' << '\n';
 
-  f_remote << "pp = pprint.PrettyPrinter(indent=2)" << endl
-           << "host = 'localhost'" << endl
-           << "port = 9090" << endl
-           << "uri = ''" << endl
-           << "framed = False" << endl
-           << "ssl = False" << endl
-           << "validate = True" << endl
-           << "ca_certs = None" << endl
-           << "keyfile = None" << endl
-           << "certfile = None" << endl
-           << "http = False" << endl
-           << "argi = 1" << endl
-           << endl
-           << "if sys.argv[argi] == '-h':" << endl
-           << indent_str() << "parts = sys.argv[argi + 1].split(':')" << endl
-           << indent_str() << "host = parts[0]" << endl
-           << indent_str() << "if len(parts) > 1:" << endl
-           << indent_str() << indent_str() << "port = int(parts[1])" << endl
-           << indent_str() << "argi += 2" << endl
-           << endl
-           << "if sys.argv[argi] == '-u':" << endl
-           << indent_str() << "url = urlparse(sys.argv[argi + 1])" << endl
-           << indent_str() << "parts = url[1].split(':')" << endl
-           << indent_str() << "host = parts[0]" << endl
-           << indent_str() << "if len(parts) > 1:" << endl
-           << indent_str() << indent_str() << "port = int(parts[1])" << endl
-           << indent_str() << "else:" << endl
-           << indent_str() << indent_str() << "port = 80" << endl
-           << indent_str() << "uri = url[2]" << endl
-           << indent_str() << "if url[4]:" << endl
-           << indent_str() << indent_str() << "uri += '?%s' % url[4]" << endl
-           << indent_str() << "http = True" << endl
-           << indent_str() << "argi += 2" << endl
-           << endl
-           << "if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':" << endl
-           << indent_str() << "framed = True" << endl
-           << indent_str() << "argi += 1" << endl
-           << endl
-           << "if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':" << endl
-           << indent_str() << "ssl = True" << endl
-           << indent_str() << "argi += 1" << endl
-           << endl
-           << "if sys.argv[argi] == '-novalidate':" << endl
-           << indent_str() << "validate = False" << endl
-           << indent_str() << "argi += 1" << endl
-           << endl
-           << "if sys.argv[argi] == '-ca_certs':" << endl
-           << indent_str() << "ca_certs = sys.argv[argi+1]" << endl
-           << indent_str() << "argi += 2" << endl
-           << endl
-           << "if sys.argv[argi] == '-keyfile':" << endl
-           << indent_str() << "keyfile = sys.argv[argi+1]" << endl
-           << indent_str() << "argi += 2" << endl
-           << endl
-           << "if sys.argv[argi] == '-certfile':" << endl
-           << indent_str() << "certfile = sys.argv[argi+1]" << endl
-           << indent_str() << "argi += 2" << endl
-           << endl
-           << "cmd = sys.argv[argi]" << endl
-           << "args = sys.argv[argi + 1:]" << endl
-           << endl
-           << "if http:" << endl
-           << indent_str() << "transport = THttpClient.THttpClient(host, port, uri)" << endl
-           << "else:" << endl
-           << indent_str() << "if ssl:" << endl
+  f_remote << "pp = pprint.PrettyPrinter(indent=2)" << '\n'
+           << "host = 'localhost'" << '\n'
+           << "port = 9090" << '\n'
+           << "uri = ''" << '\n'
+           << "framed = False" << '\n'
+           << "ssl = False" << '\n'
+           << "validate = True" << '\n'
+           << "ca_certs = None" << '\n'
+           << "keyfile = None" << '\n'
+           << "certfile = None" << '\n'
+           << "http = False" << '\n'
+           << "argi = 1" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-h':" << '\n'
+           << indent_str() << "parts = sys.argv[argi + 1].split(':')" << '\n'
+           << indent_str() << "host = parts[0]" << '\n'
+           << indent_str() << "if len(parts) > 1:" << '\n'
+           << indent_str() << indent_str() << "port = int(parts[1])" << '\n'
+           << indent_str() << "argi += 2" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-u':" << '\n'
+           << indent_str() << "url = urlparse(sys.argv[argi + 1])" << '\n'
+           << indent_str() << "parts = url[1].split(':')" << '\n'
+           << indent_str() << "host = parts[0]" << '\n'
+           << indent_str() << "if len(parts) > 1:" << '\n'
+           << indent_str() << indent_str() << "port = int(parts[1])" << '\n'
+           << indent_str() << "else:" << '\n'
+           << indent_str() << indent_str() << "port = 80" << '\n'
+           << indent_str() << "uri = url[2]" << '\n'
+           << indent_str() << "if url[4]:" << '\n'
+           << indent_str() << indent_str() << "uri += '?%s' % url[4]" << '\n'
+           << indent_str() << "http = True" << '\n'
+           << indent_str() << "argi += 2" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':" << '\n'
+           << indent_str() << "framed = True" << '\n'
+           << indent_str() << "argi += 1" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':" << '\n'
+           << indent_str() << "ssl = True" << '\n'
+           << indent_str() << "argi += 1" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-novalidate':" << '\n'
+           << indent_str() << "validate = False" << '\n'
+           << indent_str() << "argi += 1" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-ca_certs':" << '\n'
+           << indent_str() << "ca_certs = sys.argv[argi+1]" << '\n'
+           << indent_str() << "argi += 2" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-keyfile':" << '\n'
+           << indent_str() << "keyfile = sys.argv[argi+1]" << '\n'
+           << indent_str() << "argi += 2" << '\n'
+           << '\n'
+           << "if sys.argv[argi] == '-certfile':" << '\n'
+           << indent_str() << "certfile = sys.argv[argi+1]" << '\n'
+           << indent_str() << "argi += 2" << '\n'
+           << '\n'
+           << "cmd = sys.argv[argi]" << '\n'
+           << "args = sys.argv[argi + 1:]" << '\n'
+           << '\n'
+           << "if http:" << '\n'
+           << indent_str() << "transport = THttpClient.THttpClient(host, port, uri)" << '\n'
+           << "else:" << '\n'
+           << indent_str() << "if ssl:" << '\n'
            << indent_str() << indent_str() << "socket = TSSLSocket.TSSLSocket(host, port, "
               "validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)"
-           << endl
-           << indent_str() << "else:" << endl
-           << indent_str() << indent_str() << "socket = TSocket.TSocket(host, port)" << endl
-           << indent_str() << "if framed:" << endl
-           << indent_str() << indent_str() << "transport = TTransport.TFramedTransport(socket)" << endl
-           << indent_str() << "else:" << endl
-           << indent_str() << indent_str() << "transport = TTransport.TBufferedTransport(socket)" << endl
-           << "protocol = TBinaryProtocol(transport)" << endl
-           << "client = " << service_name_ << ".Client(protocol)" << endl
-           << "transport.open()" << endl
-           << endl;
+           << '\n'
+           << indent_str() << "else:" << '\n'
+           << indent_str() << indent_str() << "socket = TSocket.TSocket(host, port)" << '\n'
+           << indent_str() << "if framed:" << '\n'
+           << indent_str() << indent_str() << "transport = TTransport.TFramedTransport(socket)" << '\n'
+           << indent_str() << "else:" << '\n'
+           << indent_str() << indent_str() << "transport = TTransport.TBufferedTransport(socket)" << '\n'
+           << "protocol = TBinaryProtocol(transport)" << '\n'
+           << "client = " << service_name_ << ".Client(protocol)" << '\n'
+           << "transport.open()" << '\n'
+           << '\n';
 
   // Generate the dispatch methods
   bool first = true;
@@ -1846,12 +1842,12 @@
     const std::vector<t_field*>& args = arg_struct->get_members();
     std::vector<t_field*>::size_type num_args = args.size();
 
-    f_remote << "if cmd == '" << (*f_iter)->get_name() << "':" << endl;
+    f_remote << "if cmd == '" << (*f_iter)->get_name() << "':" << '\n';
     indent_up();
-    f_remote << indent() << "if len(args) != " << num_args << ":" << endl
+    f_remote << indent() << "if len(args) != " << num_args << ":" << '\n'
              << indent() << indent_str() << "print('" << (*f_iter)->get_name() << " requires " << num_args
-             << " args')" << endl
-             << indent() << indent_str() << "sys.exit(1)" << endl
+             << " args')" << '\n'
+             << indent() << indent_str() << "sys.exit(1)" << '\n'
              << indent() << "pp.pprint(client." << (*f_iter)->get_name() << "(";
     indent_down();
     bool first_arg = true;
@@ -1866,19 +1862,19 @@
         f_remote << "eval(args[" << i << "]),";
       }
     }
-    f_remote << "))" << endl;
+    f_remote << "))" << '\n';
 
-    f_remote << endl;
+    f_remote << '\n';
   }
 
   if (functions.size() > 0) {
-    f_remote << "else:" << endl;
-    f_remote << indent_str() << "print('Unrecognized method %s' % cmd)" << endl;
-    f_remote << indent_str() << "sys.exit(1)" << endl;
-    f_remote << endl;
+    f_remote << "else:" << '\n';
+    f_remote << indent_str() << "print('Unrecognized method %s' % cmd)" << '\n';
+    f_remote << indent_str() << "sys.exit(1)" << '\n';
+    f_remote << '\n';
   }
 
-  f_remote << "transport.close()" << endl;
+  f_remote << "transport.close()" << '\n';
 
   // Close service file
   f_remote.close();
@@ -1913,100 +1909,100 @@
     extends_processor = extends + ".Processor, ";
   }
 
-  f_service_ << endl << endl;
+  f_service_ << '\n' << '\n';
 
   // Generate the header portion
   if (gen_zope_interface_) {
-    f_service_ << "@implementer(Iface)" << endl
-               << "class Processor(" << extends_processor << "TProcessor):" << endl;
+    f_service_ << "@implementer(Iface)" << '\n'
+               << "class Processor(" << extends_processor << "TProcessor):" << '\n';
   } else {
-    f_service_ << "class Processor(" << extends_processor << "Iface, TProcessor):" << endl;
+    f_service_ << "class Processor(" << extends_processor << "Iface, TProcessor):" << '\n';
   }
 
   indent_up();
 
-  indent(f_service_) << "def __init__(self, handler):" << endl;
+  indent(f_service_) << "def __init__(self, handler):" << '\n';
   indent_up();
   if (extends.empty()) {
     if (gen_zope_interface_) {
-      f_service_ << indent() << "self._handler = Iface(handler)" << endl;
+      f_service_ << indent() << "self._handler = Iface(handler)" << '\n';
     } else {
-      f_service_ << indent() << "self._handler = handler" << endl;
+      f_service_ << indent() << "self._handler = handler" << '\n';
     }
 
-    f_service_ << indent() << "self._processMap = {}" << endl;
+    f_service_ << indent() << "self._processMap = {}" << '\n';
   } else {
     if (gen_zope_interface_) {
-      f_service_ << indent() << extends << ".Processor.__init__(self, Iface(handler))" << endl;
+      f_service_ << indent() << extends << ".Processor.__init__(self, Iface(handler))" << '\n';
     } else {
-      f_service_ << indent() << extends << ".Processor.__init__(self, handler)" << endl;
+      f_service_ << indent() << extends << ".Processor.__init__(self, handler)" << '\n';
     }
   }
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ << indent() << "self._processMap[\"" << (*f_iter)->get_name()
-               << "\"] = Processor.process_" << (*f_iter)->get_name() << endl;
+               << "\"] = Processor.process_" << (*f_iter)->get_name() << '\n';
   }
-  f_service_ << indent() << "self._on_message_begin = None" << endl;
+  f_service_ << indent() << "self._on_message_begin = None" << '\n';
   indent_down();
-  f_service_ << endl;
+  f_service_ << '\n';
 
-  f_service_ << indent() << "def on_message_begin(self, func):" << endl;
+  f_service_ << indent() << "def on_message_begin(self, func):" << '\n';
   indent_up();
-    f_service_ << indent() << "self._on_message_begin = func" << endl;
+    f_service_ << indent() << "self._on_message_begin = func" << '\n';
   indent_down();
-  f_service_ << endl;
+  f_service_ << '\n';
 
   // Generate the server implementation
-  f_service_ << indent() << "def process(self, iprot, oprot):" << endl;
+  f_service_ << indent() << "def process(self, iprot, oprot):" << '\n';
   indent_up();
 
-  f_service_ << indent() << "(name, type, seqid) = iprot.readMessageBegin()" << endl;
-  f_service_ << indent() << "if self._on_message_begin:" << endl;
+  f_service_ << indent() << "(name, type, seqid) = iprot.readMessageBegin()" << '\n';
+  f_service_ << indent() << "if self._on_message_begin:" << '\n';
   indent_up();
-    f_service_ << indent() << "self._on_message_begin(name, type, seqid)" << endl;
+    f_service_ << indent() << "self._on_message_begin(name, type, seqid)" << '\n';
   indent_down();
 
   // TODO(mcslee): validate message
 
   // HOT: dictionary function lookup
-  f_service_ << indent() << "if name not in self._processMap:" << endl;
+  f_service_ << indent() << "if name not in self._processMap:" << '\n';
   indent_up();
-  f_service_ << indent() << "iprot.skip(TType.STRUCT)" << endl
-             << indent() << "iprot.readMessageEnd()" << endl
+  f_service_ << indent() << "iprot.skip(TType.STRUCT)" << '\n'
+             << indent() << "iprot.readMessageEnd()" << '\n'
              << indent()
              << "x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown "
                 "function %s' % (name))"
-             << endl
-             << indent() << "oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)" << endl
-             << indent() << "x.write(oprot)" << endl
-             << indent() << "oprot.writeMessageEnd()" << endl
-             << indent() << "oprot.trans.flush()" << endl;
+             << '\n'
+             << indent() << "oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)" << '\n'
+             << indent() << "x.write(oprot)" << '\n'
+             << indent() << "oprot.writeMessageEnd()" << '\n'
+             << indent() << "oprot.trans.flush()" << '\n';
 
   if (gen_twisted_) {
-    f_service_ << indent() << "return defer.succeed(None)" << endl;
+    f_service_ << indent() << "return defer.succeed(None)" << '\n';
   } else {
-    f_service_ << indent() << "return" << endl;
+    f_service_ << indent() << "return" << '\n';
   }
   indent_down();
 
-  f_service_ << indent() << "else:" << endl;
+  f_service_ << indent() << "else:" << '\n';
 
   if (gen_twisted_ || gen_tornado_) {
     f_service_ << indent() << indent_str()
-               << "return self._processMap[name](self, seqid, iprot, oprot)" << endl;
+               << "return self._processMap[name](self, seqid, iprot, oprot)" << '\n';
   } else {
     f_service_ << indent() << indent_str() << "self._processMap[name](self, seqid, iprot, oprot)"
-               << endl;
+               << '\n';
 
     // Read end of args field, the T_STOP, and the struct close
-    f_service_ << indent() << "return True" << endl;
+    f_service_ << indent() << "return True" << '\n';
   }
 
   indent_down();
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << endl;
+    f_service_ << '\n';
     generate_process_function(tservice, *f_iter);
   }
 
@@ -2022,11 +2018,11 @@
   (void)tservice;
   // Open function
   if (gen_tornado_) {
-    f_service_ << indent() << "@gen.coroutine" << endl << indent() << "def process_"
-               << tfunction->get_name() << "(self, seqid, iprot, oprot):" << endl;
+    f_service_ << indent() << "@gen.coroutine" << '\n' << indent() << "def process_"
+               << tfunction->get_name() << "(self, seqid, iprot, oprot):" << '\n';
   } else {
     f_service_ << indent() << "def process_" << tfunction->get_name()
-               << "(self, seqid, iprot, oprot):" << endl;
+               << "(self, seqid, iprot, oprot):" << '\n';
   }
 
   indent_up();
@@ -2034,8 +2030,8 @@
   string argsname = tfunction->get_name() + "_args";
   string resultname = tfunction->get_name() + "_result";
 
-  f_service_ << indent() << "args = " << argsname << "()" << endl << indent() << "args.read(iprot)"
-             << endl << indent() << "iprot.readMessageEnd()" << endl;
+  f_service_ << indent() << "args = " << argsname << "()" << '\n' << indent() << "args.read(iprot)"
+             << '\n' << indent() << "iprot.readMessageEnd()" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -2043,7 +2039,7 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "result = " << resultname << "()" << endl;
+    f_service_ << indent() << "result = " << resultname << "()" << '\n';
   }
 
   if (gen_twisted_) {
@@ -2063,85 +2059,85 @@
       }
       f_service_ << "args." << (*f_iter)->get_name();
     }
-    f_service_ << ")" << endl;
+    f_service_ << ")" << '\n';
 
     if (tfunction->is_oneway()) {
       f_service_ << indent() << "d.addErrback(self.handle_exception_" << tfunction->get_name()
-                 << ", seqid)" << endl;
+                 << ", seqid)" << '\n';
     } else {
       f_service_ << indent() << "d.addCallback(self.write_results_success_" << tfunction->get_name()
-                 << ", result, seqid, oprot)" << endl
+                 << ", result, seqid, oprot)" << '\n'
                  << indent() << "d.addErrback(self.write_results_exception_"
-                 << tfunction->get_name() << ", result, seqid, oprot)" << endl;
+                 << tfunction->get_name() << ", result, seqid, oprot)" << '\n';
     }
-    f_service_ << indent() << "return d" << endl << endl;
+    f_service_ << indent() << "return d" << '\n' << '\n';
 
     indent_down();
 
     if (tfunction->is_oneway()) {
       indent(f_service_) << "def handle_exception_" << tfunction->get_name()
-                         << "(self, error, seqid):" << endl;
+                         << "(self, error, seqid):" << '\n';
     } else {
       indent(f_service_) << "def write_results_success_" << tfunction->get_name()
-                         << "(self, success, result, seqid, oprot):" << endl;
+                         << "(self, success, result, seqid, oprot):" << '\n';
       indent_up();
       if (!tfunction->get_returntype()->is_void()) {
-        f_service_ << indent() << "result.success = success" << endl;
+        f_service_ << indent() << "result.success = success" << '\n';
       }
       f_service_ << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", TMessageType.REPLY, seqid)" << endl
-                 << indent() << "result.write(oprot)" << endl
-                 << indent() << "oprot.writeMessageEnd()" << endl
-                 << indent() << "oprot.trans.flush()" << endl
-                 << endl;
+                 << "\", TMessageType.REPLY, seqid)" << '\n'
+                 << indent() << "result.write(oprot)" << '\n'
+                 << indent() << "oprot.writeMessageEnd()" << '\n'
+                 << indent() << "oprot.trans.flush()" << '\n'
+                 << '\n';
       indent_down();
 
       indent(f_service_) << "def write_results_exception_" << tfunction->get_name()
-                         << "(self, error, result, seqid, oprot):" << endl;
+                         << "(self, error, result, seqid, oprot):" << '\n';
     }
     indent_up();
     if (!tfunction->is_oneway()) {
-      f_service_ << indent() << "msg_type = TMessageType.REPLY" << endl;
+      f_service_ << indent() << "msg_type = TMessageType.REPLY" << '\n';
     }
-    f_service_ << indent() << "try:" << endl;
+    f_service_ << indent() << "try:" << '\n';
 
     // Kinda absurd
-    f_service_ << indent() << indent_str() << "error.raiseException()" << endl;
+    f_service_ << indent() << indent_str() << "error.raiseException()" << '\n';
     if (!tfunction->is_oneway()) {
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         const string& xname = (*x_iter)->get_name();
         f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as " << xname
-                   << ":" << endl;
+                   << ":" << '\n';
         indent_up();
-        f_service_ << indent() << "result." << xname << " = " << xname << endl;
+        f_service_ << indent() << "result." << xname << " = " << xname << '\n';
         indent_down();
       }
     }
-    f_service_ << indent() << "except TTransport.TTransportException:" << endl
-               << indent() << indent_str() << "raise" << endl;
+    f_service_ << indent() << "except TTransport.TTransportException:" << '\n'
+               << indent() << indent_str() << "raise" << '\n';
     if (!tfunction->is_oneway()) {
-      f_service_ << indent() << "except TApplicationException as ex:" << endl
+      f_service_ << indent() << "except TApplicationException as ex:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('TApplication exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
-                 << indent() << indent_str() << "result = ex" << endl
-                 << indent() << "except Exception:" << endl
+                 << "logging.exception('TApplication exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
+                 << indent() << indent_str() << "result = ex" << '\n'
+                 << indent() << "except Exception:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('Unexpected exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
+                 << "logging.exception('Unexpected exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
                  << indent() << indent_str()
                  << "result = TApplicationException(TApplicationException.INTERNAL_ERROR, "
                     "'Internal error')"
-                 << endl
+                 << '\n'
                  << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", msg_type, seqid)" << endl
-                 << indent() << "result.write(oprot)" << endl
-                 << indent() << "oprot.writeMessageEnd()" << endl
-                 << indent() << "oprot.trans.flush()" << endl;
+                 << "\", msg_type, seqid)" << '\n'
+                 << indent() << "result.write(oprot)" << '\n'
+                 << indent() << "oprot.writeMessageEnd()" << '\n'
+                 << indent() << "oprot.trans.flush()" << '\n';
     } else {
-      f_service_ << indent() << "except Exception:" << endl
+      f_service_ << indent() << "except Exception:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('Exception in oneway handler')" << endl;
+                 << "logging.exception('Exception in oneway handler')" << '\n';
     }
     indent_down();
 
@@ -2152,9 +2148,9 @@
     vector<t_field*>::const_iterator f_iter;
 
     if (!tfunction->is_oneway()) {
-      indent(f_service_) << "msg_type = TMessageType.REPLY" << endl;
+      indent(f_service_) << "msg_type = TMessageType.REPLY" << '\n';
     }
-    f_service_ << indent() << "try:" << endl;
+    f_service_ << indent() << "try:" << '\n';
     indent_up();
     f_service_ << indent();
     if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
@@ -2170,45 +2166,45 @@
       }
       f_service_ << "args." << (*f_iter)->get_name();
     }
-    f_service_ << "))" << endl;
+    f_service_ << "))" << '\n';
 
     indent_down();
     if (!tfunction->is_oneway()) {
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         const string& xname = (*x_iter)->get_name();
         f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as " << xname
-                   << ":" << endl
-                   << indent() << indent_str() << "result." << xname << " = " << xname << endl;
+                   << ":" << '\n'
+                   << indent() << indent_str() << "result." << xname << " = " << xname << '\n';
       }
     }
-    f_service_ << indent() << "except TTransport.TTransportException:" << endl
-               << indent() << indent_str() << "raise" << endl;
+    f_service_ << indent() << "except TTransport.TTransportException:" << '\n'
+               << indent() << indent_str() << "raise" << '\n';
     if (!tfunction->is_oneway()) {
-      f_service_ << indent() << "except TApplicationException as ex:" << endl
+      f_service_ << indent() << "except TApplicationException as ex:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('TApplication exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
-                 << indent() << indent_str() << "result = ex" << endl
-                 << indent() << "except Exception:" << endl
+                 << "logging.exception('TApplication exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
+                 << indent() << indent_str() << "result = ex" << '\n'
+                 << indent() << "except Exception:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('Unexpected exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
+                 << "logging.exception('Unexpected exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
                  << indent() << indent_str()
                  << "result = TApplicationException(TApplicationException.INTERNAL_ERROR, "
                     "'Internal error')"
-                 << endl;
+                 << '\n';
     } else {
-      f_service_ << indent() << "except Exception:" << endl
+      f_service_ << indent() << "except Exception:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('Exception in oneway handler')" << endl;
+                 << "logging.exception('Exception in oneway handler')" << '\n';
     }
 
     if (!tfunction->is_oneway()) {
       f_service_ << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", msg_type, seqid)" << endl
-                 << indent() << "result.write(oprot)" << endl
-                 << indent() << "oprot.writeMessageEnd()" << endl
-                 << indent() << "oprot.trans.flush()" << endl;
+                 << "\", msg_type, seqid)" << '\n'
+                 << indent() << "result.write(oprot)" << '\n'
+                 << indent() << "oprot.writeMessageEnd()" << '\n'
+                 << indent() << "oprot.trans.flush()" << '\n';
     }
 
     // Close function
@@ -2217,7 +2213,7 @@
   } else { // py
     // Try block for a function with exceptions
     // It also catches arbitrary exceptions raised by handler method to propagate them to the client
-    f_service_ << indent() << "try:" << endl;
+    f_service_ << indent() << "try:" << '\n';
     indent_up();
 
     // Generate the function call
@@ -2239,48 +2235,48 @@
       }
       f_service_ << "args." << (*f_iter)->get_name();
     }
-    f_service_ << ")" << endl;
+    f_service_ << ")" << '\n';
     if (!tfunction->is_oneway()) {
-      f_service_ << indent() << "msg_type = TMessageType.REPLY" << endl;
+      f_service_ << indent() << "msg_type = TMessageType.REPLY" << '\n';
     }
 
     indent_down();
     f_service_ << indent()
-               << "except TTransport.TTransportException:" << endl
-               << indent() << indent_str() << "raise" << endl;
+               << "except TTransport.TTransportException:" << '\n'
+               << indent() << indent_str() << "raise" << '\n';
 
     if (!tfunction->is_oneway()) {
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         const string& xname = (*x_iter)->get_name();
         f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as " << xname
-                   << ":" << endl;
+                   << ":" << '\n';
         indent_up();
-        f_service_ << indent() << "msg_type = TMessageType.REPLY" << endl;
-        f_service_ << indent() << "result." << xname << " = " << xname << endl;
+        f_service_ << indent() << "msg_type = TMessageType.REPLY" << '\n';
+        f_service_ << indent() << "result." << xname << " = " << xname << '\n';
         indent_down();
       }
 
-      f_service_ << indent() << "except TApplicationException as ex:" << endl
+      f_service_ << indent() << "except TApplicationException as ex:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('TApplication exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
-                 << indent() << indent_str() << "result = ex" << endl
-                 << indent() << "except Exception:" << endl
+                 << "logging.exception('TApplication exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
+                 << indent() << indent_str() << "result = ex" << '\n'
+                 << indent() << "except Exception:" << '\n'
                  << indent() << indent_str()
-                 << "logging.exception('Unexpected exception in handler')" << endl
-                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << endl
+                 << "logging.exception('Unexpected exception in handler')" << '\n'
+                 << indent() << indent_str() << "msg_type = TMessageType.EXCEPTION" << '\n'
                  << indent() << indent_str()
                  << "result = TApplicationException(TApplicationException.INTERNAL_ERROR, "
                     "'Internal error')"
-                 << endl
+                 << '\n'
                  << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", msg_type, seqid)" << endl
-                 << indent() << "result.write(oprot)" << endl
-                 << indent() << "oprot.writeMessageEnd()" << endl
-                 << indent() << "oprot.trans.flush()" << endl;
+                 << "\", msg_type, seqid)" << '\n'
+                 << indent() << "result.write(oprot)" << '\n'
+                 << indent() << "oprot.writeMessageEnd()" << '\n'
+                 << indent() << "oprot.trans.flush()" << '\n';
     } else {
-      f_service_ << indent() << "except Exception:" << endl
-                 << indent() << indent_str() << "logging.exception('Exception in oneway handler')" << endl;
+      f_service_ << indent() << "except Exception:" << '\n'
+                 << indent() << indent_str() << "logging.exception('Exception in oneway handler')" << '\n';
     }
 
     // Close function
@@ -2345,14 +2341,14 @@
         throw "compiler error: no Python name for base type " + t_base_type::t_base_name(tbase);
       }
     }
-    out << endl;
+    out << '\n';
   } else if (type->is_enum()) {
     if (gen_enum_) {
       indent(out) << name << " = " << type_name(type) << "(iprot.readI32())";
     } else {
       indent(out) << name << " = iprot.readI32()";
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
            tfield->get_name().c_str(),
@@ -2365,10 +2361,10 @@
  */
 void t_py_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   if (is_immutable(tstruct)) {
-    out << indent() << prefix << " = " << type_name(tstruct) << ".read(iprot)" << endl;
+    out << indent() << prefix << " = " << type_name(tstruct) << ".read(iprot)" << '\n';
   } else {
-    out << indent() << prefix << " = " << type_name(tstruct) << "()" << endl
-        << indent() << prefix << ".read(iprot)" << endl;
+    out << indent() << prefix << " = " << type_name(tstruct) << "()" << '\n'
+        << indent() << prefix << ".read(iprot)" << '\n';
   }
 }
 
@@ -2389,20 +2385,20 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    out << indent() << prefix << " = {}" << endl << indent() << "(" << ktype << ", " << vtype
-        << ", " << size << ") = iprot.readMapBegin()" << endl;
+    out << indent() << prefix << " = {}" << '\n' << indent() << "(" << ktype << ", " << vtype
+        << ", " << size << ") = iprot.readMapBegin()" << '\n';
   } else if (ttype->is_set()) {
-    out << indent() << prefix << " = set()" << endl << indent() << "(" << etype << ", " << size
-        << ") = iprot.readSetBegin()" << endl;
+    out << indent() << prefix << " = set()" << '\n' << indent() << "(" << etype << ", " << size
+        << ") = iprot.readSetBegin()" << '\n';
   } else if (ttype->is_list()) {
-    out << indent() << prefix << " = []" << endl << indent() << "(" << etype << ", " << size
-        << ") = iprot.readListBegin()" << endl;
+    out << indent() << prefix << " = []" << '\n' << indent() << "(" << etype << ", " << size
+        << ") = iprot.readListBegin()" << '\n';
   }
 
   // For loop iterates over elements
   string i = tmp("_i");
   indent(out) <<
-    "for " << i << " in range(" << size << "):" << endl;
+    "for " << i << " in range(" << size << "):" << '\n';
 
   indent_up();
 
@@ -2418,20 +2414,20 @@
 
   // Read container end
   if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd()" << endl;
+    indent(out) << "iprot.readMapEnd()" << '\n';
     if (is_immutable(ttype)) {
-      indent(out) << prefix << " = TFrozenDict(" << prefix << ")" << endl;
+      indent(out) << prefix << " = TFrozenDict(" << prefix << ")" << '\n';
     }
   } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd()" << endl;
+    indent(out) << "iprot.readSetEnd()" << '\n';
     if (is_immutable(ttype)) {
-      indent(out) << prefix << " = frozenset(" << prefix << ")" << endl;
+      indent(out) << prefix << " = frozenset(" << prefix << ")" << '\n';
     }
   } else if (ttype->is_list()) {
     if (is_immutable(ttype)) {
-      indent(out) << prefix << " = tuple(" << prefix << ")" << endl;
+      indent(out) << prefix << " = tuple(" << prefix << ")" << '\n';
     }
-    indent(out) << "iprot.readListEnd()" << endl;
+    indent(out) << "iprot.readListEnd()" << '\n';
   }
 }
 
@@ -2447,7 +2443,7 @@
   generate_deserialize_field(out, &fkey);
   generate_deserialize_field(out, &fval);
 
-  indent(out) << prefix << "[" << key << "] = " << val << endl;
+  indent(out) << prefix << "[" << key << "] = " << val << '\n';
 }
 
 /**
@@ -2459,7 +2455,7 @@
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".add(" << elem << ")" << endl;
+  indent(out) << prefix << ".add(" << elem << ")" << '\n';
 }
 
 /**
@@ -2473,7 +2469,7 @@
 
   generate_deserialize_field(out, &felem);
 
-  indent(out) << prefix << ".append(" << elem << ")" << endl;
+  indent(out) << prefix << ".append(" << elem << ")" << '\n';
 }
 
 /**
@@ -2543,7 +2539,7 @@
         out << "writeI32(" << name << ")";
       }
     }
-    out << endl;
+    out << '\n';
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -2560,50 +2556,50 @@
  */
 void t_py_generator::generate_serialize_struct(ostream& out, t_struct* tstruct, string prefix) {
   (void)tstruct;
-  indent(out) << prefix << ".write(oprot)" << endl;
+  indent(out) << prefix << ".write(oprot)" << '\n';
 }
 
 void t_py_generator::generate_serialize_container(ostream& out, t_type* ttype, string prefix) {
   if (ttype->is_map()) {
     indent(out) << "oprot.writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
                 << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "len(" << prefix << "))" << endl;
+                << "len(" << prefix << "))" << '\n';
   } else if (ttype->is_set()) {
     indent(out) << "oprot.writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "len(" << prefix << "))" << endl;
+                << "len(" << prefix << "))" << '\n';
   } else if (ttype->is_list()) {
     indent(out) << "oprot.writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
                 << ", "
-                << "len(" << prefix << "))" << endl;
+                << "len(" << prefix << "))" << '\n';
   }
 
   if (ttype->is_map()) {
     string kiter = tmp("kiter");
     string viter = tmp("viter");
-    indent(out) << "for " << kiter << ", " << viter << " in " << prefix << ".items():" << endl;
+    indent(out) << "for " << kiter << ", " << viter << " in " << prefix << ".items():" << '\n';
     indent_up();
     generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
     indent_down();
   } else if (ttype->is_set()) {
     string iter = tmp("iter");
-    indent(out) << "for " << iter << " in " << prefix << ":" << endl;
+    indent(out) << "for " << iter << " in " << prefix << ":" << '\n';
     indent_up();
     generate_serialize_set_element(out, (t_set*)ttype, iter);
     indent_down();
   } else if (ttype->is_list()) {
     string iter = tmp("iter");
-    indent(out) << "for " << iter << " in " << prefix << ":" << endl;
+    indent(out) << "for " << iter << " in " << prefix << ":" << '\n';
     indent_up();
     generate_serialize_list_element(out, (t_list*)ttype, iter);
     indent_down();
   }
 
   if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd()" << endl;
+    indent(out) << "oprot.writeMapEnd()" << '\n';
   } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd()" << endl;
+    indent(out) << "oprot.writeSetEnd()" << '\n';
   } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd()" << endl;
+    indent(out) << "oprot.writeListEnd()" << '\n';
   }
 }
 
@@ -2669,7 +2665,7 @@
   const vector<t_field*>& fields = tstruct->get_members();
   if (fields.size() > 0) {
     if (has_doc) {
-      ss << endl;
+      ss << '\n';
     }
     has_doc = true;
     ss << subheader << ":\n";
@@ -2680,7 +2676,7 @@
       if (p->has_doc()) {
         ss << ": " << p->get_doc();
       } else {
-        ss << endl;
+        ss << '\n';
       }
     }
   }
diff --git a/compiler/cpp/src/thrift/generate/t_rb_generator.cc b/compiler/cpp/src/thrift/generate/t_rb_generator.cc
index 17e57cf..e946573 100644
--- a/compiler/cpp/src/thrift/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_rb_generator.cc
@@ -43,8 +43,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * A subclass of std::ofstream that includes indenting functionality.
  */
@@ -283,11 +281,11 @@
   f_consts_.open(f_consts_name.c_str());
 
   // Print header
-  f_types_ << rb_autogen_comment() << endl << render_require_thrift() << render_includes() << endl;
+  f_types_ << rb_autogen_comment() << '\n' << render_require_thrift() << render_includes() << '\n';
   begin_namespace(f_types_, ruby_modules(program_));
 
-  f_consts_ << rb_autogen_comment() << endl << render_require_thrift() << "require '"
-            << require_prefix_ << underscore(program_name_) << "_types'" << endl << endl;
+  f_consts_ << rb_autogen_comment() << '\n' << render_require_thrift() << "require '"
+            << require_prefix_ << underscore(program_name_) << "_types'" << '\n' << '\n';
   begin_namespace(f_consts_, ruby_modules(program_));
 }
 
@@ -360,7 +358,7 @@
  * @param tenum The enumeration
  */
 void t_rb_generator::generate_enum(t_enum* tenum) {
-  f_types_.indent() << "module " << capitalize(tenum->get_name()) << endl;
+  f_types_.indent() << "module " << capitalize(tenum->get_name()) << '\n';
   f_types_.indent_up();
 
   vector<t_enum_value*> constants = tenum->get_constants();
@@ -374,7 +372,7 @@
     string name = capitalize((*c_iter)->get_name());
 
     generate_rdoc(f_types_, *c_iter);
-    f_types_.indent() << name << " = " << value << endl;
+    f_types_.indent() << name << " = " << value << '\n';
   }
 
   // Create a hash mapping values back to their names (as strings) since ruby has no native enum
@@ -387,7 +385,7 @@
       f_types_ << ", ";
     f_types_ << value << " => \"" << capitalize((*c_iter)->get_name()) << "\"";
   }
-  f_types_ << "}" << endl;
+  f_types_ << "}" << '\n';
 
   // Create a set with valid values for this enum
   f_types_.indent() << "VALID_VALUES = Set.new([";
@@ -397,10 +395,10 @@
       f_types_ << ", ";
     f_types_ << capitalize((*c_iter)->get_name());
   }
-  f_types_ << "]).freeze" << endl;
+  f_types_ << "]).freeze" << '\n';
 
   f_types_.indent_down();
-  f_types_.indent() << "end" << endl << endl;
+  f_types_.indent() << "end" << '\n' << '\n';
 }
 
 /**
@@ -414,7 +412,7 @@
   name[0] = toupper(name[0]);
 
   f_consts_.indent() << name << " = ";
-  render_const_value(f_consts_, type, value) << endl << endl;
+  render_const_value(f_consts_, type, value) << '\n' << '\n';
 }
 
 /**
@@ -454,7 +452,7 @@
   } else if (type->is_enum()) {
     out.indent() << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << full_type_name(type) << ".new({" << endl;
+    out << full_type_name(type) << ".new({" << '\n';
     out.indent_up();
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -472,21 +470,21 @@
       }
       out.indent();
       render_const_value(out, g_type_string, v_iter->first) << " => ";
-      render_const_value(out, field_type, v_iter->second) << "," << endl;
+      render_const_value(out, field_type, v_iter->second) << "," << '\n';
     }
     out.indent_down();
     out.indent() << "})";
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
+    out << "{" << '\n';
     out.indent_up();
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
     map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       out.indent();
       render_const_value(out, ktype, v_iter->first) << " => ";
-      render_const_value(out, vtype, v_iter->second) << "," << endl;
+      render_const_value(out, vtype, v_iter->second) << "," << '\n';
     }
     out.indent_down();
     out.indent() << "}";
@@ -498,16 +496,16 @@
       etype = ((t_set*)type)->get_elem_type();
     }
     if (type->is_set()) {
-      out << "Set.new([" << endl;
+      out << "Set.new([" << '\n';
     } else {
-      out << "[" << endl;
+      out << "[" << '\n';
     }
     out.indent_up();
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       out.indent();
-      render_const_value(out, etype, *v_iter) << "," << endl;
+      render_const_value(out, etype, *v_iter) << "," << '\n';
     }
     out.indent_down();
     if (type->is_set()) {
@@ -552,7 +550,7 @@
   if (is_exception) {
     out << " < ::Thrift::Exception";
   }
-  out << "; end" << endl << endl;
+  out << "; end" << '\n' << '\n';
 }
 
 /**
@@ -576,10 +574,10 @@
   if (is_exception) {
     out << " < ::Thrift::Exception";
   }
-  out << endl;
+  out << '\n';
 
   out.indent_up();
-  out.indent() << "include ::Thrift::Struct, ::Thrift::Struct_Union" << endl;
+  out.indent() << "include ::Thrift::Struct, ::Thrift::Struct_Union" << '\n';
 
   if (is_exception) {
     generate_rb_simple_exception_constructor(out, tstruct);
@@ -589,10 +587,10 @@
   generate_field_defns(out, tstruct);
   generate_rb_struct_required_validator(out, tstruct);
 
-  out.indent() << "::Thrift::Struct.generate_accessors self" << endl;
+  out.indent() << "::Thrift::Struct.generate_accessors self" << '\n';
 
   out.indent_down();
-  out.indent() << "end" << endl << endl;
+  out.indent() << "end" << '\n' << '\n';
 }
 
 /**
@@ -603,10 +601,10 @@
                                        bool is_exception = false) {
   (void)is_exception;
   generate_rdoc(out, tstruct);
-  out.indent() << "class " << type_name(tstruct) << " < ::Thrift::Union" << endl;
+  out.indent() << "class " << type_name(tstruct) << " < ::Thrift::Union" << '\n';
 
   out.indent_up();
-  out.indent() << "include ::Thrift::Struct_Union" << endl;
+  out.indent() << "include ::Thrift::Struct_Union" << '\n';
 
   generate_field_constructors(out, tstruct);
 
@@ -614,15 +612,15 @@
   generate_field_defns(out, tstruct);
   generate_rb_union_validator(out, tstruct);
 
-  out.indent() << "::Thrift::Union.generate_accessors self" << endl;
+  out.indent() << "::Thrift::Union.generate_accessors self" << '\n';
 
   out.indent_down();
-  out.indent() << "end" << endl << endl;
+  out.indent() << "end" << '\n' << '\n';
 }
 
 void t_rb_generator::generate_field_constructors(t_rb_ofstream& out, t_struct* tstruct) {
 
-  out.indent() << "class << self" << endl;
+  out.indent() << "class << self" << '\n';
   out.indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -630,19 +628,19 @@
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (f_iter != fields.begin()) {
-      out << endl;
+      out << '\n';
     }
     std::string field_name = (*f_iter)->get_name();
 
-    out.indent() << "def " << field_name << "(val)" << endl;
-    out.indent() << "  " << tstruct->get_name() << ".new(:" << field_name << ", val)" << endl;
-    out.indent() << "end" << endl;
+    out.indent() << "def " << field_name << "(val)" << '\n';
+    out.indent() << "  " << tstruct->get_name() << ".new(:" << field_name << ", val)" << '\n';
+    out.indent() << "end" << '\n';
   }
 
   out.indent_down();
-  out.indent() << "end" << endl;
+  out.indent() << "end" << '\n';
 
-  out << endl;
+  out << '\n';
 }
 
 void t_rb_generator::generate_rb_simple_exception_constructor(t_rb_ofstream& out,
@@ -655,15 +653,15 @@
     if ((*m_iter)->get_type()->is_string()) {
       string name = (*m_iter)->get_name();
 
-      out.indent() << "def initialize(message=nil)" << endl;
+      out.indent() << "def initialize(message=nil)" << '\n';
       out.indent_up();
-      out.indent() << "super()" << endl;
-      out.indent() << "self." << name << " = message" << endl;
+      out.indent() << "super()" << '\n';
+      out.indent() << "self." << name << " = message" << '\n';
       out.indent_down();
-      out.indent() << "end" << endl << endl;
+      out.indent() << "end" << '\n' << '\n';
 
       if (name != "message") {
-        out.indent() << "def message; " << name << " end" << endl << endl;
+        out.indent() << "def message; " << name << " end" << '\n' << '\n';
       }
     }
   }
@@ -677,20 +675,20 @@
     std::string field_name = (*f_iter)->get_name();
     std::string cap_field_name = upcase_string(field_name);
 
-    out.indent() << cap_field_name << " = " << (*f_iter)->get_key() << endl;
+    out.indent() << cap_field_name << " = " << (*f_iter)->get_key() << '\n';
   }
-  out << endl;
+  out << '\n';
 }
 
 void t_rb_generator::generate_field_defns(t_rb_ofstream& out, t_struct* tstruct) {
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  out.indent() << "FIELDS = {" << endl;
+  out.indent() << "FIELDS = {" << '\n';
   out.indent_up();
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (f_iter != fields.begin()) {
-      out << "," << endl;
+      out << "," << '\n';
     }
 
     // generate the field docstrings within the FIELDS constant. no real better place...
@@ -705,10 +703,10 @@
                         (*f_iter)->get_req() == t_field::T_OPTIONAL);
   }
   out.indent_down();
-  out << endl;
-  out.indent() << "}" << endl << endl;
+  out << '\n';
+  out.indent() << "}" << '\n' << '\n';
 
-  out.indent() << "def struct_fields; FIELDS; end" << endl << endl;
+  out.indent() << "def struct_fields; FIELDS; end" << '\n' << '\n';
 }
 
 void t_rb_generator::generate_field_data(t_rb_ofstream& out,
@@ -765,7 +763,7 @@
 
 void t_rb_generator::begin_namespace(t_rb_ofstream& out, vector<std::string> modules) {
   for (auto & module : modules) {
-    out.indent() << "module " << module << endl;
+    out.indent() << "module " << module << '\n';
     out.indent_up();
   }
 }
@@ -774,7 +772,7 @@
   for (vector<std::string>::reverse_iterator m_iter = modules.rbegin(); m_iter != modules.rend();
        ++m_iter) {
     out.indent_down();
-    out.indent() << "end" << endl;
+    out.indent() << "end" << '\n';
   }
 }
 
@@ -787,25 +785,25 @@
   string f_service_name = namespace_dir_ + underscore(service_name_) + ".rb";
   f_service_.open(f_service_name.c_str());
 
-  f_service_ << rb_autogen_comment() << endl << render_require_thrift();
+  f_service_ << rb_autogen_comment() << '\n' << render_require_thrift();
 
   if (tservice->get_extends() != nullptr) {
     if (namespaced_) {
       f_service_ << "require '" << rb_namespace_to_path_prefix(
                                        tservice->get_extends()->get_program()->get_namespace("rb"))
-                 << underscore(tservice->get_extends()->get_name()) << "'" << endl;
+                 << underscore(tservice->get_extends()->get_name()) << "'" << '\n';
     } else {
       f_service_ << "require '" << require_prefix_
-                 << underscore(tservice->get_extends()->get_name()) << "'" << endl;
+                 << underscore(tservice->get_extends()->get_name()) << "'" << '\n';
     }
   }
 
-  f_service_ << "require '" << require_prefix_ << underscore(program_name_) << "_types'" << endl
-             << endl;
+  f_service_ << "require '" << require_prefix_ << underscore(program_name_) << "_types'" << '\n'
+             << '\n';
 
   begin_namespace(f_service_, ruby_modules(tservice->get_program()));
 
-  f_service_.indent() << "module " << capitalize(tservice->get_name()) << endl;
+  f_service_.indent() << "module " << capitalize(tservice->get_name()) << '\n';
   f_service_.indent_up();
 
   // Generate the three main parts of the service (well, two for now in PHP)
@@ -814,7 +812,7 @@
   generate_service_helpers(tservice);
 
   f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
+  f_service_.indent() << "end" << '\n' << '\n';
 
   end_namespace(f_service_, ruby_modules(tservice->get_program()));
 
@@ -831,7 +829,7 @@
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
-  f_service_.indent() << "# HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
+  f_service_.indent() << "# HELPER FUNCTIONS AND STRUCTURES" << '\n' << '\n';
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
@@ -874,10 +872,10 @@
     extends_client = " < " + extends + "::Client ";
   }
 
-  f_service_.indent() << "class Client" << extends_client << endl;
+  f_service_.indent() << "class Client" << extends_client << '\n';
   f_service_.indent_up();
 
-  f_service_.indent() << "include ::Thrift::Client" << endl << endl;
+  f_service_.indent() << "include ::Thrift::Client" << '\n' << '\n';
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -889,7 +887,7 @@
     string funname = (*f_iter)->get_name();
 
     // Open function
-    f_service_.indent() << "def " << function_signature(*f_iter) << endl;
+    f_service_.indent() << "def " << function_signature(*f_iter) << '\n';
     f_service_.indent_up();
     f_service_.indent() << "send_" << funname << "(";
 
@@ -902,20 +900,20 @@
       }
       f_service_ << (*fld_iter)->get_name();
     }
-    f_service_ << ")" << endl;
+    f_service_ << ")" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       f_service_.indent();
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_ << "return ";
       }
-      f_service_ << "recv_" << funname << "()" << endl;
+      f_service_ << "recv_" << funname << "()" << '\n';
     }
     f_service_.indent_down();
-    f_service_.indent() << "end" << endl;
-    f_service_ << endl;
+    f_service_.indent() << "end" << '\n';
+    f_service_ << '\n';
 
-    f_service_.indent() << "def send_" << function_signature(*f_iter) << endl;
+    f_service_.indent() << "def send_" << function_signature(*f_iter) << '\n';
     f_service_.indent_up();
 
     std::string argsname = capitalize((*f_iter)->get_name() + "_args");
@@ -927,10 +925,10 @@
       f_service_ << ", :" << (*fld_iter)->get_name() << " => " << (*fld_iter)->get_name();
     }
 
-    f_service_ << ")" << endl;
+    f_service_ << ")" << '\n';
 
     f_service_.indent_down();
-    f_service_.indent() << "end" << endl;
+    f_service_.indent() << "end" << '\n';
 
     if (!(*f_iter)->is_oneway()) {
       std::string resultname = capitalize((*f_iter)->get_name() + "_result");
@@ -940,22 +938,22 @@
                                string("recv_") + (*f_iter)->get_name(),
                                &noargs);
       // Open function
-      f_service_ << endl;
-      f_service_.indent() << "def " << function_signature(&recv_function) << endl;
+      f_service_ << '\n';
+      f_service_.indent() << "def " << function_signature(&recv_function) << '\n';
       f_service_.indent_up();
 
-      f_service_.indent() << "fname, mtype, rseqid = receive_message_begin()" << endl;
-      f_service_.indent() << "handle_exception(mtype)" << endl;
+      f_service_.indent() << "fname, mtype, rseqid = receive_message_begin()" << '\n';
+      f_service_.indent() << "handle_exception(mtype)" << '\n';
 
-      f_service_.indent() << "if reply_seqid(rseqid)==false" << endl;
-      f_service_.indent() << "  raise \"seqid reply faild\"" << endl;
-      f_service_.indent() << "end" << endl;
+      f_service_.indent() << "if reply_seqid(rseqid)==false" << '\n';
+      f_service_.indent() << "  raise \"seqid reply faild\"" << '\n';
+      f_service_.indent() << "end" << '\n';
 
-      f_service_.indent() << "result = receive_message(" << resultname << ")" << endl;
+      f_service_.indent() << "result = receive_message(" << resultname << ")" << '\n';
 
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_.indent() << "return result.success unless result.success.nil?" << endl;
+        f_service_.indent() << "return result.success unless result.success.nil?" << '\n';
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -963,27 +961,27 @@
       vector<t_field*>::const_iterator x_iter;
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         f_service_.indent() << "raise result." << (*x_iter)->get_name() << " unless result."
-                            << (*x_iter)->get_name() << ".nil?" << endl;
+                            << (*x_iter)->get_name() << ".nil?" << '\n';
       }
 
       // Careful, only return _result if not a void function
       if ((*f_iter)->get_returntype()->is_void()) {
-        f_service_.indent() << "return" << endl;
+        f_service_.indent() << "return" << '\n';
       } else {
         f_service_.indent() << "raise "
                                "::Thrift::ApplicationException.new(::Thrift::ApplicationException::"
                                "MISSING_RESULT, '" << (*f_iter)->get_name()
-                            << " failed: unknown result')" << endl;
+                            << " failed: unknown result')" << '\n';
       }
 
       // Close function
       f_service_.indent_down();
-      f_service_.indent() << "end" << endl << endl;
+      f_service_.indent() << "end" << '\n' << '\n';
     }
   }
 
   f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
+  f_service_.indent() << "end" << '\n' << '\n';
 }
 
 /**
@@ -1004,10 +1002,10 @@
   }
 
   // Generate the header portion
-  f_service_.indent() << "class Processor" << extends_processor << endl;
+  f_service_.indent() << "class Processor" << extends_processor << '\n';
   f_service_.indent_up();
 
-  f_service_.indent() << "include ::Thrift::Processor" << endl << endl;
+  f_service_.indent() << "include ::Thrift::Processor" << '\n' << '\n';
 
   // Generate the process subfunctions
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1015,7 +1013,7 @@
   }
 
   f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
+  f_service_.indent() << "end" << '\n' << '\n';
 }
 
 /**
@@ -1026,13 +1024,13 @@
 void t_rb_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
   (void)tservice;
   // Open function
-  f_service_.indent() << "def process_" << tfunction->get_name() << "(seqid, iprot, oprot)" << endl;
+  f_service_.indent() << "def process_" << tfunction->get_name() << "(seqid, iprot, oprot)" << '\n';
   f_service_.indent_up();
 
   string argsname = capitalize(tfunction->get_name()) + "_args";
   string resultname = capitalize(tfunction->get_name()) + "_result";
 
-  f_service_.indent() << "args = read_args(iprot, " << argsname << ")" << endl;
+  f_service_.indent() << "args = read_args(iprot, " << argsname << ")" << '\n';
 
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
@@ -1040,12 +1038,12 @@
 
   // Declare result for non oneway function
   if (!tfunction->is_oneway()) {
-    f_service_.indent() << "result = " << resultname << ".new()" << endl;
+    f_service_.indent() << "result = " << resultname << ".new()" << '\n';
   }
 
   // Try block for a function with exceptions
   if (xceptions.size() > 0) {
-    f_service_.indent() << "begin" << endl;
+    f_service_.indent() << "begin" << '\n';
     f_service_.indent_up();
   }
 
@@ -1068,37 +1066,37 @@
     }
     f_service_ << "args." << (*f_iter)->get_name();
   }
-  f_service_ << ")" << endl;
+  f_service_ << ")" << '\n';
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
     f_service_.indent_down();
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_.indent() << "rescue " << full_type_name((*x_iter)->get_type()) << " => "
-                          << (*x_iter)->get_name() << endl;
+                          << (*x_iter)->get_name() << '\n';
       if (!tfunction->is_oneway()) {
         f_service_.indent_up();
         f_service_.indent() << "result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name()
-                            << endl;
+                            << '\n';
         f_service_.indent_down();
       }
     }
-    f_service_.indent() << "end" << endl;
+    f_service_.indent() << "end" << '\n';
   }
 
   // Shortcut out here for oneway functions
   if (tfunction->is_oneway()) {
-    f_service_.indent() << "return" << endl;
+    f_service_.indent() << "return" << '\n';
     f_service_.indent_down();
-    f_service_.indent() << "end" << endl << endl;
+    f_service_.indent() << "end" << '\n' << '\n';
     return;
   }
 
   f_service_.indent() << "write_result(result, oprot, '" << tfunction->get_name() << "', seqid)"
-                      << endl;
+                      << '\n';
 
   // Close function
   f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
+  f_service_.indent() << "end" << '\n' << '\n';
 }
 
 /**
@@ -1219,7 +1217,7 @@
 }
 
 void t_rb_generator::generate_rb_struct_required_validator(t_rb_ofstream& out, t_struct* tstruct) {
-  out.indent() << "def validate" << endl;
+  out.indent() << "def validate" << '\n';
   out.indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -1235,7 +1233,7 @@
       } else {
         out << " unless @" << field->get_name();
       }
-      out << endl;
+      out << '\n';
     }
   }
 
@@ -1246,21 +1244,21 @@
     if (field->get_type()->is_enum()) {
       out.indent() << "unless @" << field->get_name() << ".nil? || "
                    << full_type_name(field->get_type()) << "::VALID_VALUES.include?(@"
-                   << field->get_name() << ")" << endl;
+                   << field->get_name() << ")" << '\n';
       out.indent_up();
       out.indent() << "raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, "
-                      "'Invalid value of field " << field->get_name() << "!')" << endl;
+                      "'Invalid value of field " << field->get_name() << "!')" << '\n';
       out.indent_down();
-      out.indent() << "end" << endl;
+      out.indent() << "end" << '\n';
     }
   }
 
   out.indent_down();
-  out.indent() << "end" << endl << endl;
+  out.indent() << "end" << '\n' << '\n';
 }
 
 void t_rb_generator::generate_rb_union_validator(t_rb_ofstream& out, t_struct* tstruct) {
-  out.indent() << "def validate" << endl;
+  out.indent() << "def validate" << '\n';
   out.indent_up();
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -1268,25 +1266,25 @@
 
   out.indent()
       << "raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?"
-      << endl;
+      << '\n';
 
   // if field is an enum, check that its value is valid
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     const t_field* field = (*f_iter);
 
     if (field->get_type()->is_enum()) {
-      out.indent() << "if get_set_field == :" << field->get_name() << endl;
+      out.indent() << "if get_set_field == :" << field->get_name() << '\n';
       out.indent() << "  raise "
                       "::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, "
                       "'Invalid value of field " << field->get_name() << "!') unless "
                    << full_type_name(field->get_type()) << "::VALID_VALUES.include?(get_value)"
-                   << endl;
-      out.indent() << "end" << endl;
+                   << '\n';
+      out.indent() << "end" << '\n';
     }
   }
 
   out.indent_down();
-  out.indent() << "end" << endl << endl;
+  out.indent() << "end" << '\n' << '\n';
 }
 
 std::string t_rb_generator::display_name() const {
diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
index 2742724..780c8fd 100644
--- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
@@ -31,7 +31,6 @@
 using std::string;
 using std::vector;
 
-static const string endl("\n"); // avoid ostream << std::endl flushes
 static const string SERVICE_RESULT_VARIABLE("result_value");
 static const string RESULT_STRUCT_SUFFIX("Result");
 static const string RUST_RESERVED_WORDS[]
@@ -521,9 +520,9 @@
   f_gen_.open(f_gen_name.c_str());
 
   // header comment
-  f_gen_ << "// " << autogen_summary() << endl;
-  f_gen_ << "// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING" << endl;
-  f_gen_ << endl;
+  f_gen_ << "// " << autogen_summary() << '\n';
+  f_gen_ << "// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING" << '\n';
+  f_gen_ << '\n';
 
   render_attributes_and_includes();
 }
@@ -532,11 +531,11 @@
   // turn off some compiler/clippy warnings
 
   // code may not be used
-  f_gen_ << "#![allow(dead_code)]" << endl;
+  f_gen_ << "#![allow(dead_code)]" << '\n';
   // code always includes BTreeMap/BTreeSet/OrderedFloat
-  f_gen_ << "#![allow(unused_imports)]" << endl;
+  f_gen_ << "#![allow(unused_imports)]" << '\n';
   // code might not include imports from crates
-  f_gen_ << "#![allow(unused_extern_crates)]" << endl;
+  f_gen_ << "#![allow(unused_extern_crates)]" << '\n';
   // constructors take *all* struct parameters, which can trigger the "too many arguments" warning
   // some auto-gen'd types can be deeply nested. clippy recommends factoring them out which is hard
   // to autogen some methods may start with "is_"
@@ -548,38 +547,38 @@
   // 2. When you define types out of order
   f_gen_ << "#![allow(clippy::too_many_arguments, clippy::type_complexity, clippy::vec_box, "
             "clippy::wrong_self_convention)]"
-         << endl;
+         << '\n';
   // prevent rustfmt from running against this file
   // lines are too long, code is (thankfully!) not visual-indented, etc.
   // can't use #[rustfmt::skip] see: https://github.com/rust-lang/rust/issues/54726
-  f_gen_ << "#![cfg_attr(rustfmt, rustfmt_skip)]" << endl;
-  f_gen_ << endl;
+  f_gen_ << "#![cfg_attr(rustfmt, rustfmt_skip)]" << '\n';
+  f_gen_ << '\n';
 
   // add standard includes
-  f_gen_ << "use std::cell::RefCell;" << endl;
-  f_gen_ << "use std::collections::{BTreeMap, BTreeSet};" << endl;
-  f_gen_ << "use std::convert::{From, TryFrom};" << endl;
-  f_gen_ << "use std::default::Default;" << endl;
-  f_gen_ << "use std::error::Error;" << endl;
-  f_gen_ << "use std::fmt;" << endl;
-  f_gen_ << "use std::fmt::{Display, Formatter};" << endl;
-  f_gen_ << "use std::rc::Rc;" << endl;
-  f_gen_ << endl;
-  f_gen_ << "use thrift::OrderedFloat;" << endl;
+  f_gen_ << "use std::cell::RefCell;" << '\n';
+  f_gen_ << "use std::collections::{BTreeMap, BTreeSet};" << '\n';
+  f_gen_ << "use std::convert::{From, TryFrom};" << '\n';
+  f_gen_ << "use std::default::Default;" << '\n';
+  f_gen_ << "use std::error::Error;" << '\n';
+  f_gen_ << "use std::fmt;" << '\n';
+  f_gen_ << "use std::fmt::{Display, Formatter};" << '\n';
+  f_gen_ << "use std::rc::Rc;" << '\n';
+  f_gen_ << '\n';
+  f_gen_ << "use thrift::OrderedFloat;" << '\n';
   f_gen_ << "use thrift::{ApplicationError, ApplicationErrorKind, ProtocolError, "
             "ProtocolErrorKind, TThriftClient};"
-         << endl;
+         << '\n';
   f_gen_ << "use thrift::protocol::{TFieldIdentifier, TListIdentifier, TMapIdentifier, "
             "TMessageIdentifier, TMessageType, TInputProtocol, TOutputProtocol, TSerializable, "
             "TSetIdentifier, TStructIdentifier, TType};"
-         << endl;
-  f_gen_ << "use thrift::protocol::field_id;" << endl;
-  f_gen_ << "use thrift::protocol::verify_expected_message_type;" << endl;
-  f_gen_ << "use thrift::protocol::verify_expected_sequence_number;" << endl;
-  f_gen_ << "use thrift::protocol::verify_expected_service_call;" << endl;
-  f_gen_ << "use thrift::protocol::verify_required_field_exists;" << endl;
-  f_gen_ << "use thrift::server::TProcessor;" << endl;
-  f_gen_ << endl;
+         << '\n';
+  f_gen_ << "use thrift::protocol::field_id;" << '\n';
+  f_gen_ << "use thrift::protocol::verify_expected_message_type;" << '\n';
+  f_gen_ << "use thrift::protocol::verify_expected_sequence_number;" << '\n';
+  f_gen_ << "use thrift::protocol::verify_expected_service_call;" << '\n';
+  f_gen_ << "use thrift::protocol::verify_required_field_exists;" << '\n';
+  f_gen_ << "use thrift::server::TProcessor;" << '\n';
+  f_gen_ << '\n';
 
   // add all the program includes
   // NOTE: this is more involved than you would expect because of service extension
@@ -615,13 +614,13 @@
       string_replace(module_namespace, ".", "::");
 
       if (module_namespace.empty()) {
-        f_gen_ << "use crate::" << rust_snake_case(module_name) << ";" << endl;
+        f_gen_ << "use crate::" << rust_snake_case(module_name) << ";" << '\n';
       } else {
         f_gen_ << "use crate::" << module_namespace << "::" << rust_snake_case(module_name) << ";"
-               << endl;
+               << '\n';
       }
     }
-    f_gen_ << endl;
+    f_gen_ << '\n';
   }
 }
 
@@ -673,8 +672,8 @@
 
   f_gen_ << "pub const " << rust_upper_case(name) << ": " << to_rust_const_type(ttype) << " = ";
   render_const_value(ttype, tvalue, false);
-  f_gen_ << ";" << endl;
-  f_gen_ << endl;
+  f_gen_ << ";" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_const_value_holder(const string& name,
@@ -686,19 +685,19 @@
 
   string holder_name("Const" + rust_camel_case(name));
 
-  f_gen_ << indent() << "pub struct " << holder_name << ";" << endl;
-  f_gen_ << indent() << "impl " << holder_name << " {" << endl;
+  f_gen_ << indent() << "pub struct " << holder_name << ";" << '\n';
+  f_gen_ << indent() << "impl " << holder_name << " {" << '\n';
   indent_up();
 
-  f_gen_ << indent() << "pub fn const_value() -> " << to_rust_type(ttype) << " {" << endl;
+  f_gen_ << indent() << "pub fn const_value() -> " << to_rust_type(ttype) << " {" << '\n';
   indent_up();
   render_const_value(ttype, tvalue, true, false);
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_const_value(t_type* ttype,
@@ -748,10 +747,10 @@
   } else if (ttype->is_typedef()) {
     render_const_value(get_true_type(ttype), tvalue, is_owned, true);
   } else if (ttype->is_enum()) {
-    f_gen_ << "{" << endl;
+    f_gen_ << "{" << '\n';
     indent_up();
     f_gen_ << indent() << to_rust_type(ttype) << "::try_from(" << tvalue->get_integer()
-           << ").expect(\"expecting valid const value\")" << endl;
+           << ").expect(\"expecting valid const value\")" << '\n';
     indent_down();
     f_gen_ << indent() << "}";
   } else if (ttype->is_struct() || ttype->is_xception()) {
@@ -772,21 +771,21 @@
   }
 
   if (!is_inline) {
-    f_gen_ << endl;
+    f_gen_ << '\n';
   }
 }
 
 void t_rs_generator::render_const_struct(t_type* ttype, t_const_value*) {
   if (((t_struct*)ttype)->is_union()) {
-    f_gen_ << "{" << endl;
+    f_gen_ << "{" << '\n';
     indent_up();
-    f_gen_ << indent() << "unimplemented!()" << endl;
+    f_gen_ << indent() << "unimplemented!()" << '\n';
     indent_down();
     f_gen_ << indent() << "}";
   } else {
-    f_gen_ << "{" << endl;
+    f_gen_ << "{" << '\n';
     indent_up();
-    f_gen_ << indent() << "unimplemented!()" << endl;
+    f_gen_ << indent() << "unimplemented!()" << '\n';
     indent_down();
     f_gen_ << indent() << "}";
   }
@@ -794,7 +793,7 @@
 
 void t_rs_generator::render_const_list(t_type* ttype, t_const_value* tvalue) {
   t_type* elem_type = ((t_list*)ttype)->get_elem_type();
-  f_gen_ << "vec![" << endl;
+  f_gen_ << "vec![" << '\n';
   indent_up();
   const vector<t_const_value*>& elems = tvalue->get_list();
   vector<t_const_value*>::const_iterator elem_iter;
@@ -802,7 +801,7 @@
     f_gen_ << indent();
     t_const_value* elem_value = (*elem_iter);
     render_const_value(elem_type, elem_value);
-    f_gen_ << "," << endl;
+    f_gen_ << "," << '\n';
   }
   indent_down();
   f_gen_ << indent() << "]";
@@ -810,7 +809,7 @@
 
 void t_rs_generator::render_const_set(t_type* ttype, t_const_value* tvalue) {
   t_type* elem_type = ((t_set*)ttype)->get_elem_type();
-  f_gen_ << "BTreeSet::from([" << endl;
+  f_gen_ << "BTreeSet::from([" << '\n';
   indent_up();
   const vector<t_const_value*>& elems = tvalue->get_list();
   vector<t_const_value*>::const_iterator elem_iter;
@@ -818,7 +817,7 @@
     f_gen_ << indent();
     t_const_value* elem_value = (*elem_iter);
     render_const_value(elem_type, elem_value);
-    f_gen_ << "," << endl;
+    f_gen_ << "," << '\n';
   }
   indent_down();
   f_gen_ << indent() << "])";
@@ -827,7 +826,7 @@
 void t_rs_generator::render_const_map(t_type* ttype, t_const_value* tvalue) {
   t_type* key_type = ((t_map*)ttype)->get_key_type();
   t_type* val_type = ((t_map*)ttype)->get_val_type();
-  f_gen_ << "BTreeMap::from([" << endl;
+  f_gen_ << "BTreeMap::from([" << '\n';
   indent_up();
   const map<t_const_value*, t_const_value*, t_const_value::value_compare>& elems
       = tvalue->get_map();
@@ -836,16 +835,16 @@
     t_const_value* key_value = elem_iter->first;
     t_const_value* val_value = elem_iter->second;
 
-    f_gen_ << indent() << "(" << endl;
+    f_gen_ << indent() << "(" << '\n';
     indent_up();
     f_gen_ << indent();
     render_const_value(key_type, key_value);
-    f_gen_ << "," << endl;
+    f_gen_ << "," << '\n';
     f_gen_ << indent();
     render_const_value(val_type, val_value);
-    f_gen_ << "," << endl;
+    f_gen_ << "," << '\n';
     indent_down();
-    f_gen_ << indent() << ")," << endl;
+    f_gen_ << indent() << ")," << '\n';
   }
   indent_down();
   f_gen_ << indent() << "])";
@@ -860,8 +859,8 @@
 void t_rs_generator::generate_typedef(t_typedef* ttypedef) {
   std::string actual_type = to_rust_type(ttypedef->get_type());
   f_gen_ << "pub type " << rust_safe_name(ttypedef->get_symbolic()) << " = " << actual_type << ";"
-         << endl;
-  f_gen_ << endl;
+         << '\n';
+  f_gen_ << '\n';
 }
 
 //-----------------------------------------------------------------------------
@@ -879,13 +878,13 @@
 
 void t_rs_generator::render_enum_definition(t_enum* tenum, const string& enum_name) {
   render_rustdoc((t_doc*)tenum);
-  f_gen_ << "#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << endl;
-  f_gen_ << "pub struct " << enum_name << "(pub i32);" << endl;
-  f_gen_ << endl;
+  f_gen_ << "#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << '\n';
+  f_gen_ << "pub struct " << enum_name << "(pub i32);" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_enum_impl(t_enum* tenum, const string& enum_name) {
-  f_gen_ << "impl " << enum_name << " {" << endl;
+  f_gen_ << "impl " << enum_name << " {" << '\n';
   indent_up();
 
   vector<t_enum_value*> constants = tenum->get_constants();
@@ -898,114 +897,114 @@
       render_rustdoc((t_doc*)val);
       f_gen_ << indent() << "pub const " << rust_enum_variant_name(val->get_name()) << ": "
              << enum_name << " = " << enum_name << "(" << val->get_value() << ")"
-             << ";" << endl;
+             << ";" << '\n';
     }
   }
 
   // array containing all IDL-defined enum variants
   {
-    f_gen_ << indent() << "pub const ENUM_VALUES: &'static [Self] = &[" << endl;
+    f_gen_ << indent() << "pub const ENUM_VALUES: &'static [Self] = &[" << '\n';
     indent_up();
     vector<t_enum_value*>::iterator constants_iter;
     for (constants_iter = constants.begin(); constants_iter != constants.end(); ++constants_iter) {
       t_enum_value* val = (*constants_iter);
-      f_gen_ << indent() << "Self::" << rust_enum_variant_name(val->get_name()) << "," << endl;
+      f_gen_ << indent() << "Self::" << rust_enum_variant_name(val->get_name()) << "," << '\n';
     }
     indent_down();
-    f_gen_ << indent() << "];" << endl;
+    f_gen_ << indent() << "];" << '\n';
   }
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
-  f_gen_ << "impl TSerializable for " << enum_name << " {" << endl;
+  f_gen_ << "impl TSerializable for " << enum_name << " {" << '\n';
   indent_up();
 
-  f_gen_ << indent() << "#[allow(clippy::trivially_copy_pass_by_ref)]" << endl;
+  f_gen_ << indent() << "#[allow(clippy::trivially_copy_pass_by_ref)]" << '\n';
   f_gen_
       << indent()
       << "fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) -> thrift::Result<()> {"
-      << endl;
+      << '\n';
   indent_up();
-  f_gen_ << indent() << "o_prot.write_i32(self.0)" << endl;
+  f_gen_ << indent() << "o_prot.write_i32(self.0)" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   f_gen_ << indent()
          << "fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result<"
-         << enum_name << "> {" << endl;
+         << enum_name << "> {" << '\n';
   indent_up();
-  f_gen_ << indent() << "let enum_value = i_prot.read_i32()?;" << endl;
+  f_gen_ << indent() << "let enum_value = i_prot.read_i32()?;" << '\n';
   f_gen_ << indent() << "Ok(" << enum_name << "::from(enum_value)"
-         << ")" << endl;
+         << ")" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_enum_conversion(t_enum* tenum, const string& enum_name) {
   // From trait: i32 -> ENUM_TYPE
-  f_gen_ << "impl From<i32> for " << enum_name << " {" << endl;
+  f_gen_ << "impl From<i32> for " << enum_name << " {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn from(i: i32) -> Self {" << endl;
+  f_gen_ << indent() << "fn from(i: i32) -> Self {" << '\n';
   indent_up();
-  f_gen_ << indent() << "match i {" << endl;
+  f_gen_ << indent() << "match i {" << '\n';
   indent_up();
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator constants_iter;
   for (constants_iter = constants.begin(); constants_iter != constants.end(); ++constants_iter) {
     t_enum_value* val = (*constants_iter);
     f_gen_ << indent() << val->get_value() << " => " << enum_name
-           << "::" << rust_enum_variant_name(val->get_name()) << "," << endl;
+           << "::" << rust_enum_variant_name(val->get_name()) << "," << '\n';
   }
-  f_gen_ << indent() << "_ => " << enum_name << "(i)" << endl;
+  f_gen_ << indent() << "_ => " << enum_name << "(i)" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
   // From trait: &i32 -> ENUM_TYPE
-  f_gen_ << "impl From<&i32> for " << enum_name << " {" << endl;
+  f_gen_ << "impl From<&i32> for " << enum_name << " {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn from(i: &i32) -> Self {" << endl;
+  f_gen_ << indent() << "fn from(i: &i32) -> Self {" << '\n';
   indent_up();
-  f_gen_ << indent() << enum_name << "::from(*i)" << endl;
+  f_gen_ << indent() << enum_name << "::from(*i)" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
   // From trait: ENUM_TYPE -> int
-  f_gen_ << "impl From<" << enum_name << "> for i32 {" << endl;
+  f_gen_ << "impl From<" << enum_name << "> for i32 {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn from(e: " << enum_name << ") -> i32 {" << endl;
+  f_gen_ << indent() << "fn from(e: " << enum_name << ") -> i32 {" << '\n';
   indent_up();
-  f_gen_ << indent() << "e.0" << endl;
+  f_gen_ << indent() << "e.0" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
   // From trait: &ENUM_TYPE -> int
-  f_gen_ << "impl From<&" << enum_name << "> for i32 {" << endl;
+  f_gen_ << "impl From<&" << enum_name << "> for i32 {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn from(e: &" << enum_name << ") -> i32 {" << endl;
+  f_gen_ << indent() << "fn from(e: &" << enum_name << ") -> i32 {" << '\n';
   indent_up();
-  f_gen_ << indent() << "e.0" << endl;
+  f_gen_ << indent() << "e.0" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 //-----------------------------------------------------------------------------
@@ -1056,8 +1055,8 @@
     }
   }
   f_gen_ << "#[derive(Clone, Debug" << (need_default ? ", Default" : "")
-         << ", Eq, Hash, Ord, PartialEq, PartialOrd)]" << endl;
-  f_gen_ << visibility_qualifier(struct_type) << "struct " << struct_name << " {" << endl;
+         << ", Eq, Hash, Ord, PartialEq, PartialOrd)]" << '\n';
+  f_gen_ << visibility_qualifier(struct_type) << "struct " << struct_name << " {" << '\n';
 
   // render the members
   if (!members.empty()) {
@@ -1072,53 +1071,53 @@
 
       render_rustdoc((t_doc*)member);
       f_gen_ << indent() << visibility_qualifier(struct_type) << rust_field_name(member) << ": "
-             << rust_type << "," << endl;
+             << rust_type << "," << '\n';
     }
 
     indent_down();
   }
 
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_exception_struct_error_trait_impls(const string& struct_name,
                                                                t_struct* tstruct) {
   // error::Error trait
-  f_gen_ << "impl Error for " << struct_name << " {}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "impl Error for " << struct_name << " {}" << '\n';
+  f_gen_ << '\n';
 
   // convert::From trait
-  f_gen_ << "impl From<" << struct_name << "> for thrift::Error {" << endl;
+  f_gen_ << "impl From<" << struct_name << "> for thrift::Error {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn from(e: " << struct_name << ") -> Self {" << endl;
+  f_gen_ << indent() << "fn from(e: " << struct_name << ") -> Self {" << '\n';
   indent_up();
-  f_gen_ << indent() << "thrift::Error::User(Box::new(e))" << endl;
+  f_gen_ << indent() << "thrift::Error::User(Box::new(e))" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
   // fmt::Display trait
-  f_gen_ << "impl Display for " << struct_name << " {" << endl;
+  f_gen_ << "impl Display for " << struct_name << " {" << '\n';
   indent_up();
-  f_gen_ << indent() << "fn fmt(&self, f: &mut Formatter) -> fmt::Result {" << endl;
+  f_gen_ << indent() << "fn fmt(&self, f: &mut Formatter) -> fmt::Result {" << '\n';
   indent_up();
   f_gen_ << indent() << "write!(f, "
          << "\"remote service threw " << tstruct->get_name() << "\"" // use *original* name
-         << ")" << endl;
+         << ")" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_struct_impl(const string& struct_name,
                                         t_struct* tstruct,
                                         t_rs_generator::e_struct_type struct_type) {
-  f_gen_ << "impl " << struct_name << " {" << endl;
+  f_gen_ << "impl " << struct_name << " {" << '\n';
   indent_up();
 
   if (struct_type == t_rs_generator::T_REGULAR || struct_type == t_rs_generator::T_EXCEPTION) {
@@ -1131,10 +1130,10 @@
 
   if (struct_type == t_rs_generator::T_REGULAR || struct_type == t_rs_generator::T_EXCEPTION) {
     indent_down();
-    f_gen_ << "}" << endl;
-    f_gen_ << endl;
+    f_gen_ << "}" << '\n';
+    f_gen_ << '\n';
 
-    f_gen_ << "impl TSerializable for " << struct_name << " {" << endl;
+    f_gen_ << "impl TSerializable for " << struct_name << " {" << '\n';
     indent_up();
   }
 
@@ -1142,8 +1141,8 @@
   render_struct_sync_write(tstruct, struct_type);
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_struct_constructor(const string& struct_name,
@@ -1213,13 +1212,13 @@
 
   string visibility(visibility_qualifier(struct_type));
   f_gen_ << indent() << visibility << "fn new" << type_parameter_string << "(" << arg_string
-         << ") -> " << struct_name << " " << type_qualifier_string << "{" << endl;
+         << ") -> " << struct_name << " " << type_qualifier_string << "{" << '\n';
   indent_up();
 
   if (members.empty()) {
-    f_gen_ << indent() << struct_name << " {}" << endl;
+    f_gen_ << indent() << struct_name << " {}" << '\n';
   } else {
-    f_gen_ << indent() << struct_name << " {" << endl;
+    f_gen_ << indent() << struct_name << " {" << '\n';
     indent_up();
 
     for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
@@ -1228,18 +1227,18 @@
       string member_name(rust_field_name(member));
 
       if (is_optional(member_req)) {
-        f_gen_ << indent() << member_name << ": " << member_name << ".into()," << endl;
+        f_gen_ << indent() << member_name << ": " << member_name << ".into()," << '\n';
       } else {
-        f_gen_ << indent() << member_name << "," << endl;
+        f_gen_ << indent() << member_name << "," << '\n';
       }
     }
 
     indent_down();
-    f_gen_ << indent() << "}" << endl;
+    f_gen_ << indent() << "}" << '\n';
   }
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_result_struct_to_result_method(t_struct* tstruct) {
@@ -1272,7 +1271,7 @@
   // maintaining a rendered branch count (while a little ugly) got me the
   // rendering I wanted with code that was reasonably understandable
 
-  f_gen_ << indent() << "fn ok_or(self) -> thrift::Result<" << rust_return_type << "> {" << endl;
+  f_gen_ << indent() << "fn ok_or(self) -> thrift::Result<" << rust_return_type << "> {" << '\n';
   indent_up();
 
   int rendered_branch_count = 0;
@@ -1284,10 +1283,10 @@
       string field_name("self." + rust_field_name(tfield));
       string branch_statement = rendered_branch_count == 0 ? "if" : "} else if";
 
-      f_gen_ << indent() << branch_statement << " " << field_name << ".is_some() {" << endl;
+      f_gen_ << indent() << branch_statement << " " << field_name << ".is_some() {" << '\n';
       indent_up();
       f_gen_ << indent() << "Err(thrift::Error::User(Box::new(" << field_name << ".unwrap())))"
-             << endl;
+             << '\n';
       indent_down();
 
       rendered_branch_count++;
@@ -1299,35 +1298,35 @@
     if (rendered_branch_count == 0) {
       // we have the unit return and this service call has no user-defined
       // exceptions. this means that we've a trivial return (happens with oneways)
-      f_gen_ << indent() << "Ok(())" << endl;
+      f_gen_ << indent() << "Ok(())" << '\n';
     } else {
       // we have the unit return, but there are user-defined exceptions
       // if we've gotten this far then we have the default return (i.e. call successful)
-      f_gen_ << indent() << "} else {" << endl;
+      f_gen_ << indent() << "} else {" << '\n';
       indent_up();
-      f_gen_ << indent() << "Ok(())" << endl;
+      f_gen_ << indent() << "Ok(())" << '\n';
       indent_down();
-      f_gen_ << indent() << "}" << endl;
+      f_gen_ << indent() << "}" << '\n';
     }
   } else {
     string branch_statement = rendered_branch_count == 0 ? "if" : "} else if";
     f_gen_ << indent() << branch_statement << " self." << SERVICE_RESULT_VARIABLE << ".is_some() {"
-           << endl;
+           << '\n';
     indent_up();
-    f_gen_ << indent() << "Ok(self." << SERVICE_RESULT_VARIABLE << ".unwrap())" << endl;
+    f_gen_ << indent() << "Ok(self." << SERVICE_RESULT_VARIABLE << ".unwrap())" << '\n';
     indent_down();
-    f_gen_ << indent() << "} else {" << endl;
+    f_gen_ << indent() << "} else {" << '\n';
     indent_up();
     // if we haven't found a valid return value *or* a user exception
     // then we're in trouble; return a default error
     render_thrift_error("Application", "ApplicationError", "ApplicationErrorKind::MissingResult",
                         "\"no result received for " + service_call_name + "\"");
     indent_down();
-    f_gen_ << indent() << "}" << endl;
+    f_gen_ << indent() << "}" << '\n';
   }
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_union(t_struct* tstruct) {
@@ -1343,32 +1342,32 @@
     throw "cannot generate rust enum with 0 members"; // may be valid thrift, but it's invalid rust
   }
 
-  f_gen_ << "#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << endl;
-  f_gen_ << "pub enum " << union_name << " {" << endl;
+  f_gen_ << "#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << '\n';
+  f_gen_ << "pub enum " << union_name << " {" << '\n';
   indent_up();
 
   vector<t_field*>::const_iterator member_iter;
   for (member_iter = members.begin(); member_iter != members.end(); ++member_iter) {
     t_field* tfield = (*member_iter);
     f_gen_ << indent() << rust_union_field_name(tfield) << "(" << to_rust_type(tfield->get_type())
-           << ")," << endl;
+           << ")," << '\n';
   }
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_union_impl(const string& union_name, t_struct* tstruct) {
-  f_gen_ << "impl TSerializable for " << union_name << " {" << endl;
+  f_gen_ << "impl TSerializable for " << union_name << " {" << '\n';
   indent_up();
 
   render_union_sync_read(union_name, tstruct);
   render_union_sync_write(union_name, tstruct);
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 //-----------------------------------------------------------------------------
@@ -1382,14 +1381,14 @@
   f_gen_
       << indent()
       << "fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) -> thrift::Result<()> {"
-      << endl;
+      << '\n';
   indent_up();
 
   // write struct header to output protocol
   // note: use the *original* struct name here
   f_gen_ << indent()
-         << "let struct_ident = TStructIdentifier::new(\"" + tstruct->get_name() + "\");" << endl;
-  f_gen_ << indent() << "o_prot.write_struct_begin(&struct_ident)?;" << endl;
+         << "let struct_ident = TStructIdentifier::new(\"" + tstruct->get_name() + "\");" << '\n';
+  f_gen_ << indent() << "o_prot.write_struct_begin(&struct_ident)?;" << '\n';
 
   // write struct members to output protocol
   vector<t_field*> members = tstruct->get_sorted_members();
@@ -1404,30 +1403,30 @@
   }
 
   // write struct footer to output protocol
-  f_gen_ << indent() << "o_prot.write_field_stop()?;" << endl;
-  f_gen_ << indent() << "o_prot.write_struct_end()" << endl;
+  f_gen_ << indent() << "o_prot.write_field_stop()?;" << '\n';
+  f_gen_ << indent() << "o_prot.write_struct_end()" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_union_sync_write(const string& union_name, t_struct* tstruct) {
   f_gen_
       << indent()
       << "fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) -> thrift::Result<()> {"
-      << endl;
+      << '\n';
   indent_up();
 
   // write struct header to output protocol
   // note: use the *original* struct name here
   f_gen_ << indent()
-         << "let struct_ident = TStructIdentifier::new(\"" + tstruct->get_name() + "\");" << endl;
-  f_gen_ << indent() << "o_prot.write_struct_begin(&struct_ident)?;" << endl;
+         << "let struct_ident = TStructIdentifier::new(\"" + tstruct->get_name() + "\");" << '\n';
+  f_gen_ << indent() << "o_prot.write_struct_begin(&struct_ident)?;" << '\n';
 
   // write the enum field to the output protocol
   vector<t_field*> members = tstruct->get_sorted_members();
   if (!members.empty()) {
-    f_gen_ << indent() << "match *self {" << endl;
+    f_gen_ << indent() << "match *self {" << '\n';
     indent_up();
     vector<t_field*>::iterator members_iter;
     for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
@@ -1440,22 +1439,22 @@
       }
       string match_var((ttype->is_base_type() && !ttype->is_string()) ? "f" : "ref f");
       f_gen_ << indent() << union_name << "::" << rust_union_field_name(member) << "(" << match_var
-             << ") => {" << endl;
+             << ") => {" << '\n';
       indent_up();
       render_struct_field_sync_write("f", true, member, member_req);
       indent_down();
-      f_gen_ << indent() << "}," << endl;
+      f_gen_ << indent() << "}," << '\n';
     }
     indent_down();
-    f_gen_ << indent() << "}" << endl;
+    f_gen_ << indent() << "}" << '\n';
   }
 
   // write struct footer to output protocol
-  f_gen_ << indent() << "o_prot.write_field_stop()?;" << endl;
-  f_gen_ << indent() << "o_prot.write_struct_end()" << endl;
+  f_gen_ << indent() << "o_prot.write_field_stop()?;" << '\n';
+  f_gen_ << indent() << "o_prot.write_struct_end()" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_struct_field_sync_write(const string& field_var,
@@ -1475,23 +1474,23 @@
   if (is_optional(req)) {
     string let_var((actual_type->is_base_type() && !actual_type->is_string()) ? "fld_var"
                                                                               : "ref fld_var");
-    f_gen_ << indent() << "if let Some(" << let_var << ") = " << field_var << " {" << endl;
+    f_gen_ << indent() << "if let Some(" << let_var << ") = " << field_var << " {" << '\n';
     indent_up();
-    f_gen_ << indent() << "o_prot.write_field_begin(&" << field_ident_string << ")?;" << endl;
+    f_gen_ << indent() << "o_prot.write_field_begin(&" << field_ident_string << ")?;" << '\n';
     render_type_sync_write("fld_var", true, field_type);
-    f_gen_ << indent() << "o_prot.write_field_end()?" << endl;
+    f_gen_ << indent() << "o_prot.write_field_end()?" << '\n';
     indent_down();
     /* FIXME: rethink how I deal with OPT_IN_REQ_OUT
     if (req == t_field::T_OPT_IN_REQ_OUT) {
-      f_gen_ << indent() << "let field_ident = " << field_ident_string << ";" << endl;
-      f_gen_ << indent() << "o_prot.write_field_begin(&field_ident)?;" << endl;
-      f_gen_ << indent() << "o_prot.write_field_end()?;" << endl;
+      f_gen_ << indent() << "let field_ident = " << field_ident_string << ";" << '\n';
+      f_gen_ << indent() << "o_prot.write_field_begin(&field_ident)?;" << '\n';
+      f_gen_ << indent() << "o_prot.write_field_end()?;" << '\n';
     }*/
-    f_gen_ << indent() << "}" << endl;
+    f_gen_ << indent() << "}" << '\n';
   } else {
-    f_gen_ << indent() << "o_prot.write_field_begin(&" << field_ident_string << ")?;" << endl;
+    f_gen_ << indent() << "o_prot.write_field_begin(&" << field_ident_string << ")?;" << '\n';
     render_type_sync_write(field_var, field_var_is_ref, tfield->get_type());
-    f_gen_ << indent() << "o_prot.write_field_end()?;" << endl;
+    f_gen_ << indent() << "o_prot.write_field_end()?;" << '\n';
   }
 }
 
@@ -1506,32 +1505,32 @@
     case t_base_type::TYPE_STRING: {
       string ref(type_var_is_ref ? "" : "&");
       if (tbase_type->is_binary()) {
-        f_gen_ << indent() << "o_prot.write_bytes(" + ref + type_var + ")?;" << endl;
+        f_gen_ << indent() << "o_prot.write_bytes(" + ref + type_var + ")?;" << '\n';
       } else {
-        f_gen_ << indent() << "o_prot.write_string(" + ref + type_var + ")?;" << endl;
+        f_gen_ << indent() << "o_prot.write_string(" + ref + type_var + ")?;" << '\n';
       }
       return;
     }
     case t_base_type::TYPE_UUID:
-      f_gen_ << indent() << "o_prot.write_uuid(&" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_uuid(&" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_BOOL:
-      f_gen_ << indent() << "o_prot.write_bool(" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_bool(" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_I8:
-      f_gen_ << indent() << "o_prot.write_i8(" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_i8(" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_I16:
-      f_gen_ << indent() << "o_prot.write_i16(" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_i16(" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_I32:
-      f_gen_ << indent() << "o_prot.write_i32(" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_i32(" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_I64:
-      f_gen_ << indent() << "o_prot.write_i64(" + type_var + ")?;" << endl;
+      f_gen_ << indent() << "o_prot.write_i64(" + type_var + ")?;" << '\n';
       return;
     case t_base_type::TYPE_DOUBLE:
-      f_gen_ << indent() << "o_prot.write_double(" + type_var + ".into())?;" << endl;
+      f_gen_ << indent() << "o_prot.write_double(" + type_var + ".into())?;" << '\n';
       return;
     default:
       throw "compiler error: unhandled type";
@@ -1541,7 +1540,7 @@
     render_type_sync_write(type_var, type_var_is_ref, ttypedef->get_type());
     return;
   } else if (ttype->is_enum() || ttype->is_struct() || ttype->is_xception()) {
-    f_gen_ << indent() << type_var + ".write_to_out_protocol(o_prot)?;" << endl;
+    f_gen_ << indent() << type_var + ".write_to_out_protocol(o_prot)?;" << '\n';
     return;
   } else if (ttype->is_map()) {
     render_map_sync_write(type_var, type_var_is_ref, (t_map*)ttype);
@@ -1566,15 +1565,15 @@
          << "&TListIdentifier::new(" << to_rust_field_type_enum(elem_type) << ", " << list_var
          << ".len() as i32"
          << ")"
-         << ")?;" << endl;
+         << ")?;" << '\n';
 
   string ref(list_var_is_ref ? "" : "&");
-  f_gen_ << indent() << "for e in " << ref << list_var << " {" << endl;
+  f_gen_ << indent() << "for e in " << ref << list_var << " {" << '\n';
   indent_up();
   render_type_sync_write(string_container_write_variable(elem_type, "e"), true, elem_type);
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "o_prot.write_list_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "o_prot.write_list_end()?;" << '\n';
 }
 
 void t_rs_generator::render_set_sync_write(const string& set_var,
@@ -1586,15 +1585,15 @@
          << "&TSetIdentifier::new(" << to_rust_field_type_enum(elem_type) << ", " << set_var
          << ".len() as i32"
          << ")"
-         << ")?;" << endl;
+         << ")?;" << '\n';
 
   string ref(set_var_is_ref ? "" : "&");
-  f_gen_ << indent() << "for e in " << ref << set_var << " {" << endl;
+  f_gen_ << indent() << "for e in " << ref << set_var << " {" << '\n';
   indent_up();
   render_type_sync_write(string_container_write_variable(elem_type, "e"), true, elem_type);
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "o_prot.write_set_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "o_prot.write_set_end()?;" << '\n';
 }
 
 void t_rs_generator::render_map_sync_write(const string& map_var,
@@ -1606,16 +1605,16 @@
   f_gen_ << indent() << "o_prot.write_map_begin("
          << "&TMapIdentifier::new(" << to_rust_field_type_enum(key_type) << ", "
          << to_rust_field_type_enum(val_type) << ", " << map_var << ".len() as i32)"
-         << ")?;" << endl;
+         << ")?;" << '\n';
 
   string ref(map_var_is_ref ? "" : "&");
-  f_gen_ << indent() << "for (k, v) in " << ref << map_var << " {" << endl;
+  f_gen_ << indent() << "for (k, v) in " << ref << map_var << " {" << '\n';
   indent_up();
   render_type_sync_write(string_container_write_variable(key_type, "k"), true, key_type);
   render_type_sync_write(string_container_write_variable(val_type, "v"), true, val_type);
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "o_prot.write_map_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "o_prot.write_map_end()?;" << '\n';
 }
 
 string t_rs_generator::string_container_write_variable(t_type* ttype, const string& base_var) {
@@ -1651,11 +1650,11 @@
                                              t_rs_generator::e_struct_type struct_type) {
   f_gen_ << indent()
          << "fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result<"
-         << struct_name << "> {" << endl;
+         << struct_name << "> {" << '\n';
 
   indent_up();
 
-  f_gen_ << indent() << "i_prot.read_struct_begin()?;" << endl;
+  f_gen_ << indent() << "i_prot.read_struct_begin()?;" << '\n';
 
   // create temporary variables: one for each field in the struct
   const vector<t_field*> members = tstruct->get_sorted_members();
@@ -1671,55 +1670,55 @@
     } else {
       f_gen_ << "None;";
     }
-    f_gen_ << endl;
+    f_gen_ << '\n';
   }
 
   // now loop through the fields we've received
-  f_gen_ << indent() << "loop {" << endl; // start loop
+  f_gen_ << indent() << "loop {" << '\n'; // start loop
   indent_up();
 
   // break out if you've found the Stop field
-  f_gen_ << indent() << "let field_ident = i_prot.read_field_begin()?;" << endl;
-  f_gen_ << indent() << "if field_ident.field_type == TType::Stop {" << endl;
+  f_gen_ << indent() << "let field_ident = i_prot.read_field_begin()?;" << '\n';
+  f_gen_ << indent() << "if field_ident.field_type == TType::Stop {" << '\n';
   indent_up();
-  f_gen_ << indent() << "break;" << endl;
+  f_gen_ << indent() << "break;" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   // now read all the fields found
   // avoid clippy::match_single_binding
   if (members.empty()) {
-    f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << endl;
+    f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << '\n';
   } else {
-    f_gen_ << indent() << "let field_id = field_id(&field_ident)?;" << endl;
-    f_gen_ << indent() << "match field_id {" << endl; // start match
+    f_gen_ << indent() << "let field_id = field_id(&field_ident)?;" << '\n';
+    f_gen_ << indent() << "match field_id {" << '\n'; // start match
     indent_up();
 
     for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
       t_field* tfield = (*members_iter);
-      f_gen_ << indent() << rust_safe_field_id(tfield->get_key()) << " => {" << endl;
+      f_gen_ << indent() << rust_safe_field_id(tfield->get_key()) << " => {" << '\n';
       indent_up();
       render_type_sync_read("val", tfield->get_type());
-      f_gen_ << indent() << struct_field_read_temp_variable(tfield) << " = Some(val);" << endl;
+      f_gen_ << indent() << struct_field_read_temp_variable(tfield) << " = Some(val);" << '\n';
       indent_down();
-      f_gen_ << indent() << "}," << endl;
+      f_gen_ << indent() << "}," << '\n';
     }
 
     // default case (skip fields)
-    f_gen_ << indent() << "_ => {" << endl;
+    f_gen_ << indent() << "_ => {" << '\n';
     indent_up();
-    f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << endl;
+    f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << '\n';
     indent_down();
-    f_gen_ << indent() << "}," << endl;
+    f_gen_ << indent() << "}," << '\n';
 
     indent_down();
-    f_gen_ << indent() << "};" << endl; // finish match
+    f_gen_ << indent() << "};" << '\n'; // finish match
   }
 
-  f_gen_ << indent() << "i_prot.read_field_end()?;" << endl;
+  f_gen_ << indent() << "i_prot.read_field_end()?;" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;                          // finish loop
-  f_gen_ << indent() << "i_prot.read_struct_end()?;" << endl; // read message footer from the wire
+  f_gen_ << indent() << "}" << '\n';                          // finish loop
+  f_gen_ << indent() << "i_prot.read_struct_end()?;" << '\n'; // read message footer from the wire
 
   // verify that all required fields exist
   for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
@@ -1729,15 +1728,15 @@
       f_gen_ << indent() << "verify_required_field_exists("
              << "\"" << struct_name << "." << rust_field_name(tfield) << "\""
              << ", "
-             << "&" << struct_field_read_temp_variable(tfield) << ")?;" << endl;
+             << "&" << struct_field_read_temp_variable(tfield) << ")?;" << '\n';
     }
   }
 
   // construct the struct
   if (members.size() == 0) {
-    f_gen_ << indent() << "let ret = " << struct_name << " {};" << endl;
+    f_gen_ << indent() << "let ret = " << struct_name << " {};" << '\n';
   } else {
-    f_gen_ << indent() << "let ret = " << struct_name << " {" << endl;
+    f_gen_ << indent() << "let ret = " << struct_name << " {" << '\n';
     indent_up();
 
     for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
@@ -1746,109 +1745,109 @@
       string field_name(rust_field_name(tfield));
       string field_key = struct_field_read_temp_variable(tfield);
       if (is_optional(req)) {
-        f_gen_ << indent() << field_name << ": " << field_key << "," << endl;
+        f_gen_ << indent() << field_name << ": " << field_key << "," << '\n';
       } else {
         f_gen_ << indent() << field_name << ": " << field_key
                << ".expect(\"auto-generated code should have checked for presence of required "
                   "fields\")"
-               << "," << endl;
+               << "," << '\n';
       }
     }
 
     indent_down();
-    f_gen_ << indent() << "};" << endl;
+    f_gen_ << indent() << "};" << '\n';
   }
 
   // return the constructed value
-  f_gen_ << indent() << "Ok(ret)" << endl;
+  f_gen_ << indent() << "Ok(ret)" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_union_sync_read(const string& union_name, t_struct* tstruct) {
   f_gen_ << indent()
          << "fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result<"
-         << union_name << "> {" << endl;
+         << union_name << "> {" << '\n';
   indent_up();
 
   // create temporary variables to hold the
   // completed union as well as a count of fields read
-  f_gen_ << indent() << "let mut ret: Option<" << union_name << "> = None;" << endl;
-  f_gen_ << indent() << "let mut received_field_count = 0;" << endl;
+  f_gen_ << indent() << "let mut ret: Option<" << union_name << "> = None;" << '\n';
+  f_gen_ << indent() << "let mut received_field_count = 0;" << '\n';
 
   // read the struct preamble
-  f_gen_ << indent() << "i_prot.read_struct_begin()?;" << endl;
+  f_gen_ << indent() << "i_prot.read_struct_begin()?;" << '\n';
 
   // now loop through the fields we've received
-  f_gen_ << indent() << "loop {" << endl; // start loop
+  f_gen_ << indent() << "loop {" << '\n'; // start loop
   indent_up();
 
   // break out if you've found the Stop field
-  f_gen_ << indent() << "let field_ident = i_prot.read_field_begin()?;" << endl;
-  f_gen_ << indent() << "if field_ident.field_type == TType::Stop {" << endl;
+  f_gen_ << indent() << "let field_ident = i_prot.read_field_begin()?;" << '\n';
+  f_gen_ << indent() << "if field_ident.field_type == TType::Stop {" << '\n';
   indent_up();
-  f_gen_ << indent() << "break;" << endl;
+  f_gen_ << indent() << "break;" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   // now read all the fields found
-  f_gen_ << indent() << "let field_id = field_id(&field_ident)?;" << endl;
-  f_gen_ << indent() << "match field_id {" << endl; // start match
+  f_gen_ << indent() << "let field_id = field_id(&field_ident)?;" << '\n';
+  f_gen_ << indent() << "match field_id {" << '\n'; // start match
   indent_up();
 
   const vector<t_field*> members = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator members_iter;
   for (members_iter = members.begin(); members_iter != members.end(); ++members_iter) {
     t_field* member = (*members_iter);
-    f_gen_ << indent() << rust_safe_field_id(member->get_key()) << " => {" << endl;
+    f_gen_ << indent() << rust_safe_field_id(member->get_key()) << " => {" << '\n';
     indent_up();
     render_type_sync_read("val", member->get_type());
-    f_gen_ << indent() << "if ret.is_none() {" << endl;
+    f_gen_ << indent() << "if ret.is_none() {" << '\n';
     indent_up();
     f_gen_ << indent() << "ret = Some(" << union_name << "::" << rust_union_field_name(member)
-           << "(val));" << endl;
+           << "(val));" << '\n';
     indent_down();
-    f_gen_ << indent() << "}" << endl;
-    f_gen_ << indent() << "received_field_count += 1;" << endl;
+    f_gen_ << indent() << "}" << '\n';
+    f_gen_ << indent() << "received_field_count += 1;" << '\n';
     indent_down();
-    f_gen_ << indent() << "}," << endl;
+    f_gen_ << indent() << "}," << '\n';
   }
 
   // default case (skip fields)
-  f_gen_ << indent() << "_ => {" << endl;
+  f_gen_ << indent() << "_ => {" << '\n';
   indent_up();
-  f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << endl;
-  f_gen_ << indent() << "received_field_count += 1;" << endl;
+  f_gen_ << indent() << "i_prot.skip(field_ident.field_type)?;" << '\n';
+  f_gen_ << indent() << "received_field_count += 1;" << '\n';
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
 
   indent_down();
-  f_gen_ << indent() << "};" << endl; // finish match
-  f_gen_ << indent() << "i_prot.read_field_end()?;" << endl;
+  f_gen_ << indent() << "};" << '\n'; // finish match
+  f_gen_ << indent() << "i_prot.read_field_end()?;" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;                          // finish loop
-  f_gen_ << indent() << "i_prot.read_struct_end()?;" << endl; // finish reading message from wire
+  f_gen_ << indent() << "}" << '\n';                          // finish loop
+  f_gen_ << indent() << "i_prot.read_struct_end()?;" << '\n'; // finish reading message from wire
 
   // return the value or an error
-  f_gen_ << indent() << "if received_field_count == 0 {" << endl;
+  f_gen_ << indent() << "if received_field_count == 0 {" << '\n';
   indent_up();
   render_thrift_error("Protocol", "ProtocolError", "ProtocolErrorKind::InvalidData",
                       "\"received empty union from remote " + union_name + "\"");
   indent_down();
-  f_gen_ << indent() << "} else if received_field_count > 1 {" << endl;
+  f_gen_ << indent() << "} else if received_field_count > 1 {" << '\n';
   indent_up();
   render_thrift_error("Protocol", "ProtocolError", "ProtocolErrorKind::InvalidData",
                       "\"received multiple fields for union from remote " + union_name + "\"");
   indent_down();
-  f_gen_ << indent() << "} else {" << endl;
+  f_gen_ << indent() << "} else {" << '\n';
   indent_up();
-  f_gen_ << indent() << "Ok(ret.expect(\"return value should have been constructed\"))" << endl;
+  f_gen_ << indent() << "Ok(ret.expect(\"return value should have been constructed\"))" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 // Construct the rust representation of all supported types from the wire.
@@ -1860,32 +1859,32 @@
       throw "cannot read field of type TYPE_VOID from input protocol";
     case t_base_type::TYPE_STRING:
       if (tbase_type->is_binary()) {
-        f_gen_ << indent() << "let " << type_var << " = i_prot.read_bytes()?;" << endl;
+        f_gen_ << indent() << "let " << type_var << " = i_prot.read_bytes()?;" << '\n';
       } else {
-        f_gen_ << indent() << "let " << type_var << " = i_prot.read_string()?;" << endl;
+        f_gen_ << indent() << "let " << type_var << " = i_prot.read_string()?;" << '\n';
       }
       return;
     case t_base_type::TYPE_UUID:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_uuid()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_uuid()?;" << '\n';
       return;
     case t_base_type::TYPE_BOOL:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_bool()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_bool()?;" << '\n';
       return;
     case t_base_type::TYPE_I8:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i8()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i8()?;" << '\n';
       return;
     case t_base_type::TYPE_I16:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i16()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i16()?;" << '\n';
       return;
     case t_base_type::TYPE_I32:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i32()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i32()?;" << '\n';
       return;
     case t_base_type::TYPE_I64:
-      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i64()?;" << endl;
+      f_gen_ << indent() << "let " << type_var << " = i_prot.read_i64()?;" << '\n';
       return;
     case t_base_type::TYPE_DOUBLE:
       f_gen_ << indent() << "let " << type_var << " = OrderedFloat::from(i_prot.read_double()?);"
-             << endl;
+             << '\n';
       return;
     default:
       throw "compiler error: unhandled type";
@@ -1905,7 +1904,7 @@
   } else if (ttype->is_enum() || ttype->is_struct() || ttype->is_xception()) {
     string read_call(to_rust_type(ttype) + "::read_from_in_protocol(i_prot)?");
     read_call = is_boxed ? "Box::new(" + read_call + ")" : read_call;
-    f_gen_ << indent() << "let " << type_var << " = " << read_call << ";" << endl;
+    f_gen_ << indent() << "let " << type_var << " = " << read_call << ";" << '\n';
     return;
   } else if (ttype->is_map()) {
     render_map_sync_read((t_map*)ttype, type_var);
@@ -1925,42 +1924,42 @@
 void t_rs_generator::render_list_sync_read(t_list* tlist, const string& list_var) {
   t_type* elem_type = tlist->get_elem_type();
 
-  f_gen_ << indent() << "let list_ident = i_prot.read_list_begin()?;" << endl;
+  f_gen_ << indent() << "let list_ident = i_prot.read_list_begin()?;" << '\n';
   f_gen_ << indent() << "let mut " << list_var << ": " << to_rust_type((t_type*)tlist)
-         << " = Vec::with_capacity(list_ident.size as usize);" << endl;
-  f_gen_ << indent() << "for _ in 0..list_ident.size {" << endl;
+         << " = Vec::with_capacity(list_ident.size as usize);" << '\n';
+  f_gen_ << indent() << "for _ in 0..list_ident.size {" << '\n';
 
   indent_up();
 
   string list_elem_var = tmp("list_elem_");
   render_type_sync_read(list_elem_var, elem_type);
-  f_gen_ << indent() << list_var << ".push(" << list_elem_var << ");" << endl;
+  f_gen_ << indent() << list_var << ".push(" << list_elem_var << ");" << '\n';
 
   indent_down();
 
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "i_prot.read_list_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "i_prot.read_list_end()?;" << '\n';
 }
 
 // Construct the rust representation of a set from the wire.
 void t_rs_generator::render_set_sync_read(t_set* tset, const string& set_var) {
   t_type* elem_type = tset->get_elem_type();
 
-  f_gen_ << indent() << "let set_ident = i_prot.read_set_begin()?;" << endl;
+  f_gen_ << indent() << "let set_ident = i_prot.read_set_begin()?;" << '\n';
   f_gen_ << indent() << "let mut " << set_var << ": " << to_rust_type((t_type*)tset)
-         << " = BTreeSet::new();" << endl;
-  f_gen_ << indent() << "for _ in 0..set_ident.size {" << endl;
+         << " = BTreeSet::new();" << '\n';
+  f_gen_ << indent() << "for _ in 0..set_ident.size {" << '\n';
 
   indent_up();
 
   string set_elem_var = tmp("set_elem_");
   render_type_sync_read(set_elem_var, elem_type);
-  f_gen_ << indent() << set_var << ".insert(" << set_elem_var << ");" << endl;
+  f_gen_ << indent() << set_var << ".insert(" << set_elem_var << ");" << '\n';
 
   indent_down();
 
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "i_prot.read_set_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "i_prot.read_set_end()?;" << '\n';
 }
 
 // Construct the rust representation of a map from the wire.
@@ -1968,10 +1967,10 @@
   t_type* key_type = tmap->get_key_type();
   t_type* val_type = tmap->get_val_type();
 
-  f_gen_ << indent() << "let map_ident = i_prot.read_map_begin()?;" << endl;
+  f_gen_ << indent() << "let map_ident = i_prot.read_map_begin()?;" << '\n';
   f_gen_ << indent() << "let mut " << map_var << ": " << to_rust_type((t_type*)tmap)
-         << " = BTreeMap::new();" << endl;
-  f_gen_ << indent() << "for _ in 0..map_ident.size {" << endl;
+         << " = BTreeMap::new();" << '\n';
+  f_gen_ << indent() << "for _ in 0..map_ident.size {" << '\n';
 
   indent_up();
 
@@ -1980,12 +1979,12 @@
   string val_elem_var = tmp("map_val_");
   render_type_sync_read(val_elem_var, val_type);
   f_gen_ << indent() << map_var << ".insert(" << key_elem_var << ", " << val_elem_var << ");"
-         << endl;
+         << '\n';
 
   indent_down();
 
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << indent() << "i_prot.read_map_end()?;" << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << indent() << "i_prot.read_map_end()?;" << '\n';
 }
 
 string t_rs_generator::struct_field_read_temp_variable(t_field* tfield) {
@@ -2036,7 +2035,7 @@
   render_sync_client_definition_and_impl(client_impl_name);
   render_sync_client_tthriftclient_impl(client_impl_name);
   render_sync_client_marker_trait_impls(tservice, client_impl_name);
-  f_gen_ << endl;
+  f_gen_ << '\n';
   render_sync_client_process_impl(tservice);
 }
 
@@ -2048,7 +2047,7 @@
   }
 
   render_rustdoc((t_doc*)tservice);
-  f_gen_ << "pub trait " << rust_sync_client_trait_name(tservice) << extension << " {" << endl;
+  f_gen_ << "pub trait " << rust_sync_client_trait_name(tservice) << extension << " {" << '\n';
   indent_up();
 
   const std::vector<t_function*> functions = tservice->get_functions();
@@ -2060,25 +2059,25 @@
     string func_return = to_rust_type(tfunc->get_returntype());
     render_rustdoc((t_doc*)tfunc);
     f_gen_ << indent() << "fn " << func_name << func_args << " -> thrift::Result<" << func_return
-           << ">;" << endl;
+           << ">;" << '\n';
   }
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_client_marker_trait(t_service* tservice) {
   f_gen_ << indent() << "pub trait " << rust_sync_client_marker_trait_name(tservice) << " {}"
-         << endl;
-  f_gen_ << endl;
+         << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_client_marker_trait_impls(t_service* tservice,
                                                            const string& impl_struct_name) {
   f_gen_ << indent() << "impl " << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << rust_namespace(tservice)
          << rust_sync_client_marker_trait_name(tservice) << " for " << impl_struct_name
-         << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << SYNC_CLIENT_GENERIC_BOUNDS << " {}" << endl;
+         << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << SYNC_CLIENT_GENERIC_BOUNDS << " {}" << '\n';
 
   t_service* extends = tservice->get_extends();
   if (extends) {
@@ -2090,64 +2089,64 @@
 
   // render the definition for the client struct
   f_gen_ << "pub struct " << client_impl_name << SYNC_CLIENT_GENERIC_BOUND_VARS << " "
-         << SYNC_CLIENT_GENERIC_BOUNDS << " {" << endl;
+         << SYNC_CLIENT_GENERIC_BOUNDS << " {" << '\n';
   indent_up();
-  f_gen_ << indent() << "_i_prot: IP," << endl;
-  f_gen_ << indent() << "_o_prot: OP," << endl;
-  f_gen_ << indent() << "_sequence_number: i32," << endl;
+  f_gen_ << indent() << "_i_prot: IP," << '\n';
+  f_gen_ << indent() << "_o_prot: OP," << '\n';
+  f_gen_ << indent() << "_sequence_number: i32," << '\n';
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 
   // render the struct implementation
   // this includes the new() function as well as the helper send/recv methods for each service call
   f_gen_ << "impl " << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << client_impl_name
-         << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << SYNC_CLIENT_GENERIC_BOUNDS << " {" << endl;
+         << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << SYNC_CLIENT_GENERIC_BOUNDS << " {" << '\n';
   indent_up();
   render_sync_client_lifecycle_functions(client_impl_name);
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_client_lifecycle_functions(const string& client_struct) {
   f_gen_ << indent() << "pub fn new(input_protocol: IP, output_protocol: OP) -> " << client_struct
-         << SYNC_CLIENT_GENERIC_BOUND_VARS << " {" << endl;
+         << SYNC_CLIENT_GENERIC_BOUND_VARS << " {" << '\n';
   indent_up();
 
   f_gen_ << indent() << client_struct
-         << " { _i_prot: input_protocol, _o_prot: output_protocol, _sequence_number: 0 }" << endl;
+         << " { _i_prot: input_protocol, _o_prot: output_protocol, _sequence_number: 0 }" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_sync_client_tthriftclient_impl(const string& client_impl_name) {
   f_gen_ << indent() << "impl " << SYNC_CLIENT_GENERIC_BOUND_VARS << " TThriftClient for "
          << client_impl_name << SYNC_CLIENT_GENERIC_BOUND_VARS << " " << SYNC_CLIENT_GENERIC_BOUNDS
-         << " {" << endl;
+         << " {" << '\n';
   indent_up();
 
   f_gen_ << indent() << "fn i_prot_mut(&mut self) -> &mut dyn TInputProtocol { &mut self._i_prot }"
-         << endl;
+         << '\n';
   f_gen_ << indent() << "fn o_prot_mut(&mut self) -> &mut dyn TOutputProtocol { &mut self._o_prot }"
-         << endl;
-  f_gen_ << indent() << "fn sequence_number(&self) -> i32 { self._sequence_number }" << endl;
+         << '\n';
+  f_gen_ << indent() << "fn sequence_number(&self) -> i32 { self._sequence_number }" << '\n';
   f_gen_ << indent()
          << "fn increment_sequence_number(&mut self) -> i32 { self._sequence_number += 1; "
             "self._sequence_number }"
-         << endl;
+         << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_client_process_impl(t_service* tservice) {
   string marker_extension = "" + sync_client_marker_traits_for_extension(tservice);
 
   f_gen_ << "impl <C: TThriftClient + " << rust_sync_client_marker_trait_name(tservice)
-         << marker_extension << "> " << rust_sync_client_trait_name(tservice) << " for C {" << endl;
+         << marker_extension << "> " << rust_sync_client_trait_name(tservice) << " for C {" << '\n';
   indent_up();
 
   const std::vector<t_function*> functions = tservice->get_functions();
@@ -2158,8 +2157,8 @@
   }
 
   indent_down();
-  f_gen_ << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 string t_rs_generator::sync_client_marker_traits_for_extension(t_service* tservice) {
@@ -2182,35 +2181,35 @@
   string func_return = to_rust_type(tfunc->get_returntype());
 
   f_gen_ << indent() << "fn " << func_name << func_decl_args << " -> thrift::Result<" << func_return
-         << "> {" << endl;
+         << "> {" << '\n';
   indent_up();
 
-  f_gen_ << indent() << "(" << endl;
+  f_gen_ << indent() << "(" << '\n';
   indent_up();
   render_sync_send(tfunc);
   indent_down();
-  f_gen_ << indent() << ")?;" << endl;
+  f_gen_ << indent() << ")?;" << '\n';
   if (tfunc->is_oneway()) {
-    f_gen_ << indent() << "Ok(())" << endl;
+    f_gen_ << indent() << "Ok(())" << '\n';
   } else {
     render_sync_recv(tfunc);
   }
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_sync_send(t_function* tfunc) {
-  f_gen_ << indent() << "{" << endl;
+  f_gen_ << indent() << "{" << '\n';
   indent_up();
 
   // increment the sequence number and generate the call header
   string message_type = tfunc->is_oneway() ? "TMessageType::OneWay" : "TMessageType::Call";
-  f_gen_ << indent() << "self.increment_sequence_number();" << endl;
+  f_gen_ << indent() << "self.increment_sequence_number();" << '\n';
   f_gen_ << indent() << "let message_ident = "
          << "TMessageIdentifier::new(\"" << tfunc->get_name() << "\", " // note: use *original* name
          << message_type << ", "
-         << "self.sequence_number());" << endl;
+         << "self.sequence_number());" << '\n';
   // pack the arguments into the containing struct that we'll write out over the wire
   // note that this struct is generated even if we have 0 args
   ostringstream struct_definition;
@@ -2226,50 +2225,50 @@
     struct_fields = struct_fields.substr(0, struct_fields.size() - 2); // strip trailing comma
   }
   f_gen_ << indent() << "let call_args = " << service_call_args_struct_name(tfunc) << " { "
-         << struct_fields << " };" << endl;
+         << struct_fields << " };" << '\n';
   // write everything over the wire
-  f_gen_ << indent() << "self.o_prot_mut().write_message_begin(&message_ident)?;" << endl;
+  f_gen_ << indent() << "self.o_prot_mut().write_message_begin(&message_ident)?;" << '\n';
   f_gen_ << indent() << "call_args.write_to_out_protocol(self.o_prot_mut())?;"
-         << endl; // written even if we have 0 args
-  f_gen_ << indent() << "self.o_prot_mut().write_message_end()?;" << endl;
-  f_gen_ << indent() << "self.o_prot_mut().flush()" << endl;
+         << '\n'; // written even if we have 0 args
+  f_gen_ << indent() << "self.o_prot_mut().write_message_end()?;" << '\n';
+  f_gen_ << indent() << "self.o_prot_mut().flush()" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_sync_recv(t_function* tfunc) {
-  f_gen_ << indent() << "{" << endl;
+  f_gen_ << indent() << "{" << '\n';
   indent_up();
 
-  f_gen_ << indent() << "let message_ident = self.i_prot_mut().read_message_begin()?;" << endl;
+  f_gen_ << indent() << "let message_ident = self.i_prot_mut().read_message_begin()?;" << '\n';
   f_gen_
       << indent()
       << "verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;"
-      << endl;
+      << '\n';
   f_gen_ << indent() << "verify_expected_service_call(\"" << tfunc->get_name()
-         << "\", &message_ident.name)?;" << endl; // note: use *original* name
+         << "\", &message_ident.name)?;" << '\n'; // note: use *original* name
   // FIXME: replace with a "try" block
-  f_gen_ << indent() << "if message_ident.message_type == TMessageType::Exception {" << endl;
+  f_gen_ << indent() << "if message_ident.message_type == TMessageType::Exception {" << '\n';
   indent_up();
   f_gen_ << indent()
          << "let remote_error = "
             "thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;"
-         << endl;
-  f_gen_ << indent() << "self.i_prot_mut().read_message_end()?;" << endl;
-  f_gen_ << indent() << "return Err(thrift::Error::Application(remote_error))" << endl;
+         << '\n';
+  f_gen_ << indent() << "self.i_prot_mut().read_message_end()?;" << '\n';
+  f_gen_ << indent() << "return Err(thrift::Error::Application(remote_error))" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   f_gen_ << indent()
          << "verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;"
-         << endl;
+         << '\n';
   f_gen_ << indent() << "let result = " << service_call_result_struct_name(tfunc)
-         << "::read_from_in_protocol(self.i_prot_mut())?;" << endl;
-  f_gen_ << indent() << "self.i_prot_mut().read_message_end()?;" << endl;
-  f_gen_ << indent() << "result.ok_or()" << endl;
+         << "::read_from_in_protocol(self.i_prot_mut())?;" << '\n';
+  f_gen_ << indent() << "self.i_prot_mut().read_message_end()?;" << '\n';
+  f_gen_ << indent() << "result.ok_or()" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 string t_rs_generator::rust_sync_service_call_declaration(t_function* tfunc, bool self_is_mutable) {
@@ -2400,7 +2399,7 @@
   std::vector<t_function*>::const_iterator func_iter;
 
   render_rustdoc((t_doc*)tservice);
-  f_gen_ << "pub trait " << rust_sync_handler_trait_name(tservice) << extension << " {" << endl;
+  f_gen_ << "pub trait " << rust_sync_handler_trait_name(tservice) << extension << " {" << '\n';
   indent_up();
   for (func_iter = functions.begin(); func_iter != functions.end(); ++func_iter) {
     t_function* tfunc = (*func_iter);
@@ -2409,11 +2408,11 @@
     string func_return = to_rust_type(tfunc->get_returntype());
     render_rustdoc((t_doc*)tfunc);
     f_gen_ << indent() << "fn " << func_name << func_args << " -> thrift::Result<" << func_return
-           << ">;" << endl;
+           << ">;" << '\n';
   }
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_processor_definition_and_impl(t_service* tservice) {
@@ -2422,36 +2421,36 @@
 
   // struct
   f_gen_ << indent() << "pub struct " << service_processor_name << "<H: " << handler_trait_name
-         << "> {" << endl;
+         << "> {" << '\n';
   indent_up();
-  f_gen_ << indent() << "handler: H," << endl;
+  f_gen_ << indent() << "handler: H," << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 
   // delegating impl
   f_gen_ << indent() << "impl <H: " << handler_trait_name << "> " << service_processor_name
-         << "<H> {" << endl;
+         << "<H> {" << '\n';
   indent_up();
-  f_gen_ << indent() << "pub fn new(handler: H) -> " << service_processor_name << "<H> {" << endl;
+  f_gen_ << indent() << "pub fn new(handler: H) -> " << service_processor_name << "<H> {" << '\n';
   indent_up();
-  f_gen_ << indent() << service_processor_name << " {" << endl;
+  f_gen_ << indent() << service_processor_name << " {" << '\n';
   indent_up();
-  f_gen_ << indent() << "handler," << endl;
+  f_gen_ << indent() << "handler," << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
   render_sync_process_delegation_functions(tservice);
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 
   // actual impl
   string service_actual_processor_name = rust_sync_processor_impl_name(tservice);
-  f_gen_ << indent() << "pub struct " << service_actual_processor_name << ";" << endl;
-  f_gen_ << endl;
-  f_gen_ << indent() << "impl " << service_actual_processor_name << " {" << endl;
+  f_gen_ << indent() << "pub struct " << service_actual_processor_name << ";" << '\n';
+  f_gen_ << '\n';
+  f_gen_ << indent() << "impl " << service_actual_processor_name << " {" << '\n';
   indent_up();
 
   vector<t_function*> functions = tservice->get_functions();
@@ -2462,44 +2461,44 @@
   }
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 
   // processor impl
   f_gen_ << indent() << "impl <H: " << handler_trait_name << "> TProcessor for "
-         << service_processor_name << "<H> {" << endl;
+         << service_processor_name << "<H> {" << '\n';
   indent_up();
 
   f_gen_ << indent()
          << "fn process(&self, i_prot: &mut dyn TInputProtocol, o_prot: &mut dyn TOutputProtocol) "
             "-> thrift::Result<()> {"
-         << endl;
+         << '\n';
   indent_up();
 
-  f_gen_ << indent() << "let message_ident = i_prot.read_message_begin()?;" << endl;
+  f_gen_ << indent() << "let message_ident = i_prot.read_message_begin()?;" << '\n';
 
   f_gen_ << indent() << "let res = match &*message_ident.name {"
-         << endl; // [sigh] explicit deref coercion
+         << '\n'; // [sigh] explicit deref coercion
   indent_up();
   render_process_match_statements(tservice);
-  f_gen_ << indent() << "method => {" << endl;
+  f_gen_ << indent() << "method => {" << '\n';
   indent_up();
   render_thrift_error("Application", "ApplicationError", "ApplicationErrorKind::UnknownMethod",
                       "format!(\"unknown method {}\", method)");
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
 
   indent_down();
-  f_gen_ << indent() << "};" << endl;
+  f_gen_ << indent() << "};" << '\n';
   f_gen_ << indent() << "thrift::server::handle_process_result(&message_ident, res, o_prot)"
-         << endl;
+         << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
-  f_gen_ << endl;
+  f_gen_ << indent() << "}" << '\n';
+  f_gen_ << '\n';
 }
 
 void t_rs_generator::render_sync_process_delegation_functions(t_service* tservice) {
@@ -2514,7 +2513,7 @@
            << "incoming_sequence_number: i32, "
            << "i_prot: &mut dyn TInputProtocol, "
            << "o_prot: &mut dyn TOutputProtocol) "
-           << "-> thrift::Result<()> {" << endl;
+           << "-> thrift::Result<()> {" << '\n';
     indent_up();
 
     f_gen_ << indent() << actual_processor << "::" << function_name << "("
@@ -2522,10 +2521,10 @@
            << "incoming_sequence_number, "
            << "i_prot, "
            << "o_prot"
-           << ")" << endl;
+           << ")" << '\n';
 
     indent_down();
-    f_gen_ << indent() << "}" << endl;
+    f_gen_ << indent() << "}" << '\n';
   }
 
   t_service* extends = tservice->get_extends();
@@ -2540,12 +2539,12 @@
   for (func_iter = functions.begin(); func_iter != functions.end(); ++func_iter) {
     t_function* tfunc = (*func_iter);
     f_gen_ << indent() << "\"" << tfunc->get_name() << "\""
-           << " => {" << endl; // note: use *original* name
+           << " => {" << '\n'; // note: use *original* name
     indent_up();
     f_gen_ << indent() << "self.process_" << rust_snake_case(tfunc->get_name())
-           << "(message_ident.sequence_number, i_prot, o_prot)" << endl;
+           << "(message_ident.sequence_number, i_prot, o_prot)" << '\n';
     indent_down();
-    f_gen_ << indent() << "}," << endl;
+    f_gen_ << indent() << "}," << '\n';
   }
 
   t_service* extends = tservice->get_extends();
@@ -2568,90 +2567,90 @@
          << "(handler: &H, " << sequence_number_param << ": i32, "
          << "i_prot: &mut dyn TInputProtocol, " << output_protocol_param
          << ": &mut dyn TOutputProtocol) "
-         << "-> thrift::Result<()> {" << endl;
+         << "-> thrift::Result<()> {" << '\n';
 
   indent_up();
 
   // *always* read arguments from the input protocol
   f_gen_ << indent() << "let " << (has_non_void_args(tfunc) ? "args" : "_") << " = "
-         << service_call_args_struct_name(tfunc) << "::read_from_in_protocol(i_prot)?;" << endl;
+         << service_call_args_struct_name(tfunc) << "::read_from_in_protocol(i_prot)?;" << '\n';
 
   f_gen_ << indent() << "match handler." << service_call_handler_function_name(tfunc)
-         << rust_sync_service_call_invocation(tfunc, "args.") << " {" << endl; // start match
+         << rust_sync_service_call_invocation(tfunc, "args.") << " {" << '\n'; // start match
   indent_up();
 
   // handler succeeded
   string handler_return_variable
       = tfunc->is_oneway() || tfunc->get_returntype()->is_void() ? "_" : "handler_return";
-  f_gen_ << indent() << "Ok(" << handler_return_variable << ") => {" << endl;
+  f_gen_ << indent() << "Ok(" << handler_return_variable << ") => {" << '\n';
   indent_up();
   render_sync_handler_succeeded(tfunc);
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
   // handler failed
-  f_gen_ << indent() << "Err(e) => {" << endl;
+  f_gen_ << indent() << "Err(e) => {" << '\n';
   indent_up();
   render_sync_handler_failed(tfunc);
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl; // end match
+  f_gen_ << indent() << "}" << '\n'; // end match
 
   indent_down();
-  f_gen_ << indent() << "}" << endl; // end function
+  f_gen_ << indent() << "}" << '\n'; // end function
 }
 
 void t_rs_generator::render_sync_handler_succeeded(t_function* tfunc) {
   if (tfunc->is_oneway()) {
-    f_gen_ << indent() << "Ok(())" << endl;
+    f_gen_ << indent() << "Ok(())" << '\n';
   } else {
     f_gen_ << indent() << "let message_ident = TMessageIdentifier::new("
            << "\"" << tfunc->get_name() << "\", " // note: use *original* name
            << "TMessageType::Reply, "
-           << "incoming_sequence_number);" << endl;
-    f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << endl;
-    f_gen_ << indent() << "let ret = " << handler_successful_return_struct(tfunc) << ";" << endl;
-    f_gen_ << indent() << "ret.write_to_out_protocol(o_prot)?;" << endl;
-    f_gen_ << indent() << "o_prot.write_message_end()?;" << endl;
-    f_gen_ << indent() << "o_prot.flush()" << endl;
+           << "incoming_sequence_number);" << '\n';
+    f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << '\n';
+    f_gen_ << indent() << "let ret = " << handler_successful_return_struct(tfunc) << ";" << '\n';
+    f_gen_ << indent() << "ret.write_to_out_protocol(o_prot)?;" << '\n';
+    f_gen_ << indent() << "o_prot.write_message_end()?;" << '\n';
+    f_gen_ << indent() << "o_prot.flush()" << '\n';
   }
 }
 
 void t_rs_generator::render_sync_handler_failed(t_function* tfunc) {
   string err_var("e");
 
-  f_gen_ << indent() << "match " << err_var << " {" << endl;
+  f_gen_ << indent() << "match " << err_var << " {" << '\n';
   indent_up();
 
   // if there are any user-defined exceptions for this service call handle them first
   if (tfunc->get_xceptions() != nullptr
       && tfunc->get_xceptions()->get_sorted_members().size() > 0) {
     string user_err_var("usr_err");
-    f_gen_ << indent() << "thrift::Error::User(" << user_err_var << ") => {" << endl;
+    f_gen_ << indent() << "thrift::Error::User(" << user_err_var << ") => {" << '\n';
     indent_up();
     render_sync_handler_failed_user_exception_branch(tfunc);
     indent_down();
-    f_gen_ << indent() << "}," << endl;
+    f_gen_ << indent() << "}," << '\n';
   }
 
   // application error
   string app_err_var("app_err");
-  f_gen_ << indent() << "thrift::Error::Application(" << app_err_var << ") => {" << endl;
+  f_gen_ << indent() << "thrift::Error::Application(" << app_err_var << ") => {" << '\n';
   indent_up();
   render_sync_handler_failed_application_exception_branch(tfunc, app_err_var);
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
 
   // default case
-  f_gen_ << indent() << "_ => {" << endl;
+  f_gen_ << indent() << "_ => {" << '\n';
   indent_up();
   render_sync_handler_failed_default_exception_branch(tfunc);
   indent_down();
-  f_gen_ << indent() << "}," << endl;
+  f_gen_ << indent() << "}," << '\n';
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_sync_handler_failed_user_exception_branch(t_function* tfunc) {
@@ -2670,11 +2669,11 @@
     string if_statement(branches_rendered == 0 ? "if usr_err" : "} else if usr_err");
     string exception_type(to_rust_type(xception_field->get_type()));
     f_gen_ << indent() << if_statement << ".downcast_ref::<" << exception_type << ">().is_some() {"
-           << endl;
+           << '\n';
     indent_up();
 
     f_gen_ << indent() << "let err = usr_err.downcast::<" << exception_type
-           << ">().expect(\"downcast already checked\");" << endl;
+           << ">().expect(\"downcast already checked\");" << '\n';
 
     // render the members of the return struct
     ostringstream members;
@@ -2701,17 +2700,17 @@
 
     // now write out the return struct
     f_gen_ << indent() << "let ret_err = " << service_call_result_struct_name(tfunc) << "{ "
-           << member_string << "};" << endl;
+           << member_string << "};" << '\n';
 
     f_gen_ << indent() << "let message_ident = "
            << "TMessageIdentifier::new("
            << "\"" << tfunc->get_name() << "\", " // note: use *original* name
            << "TMessageType::Reply, "
-           << "incoming_sequence_number);" << endl;
-    f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << endl;
-    f_gen_ << indent() << "ret_err.write_to_out_protocol(o_prot)?;" << endl;
-    f_gen_ << indent() << "o_prot.write_message_end()?;" << endl;
-    f_gen_ << indent() << "o_prot.flush()" << endl;
+           << "incoming_sequence_number);" << '\n';
+    f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << '\n';
+    f_gen_ << indent() << "ret_err.write_to_out_protocol(o_prot)?;" << '\n';
+    f_gen_ << indent() << "o_prot.write_message_end()?;" << '\n';
+    f_gen_ << indent() << "o_prot.flush()" << '\n';
 
     indent_down();
 
@@ -2719,41 +2718,41 @@
   }
 
   // the catch all, if somehow it was a user exception that we don't support
-  f_gen_ << indent() << "} else {" << endl;
+  f_gen_ << indent() << "} else {" << '\n';
   indent_up();
 
   // FIXME: same as default block below
 
-  f_gen_ << indent() << "let ret_err = {" << endl;
+  f_gen_ << indent() << "let ret_err = {" << '\n';
   indent_up();
   render_thrift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown",
                              "usr_err.to_string()");
   indent_down();
-  f_gen_ << indent() << "};" << endl;
+  f_gen_ << indent() << "};" << '\n';
   render_sync_handler_send_exception_response(tfunc, "ret_err");
 
   indent_down();
-  f_gen_ << indent() << "}" << endl;
+  f_gen_ << indent() << "}" << '\n';
 }
 
 void t_rs_generator::render_sync_handler_failed_application_exception_branch(
     t_function* tfunc,
     const string& app_err_var) {
   if (tfunc->is_oneway()) {
-    f_gen_ << indent() << "Err(thrift::Error::Application(" << app_err_var << "))" << endl;
+    f_gen_ << indent() << "Err(thrift::Error::Application(" << app_err_var << "))" << '\n';
   } else {
     render_sync_handler_send_exception_response(tfunc, app_err_var);
   }
 }
 
 void t_rs_generator::render_sync_handler_failed_default_exception_branch(t_function* tfunc) {
-  f_gen_ << indent() << "let ret_err = {" << endl;
+  f_gen_ << indent() << "let ret_err = {" << '\n';
   indent_up();
   render_thrift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown", "e.to_string()");
   indent_down();
-  f_gen_ << indent() << "};" << endl;
+  f_gen_ << indent() << "};" << '\n';
   if (tfunc->is_oneway()) {
-    f_gen_ << indent() << "Err(thrift::Error::Application(ret_err))" << endl;
+    f_gen_ << indent() << "Err(thrift::Error::Application(ret_err))" << '\n';
   } else {
     render_sync_handler_send_exception_response(tfunc, "ret_err");
   }
@@ -2764,12 +2763,12 @@
   f_gen_ << indent() << "let message_ident = TMessageIdentifier::new("
          << "\"" << tfunc->get_name() << "\", " // note: use *original* name
          << "TMessageType::Exception, "
-         << "incoming_sequence_number);" << endl;
-  f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << endl;
+         << "incoming_sequence_number);" << '\n';
+  f_gen_ << indent() << "o_prot.write_message_begin(&message_ident)?;" << '\n';
   f_gen_ << indent() << "thrift::Error::write_application_error_to_out_protocol(&" << err_var
-         << ", o_prot)?;" << endl;
-  f_gen_ << indent() << "o_prot.write_message_end()?;" << endl;
-  f_gen_ << indent() << "o_prot.flush()" << endl;
+         << ", o_prot)?;" << '\n';
+  f_gen_ << indent() << "o_prot.write_message_end()?;" << '\n';
+  f_gen_ << indent() << "o_prot.flush()" << '\n';
 }
 
 string t_rs_generator::handler_successful_return_struct(t_function* tfunc) {
@@ -2811,10 +2810,10 @@
 //-----------------------------------------------------------------------------
 
 void t_rs_generator::render_type_comment(const string& type_name) {
-  f_gen_ << "//" << endl;
-  f_gen_ << "// " << type_name << endl;
-  f_gen_ << "//" << endl;
-  f_gen_ << endl;
+  f_gen_ << "//" << '\n';
+  f_gen_ << "// " << type_name << '\n';
+  f_gen_ << "//" << '\n';
+  f_gen_ << '\n';
 }
 
 // NOTE: do *not* put in an extra newline after doc is generated.
@@ -2831,26 +2830,26 @@
                                          const string& error_struct,
                                          const string& sub_error_kind,
                                          const string& error_message) {
-  f_gen_ << indent() << "Err(" << endl;
+  f_gen_ << indent() << "Err(" << '\n';
   indent_up();
-  f_gen_ << indent() << "thrift::Error::" << error_kind << "(" << endl;
+  f_gen_ << indent() << "thrift::Error::" << error_kind << "(" << '\n';
   indent_up();
   render_thrift_error_struct(error_struct, sub_error_kind, error_message);
   indent_down();
-  f_gen_ << indent() << ")" << endl;
+  f_gen_ << indent() << ")" << '\n';
   indent_down();
-  f_gen_ << indent() << ")" << endl;
+  f_gen_ << indent() << ")" << '\n';
 }
 
 void t_rs_generator::render_thrift_error_struct(const string& error_struct,
                                                 const string& sub_error_kind,
                                                 const string& error_message) {
-  f_gen_ << indent() << error_struct << "::new(" << endl;
+  f_gen_ << indent() << error_struct << "::new(" << '\n';
   indent_up();
-  f_gen_ << indent() << sub_error_kind << "," << endl;
-  f_gen_ << indent() << error_message << endl;
+  f_gen_ << indent() << sub_error_kind << "," << '\n';
+  f_gen_ << indent() << error_message << '\n';
   indent_down();
-  f_gen_ << indent() << ")" << endl;
+  f_gen_ << indent() << ")" << '\n';
 }
 
 bool t_rs_generator::is_double(t_type* ttype) {
diff --git a/compiler/cpp/src/thrift/generate/t_st_generator.cc b/compiler/cpp/src/thrift/generate/t_st_generator.cc
index b141186..c1ad355 100644
--- a/compiler/cpp/src/thrift/generate/t_st_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_st_generator.cc
@@ -43,8 +43,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Smalltalk code generator.
  *
@@ -177,7 +175,7 @@
   f_.open(f_name.c_str());
 
   // Print header
-  f_ << st_autogen_comment() << endl;
+  f_ << st_autogen_comment() << '\n';
 
   st_class_def(f_, program_name_);
   generate_class_side_definition();
@@ -219,10 +217,10 @@
 
 void t_st_generator::generate_force_consts() {
   f_ << prefix(class_name()) << " enums keysAndValuesDo: [:k :v | " << prefix(class_name())
-     << " enums at: k put: v value].!" << endl;
+     << " enums at: k put: v value].!" << '\n';
 
   f_ << prefix(class_name()) << " constants keysAndValuesDo: [:k :v | " << prefix(class_name())
-     << " constants at: k put: v value].!" << endl;
+     << " constants at: k put: v value].!" << '\n';
 }
 
 void t_st_generator::close_generator() {
@@ -252,11 +250,11 @@
 }
 
 void t_st_generator::st_class_def(std::ostream& out, string name) {
-  out << "Object subclass: #" << prefix(name) << endl;
+  out << "Object subclass: #" << prefix(name) << '\n';
   indent_up();
-  out << indent() << "instanceVariableNames: ''" << endl << indent() << "classVariableNames: ''"
-      << endl << indent() << "poolDictionaries: ''" << endl << indent() << "category: '"
-      << generated_category() << "'!" << endl << endl;
+  out << indent() << "instanceVariableNames: ''" << '\n' << indent() << "classVariableNames: ''"
+      << '\n' << indent() << "poolDictionaries: ''" << '\n' << indent() << "category: '"
+      << generated_category() << "'!" << '\n' << '\n';
 }
 
 void t_st_generator::st_method(std::ostream& out, string cls, string name) {
@@ -281,14 +279,14 @@
   strftime(timestr, 50, "%m/%d/%Y %H:%M", tinfo);
 
   out << "!" << prefix(cls) << " methodsFor: '" + category + "' stamp: 'thrift " << timestr
-      << "'!\n" << name << endl;
+      << "'!\n" << name << '\n';
 
   indent_up();
   out << indent();
 }
 
 void t_st_generator::st_close_method(std::ostream& out) {
-  out << "! !" << endl << endl;
+  out << "! !" << '\n' << '\n';
   indent_down();
 }
 
@@ -316,16 +314,16 @@
 }
 
 void t_st_generator::generate_class_side_definition() {
-  f_ << prefix(class_name()) << " class" << endl << "\tinstanceVariableNames: 'constants enums'!"
-     << endl << endl;
+  f_ << prefix(class_name()) << " class" << '\n' << "\tinstanceVariableNames: 'constants enums'!"
+     << '\n' << '\n';
 
   st_accessors(f_, class_name() + " class", "enums");
   st_accessors(f_, class_name() + " class", "constants");
 
-  f_ << prefix(class_name()) << " enums: Dictionary new!" << endl;
-  f_ << prefix(class_name()) << " constants: Dictionary new!" << endl;
+  f_ << prefix(class_name()) << " enums: Dictionary new!" << '\n';
+  f_ << prefix(class_name()) << " constants: Dictionary new!" << '\n';
 
-  f_ << endl;
+  f_ << '\n';
 }
 
 /**
@@ -338,16 +336,16 @@
   string cls_name = program_name_ + capitalize(tenum->get_name());
 
   f_ << prefix(class_name()) << " enums at: '" << tenum->get_name() << "' put: ["
-     << "(Dictionary new " << endl;
+     << "(Dictionary new " << '\n';
 
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     int value = (*c_iter)->get_value();
-    f_ << "\tat: '" << (*c_iter)->get_name() << "' put: " << value << ";" << endl;
+    f_ << "\tat: '" << (*c_iter)->get_name() << "' put: " << value << ";" << '\n';
   }
 
-  f_ << "\tyourself)]!" << endl << endl;
+  f_ << "\tyourself)]!" << '\n' << '\n';
 }
 
 /**
@@ -359,7 +357,7 @@
   t_const_value* value = tconst->get_value();
 
   f_ << prefix(class_name()) << " constants at: '" << name << "' put: ["
-     << render_const_value(type, value) << "]!" << endl << endl;
+     << render_const_value(type, value) << "]!" << '\n' << '\n';
 }
 
 /**
@@ -398,7 +396,7 @@
   } else if (type->is_enum()) {
     indent(out) << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << "(" << capitalize(type->get_name()) << " new " << endl;
+    out << "(" << capitalize(type->get_name()) << " new " << '\n';
     indent_up();
 
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
@@ -418,7 +416,7 @@
       }
 
       out << indent() << v_iter->first->get_string() << ": "
-          << render_const_value(field_type, v_iter->second) << ";" << endl;
+          << render_const_value(field_type, v_iter->second) << ";" << '\n';
     }
     out << indent() << "yourself)";
 
@@ -426,7 +424,7 @@
   } else if (type->is_map()) {
     t_type* ktype = ((t_map*)type)->get_key_type();
     t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "(Dictionary new" << endl;
+    out << "(Dictionary new" << '\n';
     indent_up();
     indent_up();
     const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
@@ -436,7 +434,7 @@
       out << "at: " << render_const_value(ktype, v_iter->first);
       out << " put: ";
       out << render_const_value(vtype, v_iter->second);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
     out << indent() << indent() << "yourself)";
     indent_down();
@@ -449,9 +447,9 @@
       etype = ((t_set*)type)->get_elem_type();
     }
     if (type->is_set()) {
-      out << "(Set new" << endl;
+      out << "(Set new" << '\n';
     } else {
-      out << "(OrderedCollection new" << endl;
+      out << "(OrderedCollection new" << '\n';
     }
     indent_up();
     indent_up();
@@ -460,7 +458,7 @@
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
       out << indent() << indent();
       out << "add: " << render_const_value(etype, *v_iter);
-      out << ";" << endl;
+      out << ";" << '\n';
     }
     out << indent() << indent() << "yourself)";
     indent_down();
@@ -502,7 +500,7 @@
   else
     out << "Object";
 
-  out << " subclass: #" << prefix(type_name(tstruct)) << endl << "\tinstanceVariableNames: '";
+  out << " subclass: #" << prefix(type_name(tstruct)) << '\n' << "\tinstanceVariableNames: '";
 
   if (members.size() > 0) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -556,7 +554,7 @@
                    camelcase((*m_iter)->get_name()),
                    a_type((*m_iter)->get_type()));
     }
-    out << endl;
+    out << '\n';
   }
 }
 
@@ -583,17 +581,17 @@
 
   out << "[oprot writeMapBegin: (TMap new keyType: " << type_to_enum(tmap->get_key_type())
       << "; valueType: " << type_to_enum(tmap->get_val_type()) << "; size: " << fname << " size)."
-      << endl;
+      << '\n';
   indent_up();
 
-  out << indent() << fname << " keysAndValuesDo: [:" << key << " :" << val << " |" << endl;
+  out << indent() << fname << " keysAndValuesDo: [:" << key << " :" << val << " |" << '\n';
   indent_up();
 
-  out << indent() << write_val(tmap->get_key_type(), key) << "." << endl << indent()
+  out << indent() << write_val(tmap->get_key_type(), key) << "." << '\n' << indent()
       << write_val(tmap->get_val_type(), val);
   indent_down();
 
-  out << "]." << endl << indent() << "oprot writeMapEnd] value";
+  out << "]." << '\n' << indent() << "oprot writeMapEnd] value";
   indent_down();
 
   return out.str();
@@ -604,18 +602,18 @@
   string desc = temp_name();
   string val = temp_name();
 
-  out << "[|" << desc << " " << val << "| " << endl;
+  out << "[|" << desc << " " << val << "| " << '\n';
   indent_up();
 
-  out << indent() << desc << " := iprot readMapBegin." << endl << indent() << val
-      << " := Dictionary new." << endl << indent() << desc << " size timesRepeat: [" << endl;
+  out << indent() << desc << " := iprot readMapBegin." << '\n' << indent() << val
+      << " := Dictionary new." << '\n' << indent() << desc << " size timesRepeat: [" << '\n';
 
   indent_up();
   out << indent() << val << " at: " << read_val(tmap->get_key_type())
       << " put: " << read_val(tmap->get_val_type());
   indent_down();
 
-  out << "]." << endl << indent() << "iprot readMapEnd." << endl << indent() << val << "] value";
+  out << "]." << '\n' << indent() << "iprot readMapEnd." << '\n' << indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -626,16 +624,16 @@
   string val = temp_name();
 
   out << "[oprot writeListBegin: (TList new elemType: " << type_to_enum(tlist->get_elem_type())
-      << "; size: " << fname << " size)." << endl;
+      << "; size: " << fname << " size)." << '\n';
   indent_up();
 
-  out << indent() << fname << " do: [:" << val << "|" << endl;
+  out << indent() << fname << " do: [:" << val << "|" << '\n';
   indent_up();
 
-  out << indent() << write_val(tlist->get_elem_type(), val) << endl;
+  out << indent() << write_val(tlist->get_elem_type(), val) << '\n';
   indent_down();
 
-  out << "]." << endl << indent() << "oprot writeListEnd] value";
+  out << "]." << '\n' << indent() << "oprot writeListEnd] value";
   indent_down();
 
   return out.str();
@@ -646,17 +644,17 @@
   string desc = temp_name();
   string val = temp_name();
 
-  out << "[|" << desc << " " << val << "| " << desc << " := iprot readListBegin." << endl;
+  out << "[|" << desc << " " << val << "| " << desc << " := iprot readListBegin." << '\n';
   indent_up();
 
-  out << indent() << val << " := OrderedCollection new." << endl << indent() << desc
-      << " size timesRepeat: [" << endl;
+  out << indent() << val << " := OrderedCollection new." << '\n' << indent() << desc
+      << " size timesRepeat: [" << '\n';
 
   indent_up();
   out << indent() << val << " add: " << read_val(tlist->get_elem_type());
   indent_down();
 
-  out << "]." << endl << indent() << "iprot readListEnd." << endl << indent() << val << "] value";
+  out << "]." << '\n' << indent() << "iprot readListEnd." << '\n' << indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -667,16 +665,16 @@
   string val = temp_name();
 
   out << "[oprot writeSetBegin: (TSet new elemType: " << type_to_enum(tset->get_elem_type())
-      << "; size: " << fname << " size)." << endl;
+      << "; size: " << fname << " size)." << '\n';
   indent_up();
 
-  out << indent() << fname << " do: [:" << val << "|" << endl;
+  out << indent() << fname << " do: [:" << val << "|" << '\n';
   indent_up();
 
-  out << indent() << write_val(tset->get_elem_type(), val) << endl;
+  out << indent() << write_val(tset->get_elem_type(), val) << '\n';
   indent_down();
 
-  out << "]." << endl << indent() << "oprot writeSetEnd] value";
+  out << "]." << '\n' << indent() << "oprot writeSetEnd] value";
   indent_down();
 
   return out.str();
@@ -687,17 +685,17 @@
   string desc = temp_name();
   string val = temp_name();
 
-  out << "[|" << desc << " " << val << "| " << desc << " := iprot readSetBegin." << endl;
+  out << "[|" << desc << " " << val << "| " << desc << " := iprot readSetBegin." << '\n';
   indent_up();
 
-  out << indent() << val << " := Set new." << endl << indent() << desc << " size timesRepeat: ["
-      << endl;
+  out << indent() << val << " := Set new." << '\n' << indent() << desc << " size timesRepeat: ["
+      << '\n';
 
   indent_up();
   out << indent() << val << " add: " << read_val(tset->get_elem_type());
   indent_down();
 
-  out << "]." << endl << indent() << "iprot readSetEnd." << endl << indent() << val << "] value";
+  out << "]." << '\n' << indent() << "iprot readSetEnd." << '\n' << indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -709,7 +707,7 @@
   vector<t_field*>::const_iterator fld_iter;
 
   out << "[oprot writeStructBegin: "
-      << "(TStruct new name: '" + tstruct->get_name() + "')." << endl;
+      << "(TStruct new name: '" + tstruct->get_name() + "')." << '\n';
   indent_up();
 
   for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
@@ -718,15 +716,15 @@
     string accessor = sname + " " + camelcase(fname);
 
     if (optional) {
-      out << indent() << accessor << " ifNotNil: [" << endl;
+      out << indent() << accessor << " ifNotNil: [" << '\n';
       indent_up();
     }
 
     out << indent() << "oprot writeFieldBegin: (TField new name: '" << fname
         << "'; type: " << type_to_enum((*fld_iter)->get_type())
-        << "; id: " << (*fld_iter)->get_key() << ")." << endl;
+        << "; id: " << (*fld_iter)->get_key() << ")." << '\n';
 
-    out << indent() << write_val((*fld_iter)->get_type(), accessor) << "." << endl << indent()
+    out << indent() << write_val((*fld_iter)->get_type(), accessor) << "." << '\n' << indent()
         << "oprot writeFieldEnd";
 
     if (optional) {
@@ -734,7 +732,7 @@
       indent_down();
     }
 
-    out << "." << endl;
+    out << "." << '\n';
   }
 
   out << indent() << "oprot writeFieldStop; writeStructEnd] value";
@@ -755,33 +753,33 @@
     clsName = tstruct->get_name();
   }
 
-  out << "[|" << desc << " " << val << "|" << endl;
+  out << "[|" << desc << " " << val << "|" << '\n';
   indent_up();
 
   // This is nasty, but without it we'll break things by prefixing TResult.
   string name = ((capitalize(clsName) == "TResult") ? capitalize(clsName) : prefix(clsName));
-  out << indent() << val << " := " << name << " new." << endl;
+  out << indent() << val << " := " << name << " new." << '\n';
 
-  out << indent() << "iprot readStructBegin." << endl << indent() << "[" << desc
-      << " := iprot readFieldBegin." << endl << indent() << desc
-      << " type = TType stop] whileFalse: [|" << found << "|" << endl;
+  out << indent() << "iprot readStructBegin." << '\n' << indent() << "[" << desc
+      << " := iprot readFieldBegin." << '\n' << indent() << desc
+      << " type = TType stop] whileFalse: [|" << found << "|" << '\n';
   indent_up();
 
   for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    out << indent() << desc << " id = " << (*fld_iter)->get_key() << " ifTrue: [" << endl;
+    out << indent() << desc << " id = " << (*fld_iter)->get_key() << " ifTrue: [" << '\n';
     indent_up();
 
-    out << indent() << found << " := true." << endl << indent() << val << " "
+    out << indent() << found << " := true." << '\n' << indent() << val << " "
         << camelcase((*fld_iter)->get_name()) << ": " << read_val((*fld_iter)->get_type());
     indent_down();
 
-    out << "]." << endl;
+    out << "]." << '\n';
   }
 
-  out << indent() << found << " ifNil: [iprot skip: " << desc << " type]]." << endl;
+  out << indent() << found << " ifNil: [iprot skip: " << desc << " type]]." << '\n';
   indent_down();
 
-  out << indent() << "oprot readStructEnd." << endl << indent() << val << "] value";
+  out << indent() << "oprot readStructEnd." << '\n' << indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -847,32 +845,32 @@
   vector<t_field*>::const_iterator fld_iter;
 
   st_method(f_, client_class_name(), "send" + capitalize(signature));
-  f_ << "oprot writeMessageBegin:" << endl;
+  f_ << "oprot writeMessageBegin:" << '\n';
   indent_up();
 
-  f_ << indent() << "(TCallMessage new" << endl;
+  f_ << indent() << "(TCallMessage new" << '\n';
   indent_up();
 
-  f_ << indent() << "name: '" << funname << "'; " << endl << indent() << "seqid: self nextSeqid)."
-     << endl;
+  f_ << indent() << "name: '" << funname << "'; " << '\n' << indent() << "seqid: self nextSeqid)."
+     << '\n';
   indent_down();
   indent_down();
 
   f_ << indent() << "oprot writeStructBegin: "
-     << "(TStruct new name: '" + capitalize(camelcase(funname)) + "_args')." << endl;
+     << "(TStruct new name: '" + capitalize(camelcase(funname)) + "_args')." << '\n';
 
   for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
     string fname = camelcase((*fld_iter)->get_name());
 
     f_ << indent() << "oprot writeFieldBegin: (TField new name: '" << fname
        << "'; type: " << type_to_enum((*fld_iter)->get_type()) << "; id: " << (*fld_iter)->get_key()
-       << ")." << endl;
+       << ")." << '\n';
 
-    f_ << indent() << write_val((*fld_iter)->get_type(), fname) << "." << endl << indent()
-       << "oprot writeFieldEnd." << endl;
+    f_ << indent() << write_val((*fld_iter)->get_type(), fname) << "." << '\n' << indent()
+       << "oprot writeFieldEnd." << '\n';
   }
 
-  f_ << indent() << "oprot writeFieldStop; writeStructEnd; writeMessageEnd." << endl;
+  f_ << indent() << "oprot writeFieldStop; writeStructEnd; writeMessageEnd." << '\n';
   f_ << indent() << "oprot transport flush";
 
   st_close_method(f_);
@@ -897,11 +895,11 @@
   }
 
   st_method(f_, client_class_name(), "recv" + capitalize(funname));
-  f_ << "| f msg res | " << endl << indent() << "msg := oprot readMessageBegin." << endl << indent()
-     << "self validateRemoteMessage: msg." << endl << indent()
-     << "res := " << struct_reader(&result) << "." << endl << indent() << "oprot readMessageEnd."
-     << endl << indent() << "oprot transport flush." << endl << indent()
-     << "res exception ifNotNil: [res exception signal]." << endl << indent() << "^ res";
+  f_ << "| f msg res | " << '\n' << indent() << "msg := oprot readMessageBegin." << '\n' << indent()
+     << "self validateRemoteMessage: msg." << '\n' << indent()
+     << "res := " << struct_reader(&result) << "." << '\n' << indent() << "oprot readMessageEnd."
+     << '\n' << indent() << "oprot transport flush." << '\n' << indent()
+     << "res exception ifNotNil: [res exception signal]." << '\n' << indent() << "^ res";
   st_close_method(f_);
 }
 
@@ -940,7 +938,7 @@
     extends_client = extends + "Client";
   }
 
-  f_ << extends_client << " subclass: #" << prefix(client_class_name()) << endl
+  f_ << extends_client << " subclass: #" << prefix(client_class_name()) << '\n'
      << "\tinstanceVariableNames: ''\n"
      << "\tclassVariableNames: ''\n"
      << "\tpoolDictionaries: ''\n"
@@ -951,11 +949,11 @@
     string signature = function_signature(*f_iter);
 
     st_method(f_, client_class_name(), signature);
-    f_ << function_types_comment(*f_iter) << endl << indent() << "self send"
-       << capitalize(signature) << "." << endl;
+    f_ << function_types_comment(*f_iter) << '\n' << indent() << "self send"
+       << capitalize(signature) << "." << '\n';
 
     if (!(*f_iter)->is_oneway()) {
-      f_ << indent() << "^ self recv" << capitalize(funname) << " success " << endl;
+      f_ << indent() << "^ self recv" << capitalize(funname) << " success " << '\n';
     }
 
     st_close_method(f_);
diff --git a/compiler/cpp/src/thrift/generate/t_swift_generator.cc b/compiler/cpp/src/thrift/generate/t_swift_generator.cc
index fab1413..98b19ec 100644
--- a/compiler/cpp/src/thrift/generate/t_swift_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_swift_generator.cc
@@ -37,8 +37,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * Swift 3 code generator.
  *
@@ -51,7 +49,7 @@
                     const string& option_string)
     : t_oop_generator(program) {
     update_keywords_for_validation();
-    
+
     (void)option_string;
     map<string, string>::const_iterator iter;
 
@@ -226,14 +224,14 @@
 private:
 
   void block_open(ostream& out) {
-    out << " {" << endl;
+    out << " {" << '\n';
     indent_up();
   }
 
   void block_close(ostream& out, bool end_line=true) {
     indent_down();
     indent(out) << "}";
-    if (end_line) out << endl;
+    if (end_line) out << '\n';
   }
 
   bool field_is_optional(t_field* tfield) {
@@ -320,18 +318,18 @@
   string f_decl_fullname = module_path + "/" + f_decl_name;
   f_decl_.open(f_decl_fullname.c_str());
 
-  f_decl_ << autogen_comment() << endl;
+  f_decl_ << autogen_comment() << '\n';
 
-  f_decl_ << swift_imports() << swift_thrift_imports() << endl;
+  f_decl_ << swift_imports() << swift_thrift_imports() << '\n';
 
   // ...and a .swift implementation extensions file
   string f_impl_name = name + "+Exts.swift";
   string f_impl_fullname = module_path + "/" + f_impl_name;
   f_impl_.open(f_impl_fullname.c_str());
 
-  f_impl_ << autogen_comment() << endl;
+  f_impl_ << autogen_comment() << '\n';
 
-  f_impl_ << swift_imports() << swift_thrift_imports() << endl;
+  f_impl_ << swift_imports() << swift_thrift_imports() << '\n';
 
 }
 
@@ -349,16 +347,16 @@
 
   vector<string>::const_iterator i_iter;
   for (i_iter=includes_list.begin(); i_iter!=includes_list.end(); ++i_iter) {
-    includes << "import " << *i_iter << endl;
+    includes << "import " << *i_iter << '\n';
   }
 
   if (namespaced_) {
     const vector<t_program*>& program_includes = program_->get_includes();
     for (auto program_include : program_includes) {
-      includes << ("import " + get_real_swift_module(program_include)) << endl;
+      includes << ("import " + get_real_swift_module(program_include)) << '\n';
     }
   }
-  includes << endl;
+  includes << '\n';
 
   return includes.str();
 }
@@ -381,10 +379,10 @@
 
   vector<string>::const_iterator i_iter;
   for (i_iter=includes_list.begin(); i_iter!=includes_list.end(); ++i_iter) {
-    includes << "import " << *i_iter << endl;
+    includes << "import " << *i_iter << '\n';
   }
 
-  includes << endl;
+  includes << '\n';
 
   return includes.str();
 }
@@ -395,7 +393,7 @@
 void t_swift_generator::close_generator() {
   // stick our constants declarations at the end of the header file
   // since they refer to things we are defining.
-  f_decl_ << constants_declarations_ << endl;
+  f_decl_ << constants_declarations_ << '\n';
 }
 
 /**
@@ -405,8 +403,8 @@
  */
 void t_swift_generator::generate_typedef(t_typedef* ttypedef) {
   f_decl_ << indent() << "public typealias " << ttypedef->get_symbolic()
-          << " = " << type_name(ttypedef->get_type()) << endl;
-  f_decl_ << endl;
+          << " = " << type_name(ttypedef->get_type()) << '\n';
+  f_decl_ << '\n';
 }
 
 
@@ -430,80 +428,80 @@
   vector<t_enum_value*>::iterator c_iter;
 
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    f_decl_ << indent() << "case " << enum_case_name((*c_iter), true) << endl;
+    f_decl_ << indent() << "case " << enum_case_name((*c_iter), true) << '\n';
   }
 
   // unknown associated value case for safety and similar behavior to other languages
   if (safe_enums_) {
-    f_decl_ << indent() << "case unknown(Int32)" << endl;
+    f_decl_ << indent() << "case unknown(Int32)" << '\n';
   }
-  f_decl_ << endl;
+  f_decl_ << '\n';
 
   // TSerializable read(from:)
   f_decl_ << indent() << "public static func read(from proto: TProtocol) throws -> "
           << tenum->get_name();
   block_open(f_decl_);
-  f_decl_ << indent() << "let raw: Int32 = try proto.read()" << endl;
-  f_decl_ << indent() << "let new = " << tenum->get_name() << "(rawValue: raw)" << endl;
+  f_decl_ << indent() << "let raw: Int32 = try proto.read()" << '\n';
+  f_decl_ << indent() << "let new = " << tenum->get_name() << "(rawValue: raw)" << '\n';
 
-  f_decl_ << indent() << "if let unwrapped = new {" << endl;
+  f_decl_ << indent() << "if let unwrapped = new {" << '\n';
   indent_up();
-  f_decl_ << indent() << "return unwrapped" << endl;
+  f_decl_ << indent() << "return unwrapped" << '\n';
   indent_down();
-  f_decl_ << indent() << "} else {" << endl;
+  f_decl_ << indent() << "} else {" << '\n';
   indent_up();
-  f_decl_ << indent() << "throw TProtocolError(error: .invalidData," << endl;
+  f_decl_ << indent() << "throw TProtocolError(error: .invalidData," << '\n';
   f_decl_ << indent() << "                     message: \"Invalid enum value (\\(raw)) for \\("
-          << tenum->get_name() << ".self)\")" << endl;
+          << tenum->get_name() << ".self)\")" << '\n';
   indent_down();
-  f_decl_ << indent() << "}" << endl;
+  f_decl_ << indent() << "}" << '\n';
   block_close(f_decl_);
 
   // empty init for TSerializable
-  f_decl_ << endl;
+  f_decl_ << '\n';
   f_decl_ << indent() << "public init()";
   block_open(f_decl_);
 
-  f_decl_ << indent() << "self = ." << enum_case_name(constants.front(), false) << endl;
+  f_decl_ << indent() << "self = ." << enum_case_name(constants.front(), false) << '\n';
   block_close(f_decl_);
-  f_decl_ << endl;
+  f_decl_ << '\n';
 
   // rawValue getter
   f_decl_ << indent() << "public var rawValue: Int32";
   block_open(f_decl_);
-  f_decl_ << indent() << "switch self {" << endl;
+  f_decl_ << indent() << "switch self {" << '\n';
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     f_decl_ << indent() << "case ." << enum_case_name((*c_iter), true)
-            << ": return " << (*c_iter)->get_value() << endl;
+            << ": return " << (*c_iter)->get_value() << '\n';
   }
   if (safe_enums_) {
-    f_decl_ << indent() << "case .unknown(let value): return value" << endl;
+    f_decl_ << indent() << "case .unknown(let value): return value" << '\n';
   }
-  f_decl_ << indent() << "}" << endl;
+  f_decl_ << indent() << "}" << '\n';
   block_close(f_decl_);
-  f_decl_ << endl;
+  f_decl_ << '\n';
 
   // convenience rawValue initalizer
   f_decl_ << indent() << "public init?(rawValue: Int32)";
   block_open(f_decl_);
-  f_decl_ << indent() << "switch rawValue {" << endl;;
+  f_decl_ << indent() << "switch rawValue {" << '\n';;
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     f_decl_ << indent() << "case " << (*c_iter)->get_value()
-            << ": self = ." << enum_case_name((*c_iter), true) << endl;
+            << ": self = ." << enum_case_name((*c_iter), true) << '\n';
   }
   if (!safe_enums_) {
-    f_decl_ << indent() << "default: return nil" << endl;
+    f_decl_ << indent() << "default: return nil" << '\n';
   } else {
-    f_decl_ << indent() << "default: self = .unknown(rawValue)" << endl;
+    f_decl_ << indent() << "default: self = .unknown(rawValue)" << '\n';
   }
-  f_decl_ << indent() << "}" << endl;
+  f_decl_ << indent() << "}" << '\n';
   block_close(f_decl_);
 
 
 
 
   block_close(f_decl_);
-  f_decl_ << endl;
+  f_decl_ << '\n';
 }
 
 /**
@@ -521,36 +519,36 @@
 
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
     f_decl_ << indent() << "case " << (*c_iter)->get_name()
-            << " = " << (*c_iter)->get_value() << endl;
+            << " = " << (*c_iter)->get_value() << '\n';
   }
 
-  f_decl_ << endl;
-  f_decl_ << indent() << "public init() { self.init(rawValue: " << constants.front()->get_value() << ")! }" << endl;
+  f_decl_ << '\n';
+  f_decl_ << indent() << "public init() { self.init(rawValue: " << constants.front()->get_value() << ")! }" << '\n';
 
   block_close(f_decl_);
-  f_decl_ << endl;
+  f_decl_ << '\n';
 
   f_impl_ << indent() << "extension " << tenum->get_name() << " : TEnum";
   block_open(f_impl_);
 
-  f_impl_ << endl;
+  f_impl_ << '\n';
 
   f_impl_ << indent() << "public static func readValueFromProtocol(proto: TProtocol) throws -> " << tenum->get_name();
   block_open(f_impl_);
-  f_impl_ << indent() << "var raw = Int32()" << endl
-          << indent() << "try proto.readI32(&raw)" << endl
-          << indent() << "return " << tenum->get_name() << "(rawValue: raw)!" << endl;
+  f_impl_ << indent() << "var raw = Int32()" << '\n'
+          << indent() << "try proto.readI32(&raw)" << '\n'
+          << indent() << "return " << tenum->get_name() << "(rawValue: raw)!" << '\n';
   block_close(f_impl_);
-  f_impl_ << endl;
+  f_impl_ << '\n';
 
   f_impl_ << indent() << "public static func writeValue(value: " << tenum->get_name() << ", toProtocol proto: TProtocol) throws";
   block_open(f_impl_);
-  f_impl_ << indent() << "try proto.writeI32(value.rawValue)" << endl;
+  f_impl_ << indent() << "try proto.writeI32(value.rawValue)" << '\n';
   block_close(f_impl_);
-  f_impl_ << endl;
+  f_impl_ << '\n';
 
   block_close(f_impl_);
-  f_impl_ << endl;
+  f_impl_ << '\n';
 }
 
 string t_swift_generator::enum_case_name(t_enum_value* tenum_case, bool declaration) {
@@ -593,7 +591,7 @@
     t_type* type = (*c_iter)->get_type();
     const_interface << "public let " << capitalize((*c_iter)->get_name()) << " : " << type_name(type) << " = ";
     render_const_value(const_interface, type, (*c_iter)->get_value());
-    const_interface << endl << endl;
+    const_interface << '\n' << '\n';
   }
 
   // this gets spit into the header file in ::close_generator
@@ -647,7 +645,7 @@
     vector<string>::const_iterator d_iter;
     for (d_iter = strings.begin(); d_iter != strings.end(); ++d_iter) {
       if ((*d_iter) != "") {
-        out << indent() << "/// " << (*d_iter) << endl;
+        out << indent() << "/// " << (*d_iter) << '\n';
       }
     }
   }
@@ -685,12 +683,12 @@
     out << indent() << "public enum " << tstruct->get_name();
     block_open(out);
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      out << endl;
+      out << '\n';
       string doc = (*m_iter)->get_doc();
       generate_docstring(out, doc);
       out << indent() << "case "
           << maybe_escape_identifier((*m_iter)->get_name()) << "(val: "
-          << type_name((*m_iter)->get_type(), false) << ")" << endl;
+          << type_name((*m_iter)->get_type(), false) << ")" << '\n';
     }
   } else {
     // Normal structs
@@ -707,20 +705,20 @@
     vector<t_field*> sorted = members;
     sort(sorted.begin(), sorted.end(), [](t_field *a, t_field *b) { return (a->get_key() < b->get_key()); } );
     for (m_iter = sorted.begin(); m_iter != sorted.end(); ++m_iter) {
-      out << endl;
+      out << '\n';
       // TODO: Defaults
 
       string doc = (*m_iter)->get_doc();
       generate_docstring(out, doc);
 
-      out << indent() << declare_property(*m_iter, is_private) << endl;
+      out << indent() << declare_property(*m_iter, is_private) << '\n';
     }
 
-    out << endl;
-    out << endl;
+    out << '\n';
+    out << '\n';
 
     if (!struct_has_required_fields(tstruct)) {
-      indent(out) << visibility << " init() { }" << endl;
+      indent(out) << visibility << " init() { }" << '\n';
     }
     if (struct_has_required_fields(tstruct)) {
       generate_swift_struct_init(out, tstruct, false, is_private);
@@ -732,7 +730,7 @@
 
   block_close(out);
 
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -761,11 +759,11 @@
   vector<t_field*>::const_iterator m_iter;
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
-    out << indent() << declare_property(*m_iter, is_private) << endl;
+    out << '\n';
+    out << indent() << declare_property(*m_iter, is_private) << '\n';
   }
 
-  out << endl;
+  out << '\n';
 
   // init
 
@@ -773,7 +771,7 @@
   block_open(out);
   block_close(out);
 
-  out << endl;
+  out << '\n';
 
   if (struct_has_required_fields(tstruct)) {
     generate_swift_struct_init(out, tstruct, false, is_private);
@@ -784,7 +782,7 @@
 
   block_close(out);
 
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -831,20 +829,20 @@
       should_set = should_set || !field_is_optional((*m_iter));
       if (should_set) {
         out << indent() << "self." << maybe_escape_identifier((*m_iter)->get_name()) << " = "
-            << maybe_escape_identifier((*m_iter)->get_name()) << endl;
+            << maybe_escape_identifier((*m_iter)->get_name()) << '\n';
       }
     } else {
       /** legacy Swift2/Cocoa */
       if (all || (*m_iter)->get_req() == t_field::T_REQUIRED || (*m_iter)->get_req() == t_field::T_OPT_IN_REQ_OUT) {
         out << indent() << "self." << maybe_escape_identifier((*m_iter)->get_name()) << " = "
-            << maybe_escape_identifier((*m_iter)->get_name()) << endl;
+            << maybe_escape_identifier((*m_iter)->get_name()) << '\n';
       }
     }
   }
 
   block_close(out);
 
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -861,7 +859,7 @@
   string visibility = is_private ? (gen_cocoa_ ? "private" : "fileprivate") : "public";
   indent(out) << "extension " << tstruct->get_name() << " : Hashable";
   block_open(out);
-  out << endl;
+  out << '\n';
   indent(out) << visibility << " func hash(into hasher: inout Hasher)";
   block_open(out);
 
@@ -872,21 +870,21 @@
     if (!tstruct->is_union()) {
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         t_field* tfield = *m_iter;
-        indent(out) << "hasher.combine(" << maybe_escape_identifier(tfield->get_name()) << ")" << endl;
+        indent(out) << "hasher.combine(" << maybe_escape_identifier(tfield->get_name()) << ")" << '\n';
       }
     } else {
-      indent(out) << "switch self {" << endl;
+      indent(out) << "switch self {" << '\n';
       for (m_iter = members.begin(); m_iter != members.end(); m_iter++) {
         t_field *tfield = *m_iter;
-        indent(out) << "case ." << tfield->get_name() << "(let val): hasher.combine(val)" << endl;
+        indent(out) << "case ." << tfield->get_name() << "(let val): hasher.combine(val)" << '\n';
       }
-      indent(out) << "}" << endl << endl;
+      indent(out) << "}" << '\n' << '\n';
     }
   }
   block_close(out);
-  out << endl;
+  out << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -912,7 +910,7 @@
 
   if (members.size()) {
     if (!tstruct->is_union()) {
-      out << endl;
+      out << '\n';
       indent_up();
 
       for (m_iter = members.begin(); m_iter != members.end();) {
@@ -922,30 +920,30 @@
         if (++m_iter != members.end()) {
           out << " &&";
         }
-        out << endl;
+        out << '\n';
       }
       indent_down();
     } else {
       block_open(out);
-      indent(out) << "switch (lhs, rhs) {" << endl;
+      indent(out) << "switch (lhs, rhs) {" << '\n';
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         t_field* tfield = *m_iter;
         indent(out) << "case (." << tfield->get_name() << "(let lval), ."
                     << tfield->get_name() << "(let rval)): return lval == rval"
-                    << endl;
+                    << '\n';
       }
-      indent(out) << "default: return false" << endl;
-      indent(out) << "}" << endl;
+      indent(out) << "default: return false" << '\n';
+      indent(out) << "}" << '\n';
       indent_down();
-      indent(out) << "}()" << endl;
+      indent(out) << "}()" << '\n';
     }
   }
   else {
-    out << " true" << endl;
+    out << " true" << '\n';
   }
 
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -972,7 +970,7 @@
   generate_swift_struct_hashable_extension(out, tstruct, is_private);
   generate_swift_struct_thrift_extension(out, tstruct, is_result, is_private);
 
-  out << endl << endl;
+  out << '\n' << '\n';
 }
 
 /**
@@ -993,7 +991,7 @@
 
   block_open(out);
 
-  out << endl;
+  out << '\n';
   if (!gen_cocoa_) {
     /** Swift 3, no writer we just write field ID's */
     string access = (is_private) ? (gen_cocoa_ ? "private" : "fileprivate") : "public";
@@ -1012,11 +1010,11 @@
       // pad a colon
       out << ":";
     }
-    out << "]" << endl;
+    out << "]" << '\n';
     block_close(out);
-    out << endl;
+    out << '\n';
     out << indent() << access << " static var structName: String { return \""
-        << tstruct->get_name() << "\" }" << endl << endl;
+        << tstruct->get_name() << "\" }" << '\n' << '\n';
 
     if (tstruct->is_union()) {
       generate_swift_union_reader(out, tstruct);
@@ -1037,24 +1035,24 @@
   }
 
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_swift_generator::generate_swift_union_reader(ostream& out, t_struct* tstruct) {
   indent(out) << "public static func read(from proto: TProtocol) throws -> "
               << tstruct->get_name();
   block_open(out);
-  indent(out) << "_ = try proto.readStructBegin()" << endl;
+  indent(out) << "_ = try proto.readStructBegin()" << '\n';
 
   indent(out) << "var ret: " << tstruct->get_name() << "?";
-  out << endl;
+  out << '\n';
   indent(out) << "fields: while true";
   block_open(out);
-  out << endl;
-  indent(out) << "let (_, fieldType, fieldID) = try proto.readFieldBegin()" << endl << endl;
+  out << '\n';
+  indent(out) << "let (_, fieldType, fieldID) = try proto.readFieldBegin()" << '\n' << '\n';
   indent(out) << "switch (fieldID, fieldType)";
   block_open(out);
-  indent(out) << "case (_, .stop):            break fields" << endl;
+  indent(out) << "case (_, .stop):            break fields" << '\n';
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -1094,28 +1092,28 @@
     indent(out) << padding << "ret = " << tstruct->get_name() << "."
                 << (*f_iter)->get_name() << "(val: " << "try "
                 << type_name((*f_iter)->get_type(), false, false)
-                << ".read(from: proto))" << endl;
+                << ".read(from: proto))" << '\n';
   }
 
-  indent(out) << "case let (_, unknownType):  try proto.skip(type: unknownType)" << endl;
+  indent(out) << "case let (_, unknownType):  try proto.skip(type: unknownType)" << '\n';
 
   block_close(out);
-  indent(out) << "try proto.readFieldEnd()" << endl;
+  indent(out) << "try proto.readFieldEnd()" << '\n';
 
   block_close(out);
-  out << endl;
+  out << '\n';
 
-  indent(out) << "try proto.readStructEnd()" << endl;
+  indent(out) << "try proto.readStructEnd()" << '\n';
 
   indent(out) << "if let ret = ret";
   block_open(out);
-  indent(out) << "return ret" << endl;
+  indent(out) << "return ret" << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
   indent(out) << "throw TProtocolError(error: .unknown, message: \"Missing required value for type: "
               << tstruct->get_name() << "\")";
   block_close(out);
-  out << endl;
+  out << '\n';
 
 }
 
@@ -1139,7 +1137,7 @@
                << tstruct->get_name();
 
     block_open(out);
-    indent(out) << "_ = try proto.readStructBegin()" << endl;
+    indent(out) << "_ = try proto.readStructBegin()" << '\n';
 
     const vector<t_field*>& fields = tstruct->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -1147,20 +1145,20 @@
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       bool optional = field_is_optional(*f_iter);
       indent(out) << "var " << maybe_escape_identifier((*f_iter)->get_name()) << ": "
-                  << type_name((*f_iter)->get_type(), optional, !optional) << endl;
+                  << type_name((*f_iter)->get_type(), optional, !optional) << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     // Loop over reading in fields
     indent(out) << "fields: while true";
     block_open(out);
-    out << endl;
+    out << '\n';
 
-    indent(out) << "let (_, fieldType, fieldID) = try proto.readFieldBegin()" << endl << endl;
+    indent(out) << "let (_, fieldType, fieldID) = try proto.readFieldBegin()" << '\n' << '\n';
     indent(out) << "switch (fieldID, fieldType)";
     block_open(out);
-    indent(out) << "case (_, .stop):            break fields" << endl;
+    indent(out) << "case (_, .stop):            break fields" << '\n';
 
 
     // Generate deserialization code for known cases
@@ -1198,33 +1196,33 @@
       }
 
       out << padding << maybe_escape_identifier((*f_iter)->get_name()) << " = try "
-          << type_name((*f_iter)->get_type(), false, false) << ".read(from: proto)" << endl;
+          << type_name((*f_iter)->get_type(), false, false) << ".read(from: proto)" << '\n';
     }
 
-    indent(out) << "case let (_, unknownType):  try proto.skip(type: unknownType)" << endl;
+    indent(out) << "case let (_, unknownType):  try proto.skip(type: unknownType)" << '\n';
     block_close(out);
-    out << endl;
+    out << '\n';
 
     // Read field end marker
-    indent(out) << "try proto.readFieldEnd()" << endl;
+    indent(out) << "try proto.readFieldEnd()" << '\n';
     block_close(out);
-    out << endl;
-    indent(out) << "try proto.readStructEnd()" << endl;
+    out << '\n';
+    indent(out) << "try proto.readStructEnd()" << '\n';
 
     if (struct_has_required_fields(tstruct)) {
       // performs various checks (e.g. check that all required fields are set)
-      indent(out) << "// Required fields" << endl;
+      indent(out) << "// Required fields" << '\n';
 
       for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
         if (field_is_optional(*f_iter)) {
           continue;
         }
         indent(out) << "try proto.validateValue(" << maybe_escape_identifier((*f_iter)->get_name()) << ", "
-                    << "named: \"" << (*f_iter)->get_name() << "\")" << endl;
+                    << "named: \"" << (*f_iter)->get_name() << "\")" << '\n';
       }
     }
 
-    out << endl;
+    out << '\n';
 
     indent(out) << "return " << tstruct->get_name() << "(";
     for (f_iter = fields.begin(); f_iter != fields.end();) {
@@ -1242,8 +1240,8 @@
                 << tstruct->get_name();
 
     block_open(out);
-    out << endl;
-    indent(out) << "try __proto.readStructBegin()" << endl << endl;
+    out << '\n';
+    indent(out) << "try __proto.readStructBegin()" << '\n' << '\n';
 
     const vector<t_field*>& fields = tstruct->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -1251,66 +1249,66 @@
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       bool optional = field_is_optional(*f_iter);
       indent(out) << "var " << maybe_escape_identifier((*f_iter)->get_name()) << " : "
-                  << type_name((*f_iter)->get_type(), optional, !optional) << endl;
+                  << type_name((*f_iter)->get_type(), optional, !optional) << '\n';
     }
 
-    out << endl;
+    out << '\n';
 
     // Loop over reading in fields
     indent(out) << "fields: while true";
     block_open(out);
-    out << endl;
+    out << '\n';
 
-    indent(out) << "let (_, fieldType, fieldID) = try __proto.readFieldBegin()" << endl << endl;
+    indent(out) << "let (_, fieldType, fieldID) = try __proto.readFieldBegin()" << '\n' << '\n';
     indent(out) << "switch (fieldID, fieldType)";
 
     block_open(out);
 
-    indent(out) << "case (_, .STOP):" << endl;
+    indent(out) << "case (_, .STOP):" << '\n';
     indent_up();
-    indent(out) << "break fields" << endl << endl;
+    indent(out) << "break fields" << '\n' << '\n';
     indent_down();
 
     // Generate deserialization code for known cases
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
 
-      indent(out) << "case (" << (*f_iter)->get_key() << ", " << type_to_enum((*f_iter)->get_type()) << "):" << endl;
+      indent(out) << "case (" << (*f_iter)->get_key() << ", " << type_to_enum((*f_iter)->get_type()) << "):" << '\n';
       indent_up();
       indent(out) << maybe_escape_identifier((*f_iter)->get_name()) << " = try __proto.readValue() as "
-                  << type_name((*f_iter)->get_type()) << endl << endl;
+                  << type_name((*f_iter)->get_type()) << '\n' << '\n';
       indent_down();
 
     }
 
-    indent(out) << "case let (_, unknownType):" << endl;
+    indent(out) << "case let (_, unknownType):" << '\n';
     indent_up();
-    indent(out) << "try __proto.skipType(unknownType)" << endl;
+    indent(out) << "try __proto.skipType(unknownType)" << '\n';
     indent_down();
     block_close(out);
-    out << endl;
+    out << '\n';
 
     // Read field end marker
-    indent(out) << "try __proto.readFieldEnd()" << endl;
+    indent(out) << "try __proto.readFieldEnd()" << '\n';
 
     block_close(out);
-    out << endl;
-    indent(out) << "try __proto.readStructEnd()" << endl;
-    out << endl;
+    out << '\n';
+    indent(out) << "try __proto.readStructEnd()" << '\n';
+    out << '\n';
 
     if (struct_has_required_fields(tstruct)) {
       // performs various checks (e.g. check that all required fields are set)
-      indent(out) << "// Required fields" << endl;
+      indent(out) << "// Required fields" << '\n';
 
       for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
         if (field_is_optional(*f_iter)) {
           continue;
         }
         indent(out) << "try __proto.validateValue(" << (*f_iter)->get_name() << ", "
-                    << "named: \"" << (*f_iter)->get_name() << "\")" << endl;
+                    << "named: \"" << (*f_iter)->get_name() << "\")" << '\n';
       }
     }
 
-    out << endl;
+    out << '\n';
 
     indent(out) << "return " << tstruct->get_name() << "(";
     for (f_iter = fields.begin(); f_iter != fields.end();) {
@@ -1320,11 +1318,11 @@
       }
     }
   }
-  out << ")" << endl;
+  out << ")" << '\n';
 
   block_close(out);
 
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1344,14 +1342,14 @@
   indent(out) << visibility << " static func writeValue(__value: " << tstruct->get_name()
               << ", toProtocol __proto: TProtocol) throws";
   block_open(out);
-  out << endl;
+  out << '\n';
 
   string name = tstruct->get_name();
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
 
-  indent(out) << "try __proto.writeStructBeginWithName(\"" << name << "\")" << endl;
-  out << endl;
+  indent(out) << "try __proto.writeStructBeginWithName(\"" << name << "\")" << '\n';
+  out << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field *tfield = *f_iter;
@@ -1367,19 +1365,19 @@
                 << (optional ? "" : "__value.") << maybe_escape_identifier(tfield->get_name()) << ", "
                 << "name: \"" << tfield->get_name() << "\", "
                 << "type: " << type_to_enum(tfield->get_type()) << ", "
-                << "id: " << tfield->get_key() << ")" << endl;
+                << "id: " << tfield->get_key() << ")" << '\n';
 
     if (optional) {
       block_close(out);
     }
 
-    out << endl;
+    out << '\n';
   }
 
-  indent(out) << "try __proto.writeFieldStop()" << endl << endl;
-  indent(out) << "try __proto.writeStructEnd()" << endl;
+  indent(out) << "try __proto.writeFieldStop()" << '\n' << '\n';
+  indent(out) << "try __proto.writeStructEnd()" << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1396,12 +1394,12 @@
   indent(out) << "private static func writeValue(__value: " << tstruct->get_name()
               << ", toProtocol __proto: TProtocol) throws";
   block_open(out);
-  out << endl;
+  out << '\n';
   string name = tstruct->get_name();
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
-  indent(out) << "try __proto.writeStructBeginWithName(\"" << name << "\")" << endl;
-  out << endl;
+  indent(out) << "try __proto.writeStructBeginWithName(\"" << name << "\")" << '\n';
+  out << '\n';
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field *tfield = *f_iter;
@@ -1413,15 +1411,15 @@
     indent(out) << "try __proto.writeFieldValue(result, "
                 << "name: \"" << tfield->get_name() << "\", "
                 << "type: " << type_to_enum(tfield->get_type()) << ", "
-                << "id: " << tfield->get_key() << ")" << endl;
+                << "id: " << tfield->get_key() << ")" << '\n';
 
     block_close(out);
   }
   // Write the struct map
-  indent(out) << "try __proto.writeFieldStop()" << endl << endl;
-  indent(out) << "try __proto.writeStructEnd()" << endl;
+  indent(out) << "try __proto.writeFieldStop()" << '\n' << '\n';
+  indent(out) << "try __proto.writeStructEnd()" << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1440,50 +1438,50 @@
               << (debug_descriptions_ ? "CustomDebugStringConvertible" : "CustomStringConvertible");
 
   block_open(out);
-  out << endl;
+  out << '\n';
   indent(out) << "public var description : String";
   block_open(out);
   indent(out) << "var desc = \"" << tstruct->get_name();
 
   if (!gen_cocoa_) {
     if (!tstruct->is_union()) {
-      out << "(\"" << endl;
+      out << "(\"" << '\n';
       for (f_iter = fields.begin(); f_iter != fields.end();) {
         indent(out) << "desc += \"" << (*f_iter)->get_name()
                     << "=\\(String(describing: self." << maybe_escape_identifier((*f_iter)->get_name()) << "))";
         if (++f_iter != fields.end()) {
           out << ", ";
         }
-        out << "\"" << endl;
+        out << "\"" << '\n';
       }
     } else {
-      out << ".\"" << endl;
-      indent(out) << "switch self {" << endl;
+      out << ".\"" << '\n';
+      indent(out) << "switch self {" << '\n';
       for (f_iter = fields.begin(); f_iter != fields.end();f_iter++) {
         indent(out) << "case ." << (*f_iter)->get_name() << "(let val): "
                     << "desc += \"" << (*f_iter)->get_name() << "(val: \\(val))\""
-                    << endl;
+                    << '\n';
       }
-      indent(out) << "}" << endl;
+      indent(out) << "}" << '\n';
     }
   } else {
-    out << "(\"" << endl;
+    out << "(\"" << '\n';
     for (f_iter = fields.begin(); f_iter != fields.end();) {
       indent(out) << "desc += \"" << (*f_iter)->get_name()
                   << "=\\(self." << maybe_escape_identifier((*f_iter)->get_name()) << ")";
       if (++f_iter != fields.end()) {
         out << ", ";
       }
-      out << "\"" << endl;
+      out << "\"" << '\n';
     }
-    indent(out) << "desc += \")\"" << endl;
+    indent(out) << "desc += \")\"" << '\n';
   }
 
-  indent(out) << "return desc" << endl;
+  indent(out) << "return desc" << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1606,14 +1604,14 @@
       out << " : " << parent->get_name();
     }
     block_open(out);
-    out << endl;
+    out << '\n';
 
     vector<t_function*> functions = tservice->get_functions();
     vector<t_function*>::iterator f_iter;
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       function_docstring(out, *f_iter);
-      indent(out) << function_signature(*f_iter) << endl << endl;
+      indent(out) << function_signature(*f_iter) << '\n' << '\n';
     }
 
   } else {
@@ -1624,7 +1622,7 @@
     vector<t_function*>::iterator f_iter;
 
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      out << endl;
+      out << '\n';
       indent(out) << function_signature(*f_iter) << "  // exceptions: ";
       t_struct* xs = (*f_iter)->get_xceptions();
       const vector<t_field*>& xceptions = xs->get_members();
@@ -1632,11 +1630,11 @@
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
         out << type_name((*x_iter)->get_type()) + ", ";
       }
-      out << endl;
+      out << '\n';
     }
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1652,7 +1650,7 @@
   indent(out) << "public protocol " << tservice->get_name() << "Async";
 
   block_open(out);
-  if (!gen_cocoa_) {  out << endl; }
+  if (!gen_cocoa_) {  out << '\n'; }
 
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
@@ -1660,20 +1658,20 @@
   if (!gen_cocoa_) {
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
       async_function_docstring(out, *f_iter);
-      indent(out) << async_function_signature(*f_iter) << endl << endl;
+      indent(out) << async_function_signature(*f_iter) << '\n' << '\n';
     }
   } else {
     for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      out << endl;
-      indent(out) << async_function_signature(*f_iter) << endl;
+      out << '\n';
+      indent(out) << async_function_signature(*f_iter) << '\n';
       if (promise_kit_) {
-        indent(out) << promise_function_signature(*f_iter) << endl;
+        indent(out) << promise_function_signature(*f_iter) << '\n';
       } //
-      out << endl;
+      out << '\n';
     }
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1690,33 +1688,33 @@
     out << " : " << ((parent == nullptr) ? "TClient" : parent->get_name() + "Client");
     out <<  " /* , " << tservice->get_name() << " */";
     block_open(out);
-    out << endl;
+    out << '\n';
   } else {
     // a
     indent(out) << "public class " << tservice->get_name() << "Client /* : " << tservice->get_name() << " */";
     block_open(out);
-    out << endl;
+    out << '\n';
 
-    indent(out) << "let __inProtocol : TProtocol" << endl << endl;
-    indent(out) << "let __outProtocol : TProtocol" << endl << endl;
+    indent(out) << "let __inProtocol : TProtocol" << '\n' << '\n';
+    indent(out) << "let __outProtocol : TProtocol" << '\n' << '\n';
     indent(out) << "public init(inoutProtocol: TProtocol)";
     block_open(out);
 
-    indent(out) << "__inProtocol = inoutProtocol" << endl;
-    indent(out) << "__outProtocol = inoutProtocol" << endl;
+    indent(out) << "__inProtocol = inoutProtocol" << '\n';
+    indent(out) << "__outProtocol = inoutProtocol" << '\n';
     block_close(out);
-    out << endl;
+    out << '\n';
 
     indent(out) << "public init(inProtocol: TProtocol, outProtocol: TProtocol)";
     block_open(out);
-    indent(out) << "__inProtocol = inProtocol" << endl;
-    indent(out) << "__outProtocol = outProtocol" << endl;
+    indent(out) << "__inProtocol = inProtocol" << '\n';
+    indent(out) << "__outProtocol = outProtocol" << '\n';
     block_close(out);
-    out << endl;
+    out << '\n';
   }
 
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1736,24 +1734,24 @@
     out <<  " /* , " << tservice->get_name() << " */";
 
     block_open(out);
-    out << endl;
+    out << '\n';
   } else {
     indent(out) << "public class " << tservice->get_name() << "AsyncClient /* : " << tservice->get_name() << " */";
     block_open(out);
-    out << endl;
+    out << '\n';
 
-    indent(out) << "let __protocolFactory : TProtocolFactory" << endl << endl;
-    indent(out) << "let __transportFactory : TAsyncTransportFactory" << endl << endl;
+    indent(out) << "let __protocolFactory : TProtocolFactory" << '\n' << '\n';
+    indent(out) << "let __transportFactory : TAsyncTransportFactory" << '\n' << '\n';
     indent(out) << "public init(protocolFactory: TProtocolFactory, transportFactory: TAsyncTransportFactory)";
     block_open(out);
 
-    indent(out) << "__protocolFactory = protocolFactory" << endl;
-    indent(out) << "__transportFactory = transportFactory" << endl;
+    indent(out) << "__protocolFactory = protocolFactory" << '\n';
+    indent(out) << "__transportFactory = transportFactory" << '\n';
     block_close(out);
-    out << endl;
+    out << '\n';
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1767,34 +1765,34 @@
     indent(out) << "open class " << tservice->get_name() << "Processor /* " << tservice->get_name() << " */";
 
     block_open(out);
-    out << endl;
+    out << '\n';
     out << indent() << "typealias ProcessorHandlerDictionary = "
-        << "[String: (Int32, TProtocol, TProtocol, " << tservice->get_name() << ") throws -> Void]" << endl
-        << endl
-        << indent() << "public var service: " << tservice->get_name() << endl
-        << endl
+        << "[String: (Int32, TProtocol, TProtocol, " << tservice->get_name() << ") throws -> Void]" << '\n'
+        << '\n'
+        << indent() << "public var service: " << tservice->get_name() << '\n'
+        << '\n'
         << indent() << "public required init(service: " << tservice->get_name() << ")";
   } else {
     indent(out) << "public class " << tservice->get_name() << "Processor : NSObject /* "
                 << tservice->get_name() << " */";
     block_open(out);
-    out << endl;
+    out << '\n';
 
     out << indent() << "typealias ProcessorHandlerDictionary = "
-        << "[String: (Int, TProtocol, TProtocol, " << tservice->get_name() << ") throws -> Void]" << endl
-        << endl
-        << indent() << "let service : " << tservice->get_name() << endl
-        << endl
+        << "[String: (Int, TProtocol, TProtocol, " << tservice->get_name() << ") throws -> Void]" << '\n'
+        << '\n'
+        << indent() << "let service : " << tservice->get_name() << '\n'
+        << '\n'
         << indent() << "public init(service: " << tservice->get_name() << ")";
   }
 
   block_open(out);
-  indent(out) << "self.service = service" << endl;
+  indent(out) << "self.service = service" << '\n';
   block_close(out);
-  out << endl;
+  out << '\n';
 
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1831,7 +1829,7 @@
     // Serialize the request
     indent(out) << "try outProtocol.writeMessageBegin(name: \"" << funname << "\", "
                 << "type: " << (tfunction->is_oneway() ? ".oneway" : ".call") << ", "
-                << "sequenceID: 0)" << endl;
+                << "sequenceID: 0)" << '\n';
 
     indent(out) << "let args = " << argsname << "(";
 
@@ -1847,18 +1845,18 @@
         out << ", ";
       }
     }
-    out << ")" << endl;
-    indent(out) << "try args.write(to: outProtocol)" << endl;
-    indent(out) << "try outProtocol.writeMessageEnd()" << endl;
+    out << ")" << '\n';
+    indent(out) << "try args.write(to: outProtocol)" << '\n';
+    indent(out) << "try outProtocol.writeMessageEnd()" << '\n';
   } else {
-    out << endl;
+    out << '\n';
 
     // Serialize the request
     indent(out) << "try __outProtocol.writeMessageBeginWithName(\"" << funname << "\", "
                 << "type: " << (tfunction->is_oneway() ? ".ONEWAY" : ".CALL") << ", "
-                << "sequenceID: 0)" << endl;
+                << "sequenceID: 0)" << '\n';
 
-    out << endl;
+    out << '\n';
 
     indent(out) << "let __args = " << argsname << "(";
 
@@ -1874,13 +1872,13 @@
         out << ", ";
       }
     }
-    out << ")" << endl;
-    indent(out) << "try " << argsname << ".writeValue(__args, toProtocol: __outProtocol)" << endl << endl;
-    indent(out) << "try __outProtocol.writeMessageEnd()" << endl;
+    out << ")" << '\n';
+    indent(out) << "try " << argsname << ".writeValue(__args, toProtocol: __outProtocol)" << '\n' << '\n';
+    indent(out) << "try __outProtocol.writeMessageEnd()" << '\n';
   }
 
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -1913,7 +1911,7 @@
 
     // check for an exception
 
-    indent(out) << "try inProtocol.readResultMessageBegin() " << endl;
+    indent(out) << "try inProtocol.readResultMessageBegin() " << '\n';
 
     string resultname = function_result_helper_struct_type(tservice, tfunction);
     indent(out);
@@ -1924,15 +1922,15 @@
     }
 
     string return_type_name = type_name(tfunction->get_returntype());
-    out << "try " << resultname << ".read(from: inProtocol)" << endl;
+    out << "try " << resultname << ".read(from: inProtocol)" << '\n';
 
-    indent(out) << "try inProtocol.readMessageEnd()" << endl << endl;
+    indent(out) << "try inProtocol.readMessageEnd()" << '\n' << '\n';
 
     // Careful, only return _result if not a void function
     if (!tfunction->get_returntype()->is_void()) {
       indent(out) << "if let success = result.success";
       block_open(out);
-      indent(out) << "return success" << endl;
+      indent(out) << "return success" << '\n';
       block_close(out);
     }
 
@@ -1943,14 +1941,14 @@
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       indent(out) << "if let " << (*x_iter)->get_name() << " = result." << (*x_iter)->get_name();
       block_open(out);
-      indent(out) << "throw " << (*x_iter)->get_name() << endl;
+      indent(out) << "throw " << (*x_iter)->get_name() << '\n';
       block_close(out);
     }
 
     // If you get here it's an exception, unless a void function
     if (!tfunction->get_returntype()->is_void()) {
       indent(out) << "throw TApplicationError(error: .missingResult(methodName: \""
-                  << tfunction->get_name() << "\"))" << endl;
+                  << tfunction->get_name() << "\"))" << '\n';
     }
   } else {
     if (needs_protocol) {
@@ -1966,22 +1964,22 @@
     block_open(out);
 
     // check for an exception
-    out << endl;
-    indent(out) << "try __inProtocol.readResultMessageBegin() " << endl << endl;
+    out << '\n';
+    indent(out) << "try __inProtocol.readResultMessageBegin() " << '\n' << '\n';
     string resultname = function_result_helper_struct_type(tservice, tfunction);
     indent(out);
     if (!tfunction->get_returntype()->is_void() || !tfunction->get_xceptions()->get_members().empty()) {
       out << "let __result = ";
     }
-    out << "try " << resultname << ".readValueFromProtocol(__inProtocol)" << endl << endl;
+    out << "try " << resultname << ".readValueFromProtocol(__inProtocol)" << '\n' << '\n';
 
-    indent(out) << "try __inProtocol.readMessageEnd()" << endl << endl;
+    indent(out) << "try __inProtocol.readMessageEnd()" << '\n' << '\n';
 
     // Careful, only return _result if not a void function
     if (!tfunction->get_returntype()->is_void()) {
       indent(out) << "if let __success = __result.success";
       block_open(out);
-      indent(out) << "return __success" << endl;
+      indent(out) << "return __success" << '\n';
       block_close(out);
     }
 
@@ -1992,24 +1990,24 @@
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       indent(out) << "if let " << (*x_iter)->get_name() << " = __result." << (*x_iter)->get_name();
       block_open(out);
-      indent(out) << "throw " << (*x_iter)->get_name() << endl;
+      indent(out) << "throw " << (*x_iter)->get_name() << '\n';
       block_close(out);
     }
 
     // If you get here it's an exception, unless a void function
     if (!tfunction->get_returntype()->is_void()) {
-      indent(out) << "throw NSError(" << endl;
+      indent(out) << "throw NSError(" << '\n';
       indent_up();
-      indent(out) << "domain: TApplicationErrorDomain, " << endl;
-      indent(out) << "code: Int(TApplicationError.MissingResult.rawValue)," << endl;
-      indent(out) << "userInfo: [TApplicationErrorMethodKey: \"" << tfunction->get_name() << "\"])" << endl;
+      indent(out) << "domain: TApplicationErrorDomain, " << '\n';
+      indent(out) << "code: Int(TApplicationError.MissingResult.rawValue)," << '\n';
+      indent(out) << "userInfo: [TApplicationErrorMethodKey: \"" << tfunction->get_name() << "\"])" << '\n';
       indent_down();
     }
   }
 
   // Close function
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -2035,7 +2033,7 @@
     }
   }
 
-  out << ")" << endl;
+  out << ")" << '\n';
 }
 
 /**
@@ -2061,7 +2059,7 @@
     out << ", " << (*f_iter)->get_name() << ": " << (*f_iter)->get_name();
   }
 
-  out << ")" << endl;
+  out << ")" << '\n';
 }
 
 /**
@@ -2075,7 +2073,7 @@
   string name = tservice->get_name() + "Client";
   indent(out) << "extension " << name << " : " << tservice->get_name();
   block_open(out);
-  out << endl;
+  out << '\n';
 
   // generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -2092,28 +2090,28 @@
     indent(out) << "public " << function_signature(*f_iter);
     block_open(out);
 
-    if (gen_cocoa_) { out << endl; }
+    if (gen_cocoa_) { out << '\n'; }
 
     generate_swift_service_client_send_function_invocation(out, *f_iter);
     if (!gen_cocoa_) {
-      indent(out) << "try outProtocol.transport.flush()" << endl;
+      indent(out) << "try outProtocol.transport.flush()" << '\n';
     } else {
-      out << endl;
-      indent(out) << "try __outProtocol.transport().flush()" << endl << endl;
+      out << '\n';
+      indent(out) << "try __outProtocol.transport().flush()" << '\n' << '\n';
     }
 
     if (!(*f_iter)->is_oneway()) {
       if ((*f_iter)->get_returntype()->is_void()) {
-        indent(out) << "try recv_" << (*f_iter)->get_name() << "()" << endl;
+        indent(out) << "try recv_" << (*f_iter)->get_name() << "()" << '\n';
       } else {
-        indent(out) << "return try recv_" << (*f_iter)->get_name() << "()" << endl;
+        indent(out) << "return try recv_" << (*f_iter)->get_name() << "()" << '\n';
       }
     }
     block_close(out);
-    out << endl;
+    out << '\n';
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -2131,7 +2129,7 @@
 
   indent(out) << "extension " << name << " : " << protocol_name;
   block_open(out);
-  out << endl;
+  out << '\n';
 
   // generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -2146,10 +2144,10 @@
 
     indent(out) << "public " << async_function_signature(*f_iter);
     block_open(out);
-    out << endl;
-    out << indent() << "let transport   = factory.newTransport()" << endl
-        << indent() << "let proto = Protocol(on: transport)" << endl
-        << endl;
+    out << '\n';
+    out << indent() << "let transport   = factory.newTransport()" << '\n'
+        << indent() << "let proto = Protocol(on: transport)" << '\n'
+        << '\n';
 
     out << indent() << "do";
     block_open(out);
@@ -2157,12 +2155,12 @@
     generate_swift_service_client_send_async_function_invocation(out, *f_iter);
 
     indent_down();
-    out << indent() << "} catch let error {" << endl;
+    out << indent() << "} catch let error {" << '\n';
     indent_up();
-    out << indent() << "completion(.error(error))" << endl;
+    out << indent() << "completion(.error(error))" << '\n';
     block_close(out);
 
-    out << endl;
+    out << '\n';
 
     bool ret_is_void = (*f_iter)->get_returntype()->is_void();
     bool is_oneway = (*f_iter)->is_oneway();
@@ -2170,10 +2168,10 @@
     string error_completion_call = "completion(.error(error))";
     indent(out) << "transport.flush";
     block_open(out);
-    out << indent() << "(trans, error) in" << endl << endl;
+    out << indent() << "(trans, error) in" << '\n' << '\n';
     out << indent() << "if let error = error";
     block_open(out);
-    out << indent() << error_completion_call << endl;
+    out << indent() << error_completion_call << '\n';
     block_close(out);
 
     if (!is_oneway) {
@@ -2183,24 +2181,24 @@
       if (!ret_is_void) {
         out << "let result = ";
       }
-      out << "try self.recv_" << (*f_iter)->get_name() << "(on: proto)" << endl;
+      out << "try self.recv_" << (*f_iter)->get_name() << "(on: proto)" << '\n';
 
-      out << indent() << (ret_is_void ? "completion(.success(Void()))" : "completion(.success(result))") << endl;
+      out << indent() << (ret_is_void ? "completion(.success(Void()))" : "completion(.success(result))") << '\n';
       indent_down();
-      out << indent() << "} catch let error {" << endl;
+      out << indent() << "} catch let error {" << '\n';
       indent_up();
-      out << indent() << error_completion_call << endl;
+      out << indent() << error_completion_call << '\n';
 
       block_close(out);
     } else {
-      out << indent() << "completion(.success(Void()))" << endl;
+      out << indent() << "completion(.success(Void()))" << '\n';
     }
     block_close(out);
     block_close(out);
 
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 void t_swift_generator::generate_old_swift_service_client_async_implementation(ostream& out,
@@ -2211,7 +2209,7 @@
 
   indent(out) << "extension " << name << " : " << protocol_name;
   block_open(out);
-  out << endl;
+  out << '\n';
 
   // generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -2226,19 +2224,19 @@
 
     indent(out) << "public " << async_function_signature(*f_iter);
     block_open(out);
-    out << endl;
+    out << '\n';
 
-    out << indent() << "let __transport = __transportFactory.newTransport()" << endl
-        << indent() << "let __protocol = __protocolFactory.newProtocolOnTransport(__transport)" << endl
-        << endl;
+    out << indent() << "let __transport = __transportFactory.newTransport()" << '\n'
+        << indent() << "let __protocol = __protocolFactory.newProtocolOnTransport(__transport)" << '\n'
+        << '\n';
 
     generate_swift_service_client_send_async_function_invocation(out, *f_iter);
-    out << endl;
+    out << '\n';
 
     indent(out) << "__transport.flushWithCompletion(";
 
     if ((*f_iter)->is_oneway()) {
-      out << "success, failure: failure)" << endl;
+      out << "success, failure: failure)" << '\n';
     }
     else {
       block_open(out);
@@ -2249,25 +2247,25 @@
       if (!(*f_iter)->get_returntype()->is_void()) {
         out << "let result = ";
       }
-      out << "try self.recv_" << (*f_iter)->get_name() << "(__protocol)" << endl;
+      out << "try self.recv_" << (*f_iter)->get_name() << "(__protocol)" << '\n';
 
       out << indent() << "success(";
       if (!(*f_iter)->get_returntype()->is_void()) {
         out << "result";
       }
-      out << ")" << endl;
+      out << ")" << '\n';
 
       block_close(out);
       indent(out) << "catch let error";
       block_open(out);
-      indent(out) << "failure(error as NSError)" << endl;
+      indent(out) << "failure(error as NSError)" << '\n';
       block_close(out);
       block_close(out);
-      indent(out) << ", failure: failure)" << endl;
+      indent(out) << ", failure: failure)" << '\n';
     }
 
     block_close(out);
-    out << endl;
+    out << '\n';
 
     // Promise function
     if (promise_kit_) {
@@ -2275,17 +2273,17 @@
       indent(out) << "public " << promise_function_signature(*f_iter);
       block_open(out);
 
-      out << indent() << "let (__promise, __fulfill, __reject) = Promise<" << type_name((*f_iter)->get_returntype()) << ">.pendingPromise()" << endl << endl
-          << indent() << "let __transport = __transportFactory.newTransport()" << endl
-          << indent() << "let __protocol = __protocolFactory.newProtocolOnTransport(__transport)" << endl
-          << endl;
+      out << indent() << "let (__promise, __fulfill, __reject) = Promise<" << type_name((*f_iter)->get_returntype()) << ">.pendingPromise()" << '\n' << '\n'
+          << indent() << "let __transport = __transportFactory.newTransport()" << '\n'
+          << indent() << "let __protocol = __protocolFactory.newProtocolOnTransport(__transport)" << '\n'
+          << '\n';
 
       generate_swift_service_client_send_async_function_invocation(out, *f_iter);
-      out << endl;
+      out << '\n';
       indent(out) << "__transport.flushWithCompletion(";
 
       if ((*f_iter)->is_oneway()) {
-        out << "{ __fulfill() }, failure: { __reject($0) })" << endl;
+        out << "{ __fulfill() }, failure: { __reject($0) })" << '\n';
       }
       else {
         block_open(out);
@@ -2296,37 +2294,37 @@
         if (!(*f_iter)->get_returntype()->is_void()) {
           out << "let result = ";
         }
-        out << "try self.recv_" << (*f_iter)->get_name() << "(__protocol)" << endl;
+        out << "try self.recv_" << (*f_iter)->get_name() << "(__protocol)" << '\n';
 
         out << indent() << "__fulfill(";
         if (!(*f_iter)->get_returntype()->is_void()) {
           out << "result";
         }
-        out << ")" << endl;
+        out << ")" << '\n';
 
         block_close(out);
         indent(out) << "catch let error";
         block_open(out);
-        indent(out) << "__reject(error)" << endl;
+        indent(out) << "__reject(error)" << '\n';
         block_close(out);
         block_close(out);
 
-        indent(out) << ", failure: { error in " << endl;
+        indent(out) << ", failure: { error in " << '\n';
         indent_up();
-        indent(out) << "__reject(error)" << endl;
+        indent(out) << "__reject(error)" << '\n';
         indent_down();
-        indent(out) << "})" << endl;
+        indent(out) << "})" << '\n';
       }
 
-      indent(out) << "return __promise" << endl;
+      indent(out) << "return __promise" << '\n';
       block_close(out);
-      out << endl;
+      out << '\n';
 
     }
 
   }
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -2345,12 +2343,12 @@
 
   indent(out) << "extension " << name << " : TProcessor";
   block_open(out);
-  out << endl;
+  out << '\n';
   indent(out) << "static let processorHandlers" << (gen_cocoa_ ? " " : "") << ": ProcessorHandlerDictionary =";
   block_open(out);
 
-  out << endl;
-  out << indent() << "var processorHandlers = ProcessorHandlerDictionary()" << endl << endl;
+  out << '\n';
+  out << indent() << "var processorHandlers = ProcessorHandlerDictionary()" << '\n' << '\n';
 
   // generate method map for routing incoming calls
   vector<t_function*> functions = tservice->get_functions();
@@ -2361,25 +2359,25 @@
 
     string args_type = function_args_helper_struct_type(tservice, *f_iter);
 
-    out << indent() << "processorHandlers[\"" << tfunction->get_name() << "\"] = { sequenceID, inProtocol, outProtocol, handler in" << endl
-        << endl;
+    out << indent() << "processorHandlers[\"" << tfunction->get_name() << "\"] = { sequenceID, inProtocol, outProtocol, handler in" << '\n'
+        << '\n';
 
     indent_up();
     if (!gen_cocoa_) {
-      out << indent() << "let args = try " << args_type << ".read(from: inProtocol)" << endl
-          << endl
-          << indent() << "try inProtocol.readMessageEnd()" << endl
-          << endl;
+      out << indent() << "let args = try " << args_type << ".read(from: inProtocol)" << '\n'
+          << '\n'
+          << indent() << "try inProtocol.readMessageEnd()" << '\n'
+          << '\n';
     } else {
-      out << indent() << "let args = try " << args_type << ".readValueFromProtocol(inProtocol)" << endl
-          << endl
-          << indent() << "try inProtocol.readMessageEnd()" << endl
-          << endl;
+      out << indent() << "let args = try " << args_type << ".readValueFromProtocol(inProtocol)" << '\n'
+          << '\n'
+          << indent() << "try inProtocol.readMessageEnd()" << '\n'
+          << '\n';
     }
 
     if (!tfunction->is_oneway() ) {
       string result_type = function_result_helper_struct_type(tservice, tfunction);
-      indent(out) << "var result = " << result_type << "()" << endl;
+      indent(out) << "var result = " << result_type << "()" << '\n';
 
       indent(out) << "do";
       block_open(out);
@@ -2406,7 +2404,7 @@
         }
       }
 
-      out << ")" << endl;
+      out << ")" << '\n';
       block_close(out);
 
       t_struct* xs = tfunction->get_xceptions();
@@ -2423,37 +2421,37 @@
           }
           out << (*x_iter)->get_type()->get_name();
 
-          out << " { result." << (*x_iter)->get_name() << " = error }" << endl;
+          out << " { result." << (*x_iter)->get_name() << " = error }" << '\n';
         }
 
-        indent(out) << "catch let error { throw error }" << endl;
-        out << endl;
+        indent(out) << "catch let error { throw error }" << '\n';
+        out << '\n';
 
         if (!tfunction->is_oneway()) {
-          out << indent() << "try outProtocol.writeMessageBegin(name: \"" << tfunction->get_name() << "\", type: .reply, sequenceID: sequenceID)" << endl
-              << indent() << "try result.write(to: outProtocol)" << endl
-              << indent() << "try outProtocol.writeMessageEnd()" << endl
-              << indent() << "try outProtocol.transport.flush()" << endl;
+          out << indent() << "try outProtocol.writeMessageBegin(name: \"" << tfunction->get_name() << "\", type: .reply, sequenceID: sequenceID)" << '\n'
+              << indent() << "try result.write(to: outProtocol)" << '\n'
+              << indent() << "try outProtocol.writeMessageEnd()" << '\n'
+              << indent() << "try outProtocol.transport.flush()" << '\n';
         }
       } else {
         for (x_iter = xfields.begin(); x_iter != xfields.end(); ++x_iter) {
           indent(out) << "catch let error as " << (*x_iter)->get_type()->get_name();
           block_open(out);
-          indent(out) << "result." << (*x_iter)->get_name() << " = error" << endl;
+          indent(out) << "result." << (*x_iter)->get_name() << " = error" << '\n';
           block_close(out);
         }
 
         indent(out) << "catch let error";
         block_open(out);
-        out << indent() << "throw error" << endl;
+        out << indent() << "throw error" << '\n';
         block_close(out);
 
-        out << endl;
+        out << '\n';
 
         if (!tfunction->is_oneway()) {
-          out << indent() << "try outProtocol.writeMessageBeginWithName(\"" << tfunction->get_name() << "\", type: .REPLY, sequenceID: sequenceID)" << endl
-              << indent() << "try " << result_type << ".writeValue(result, toProtocol: outProtocol)" << endl
-              << indent() << "try outProtocol.writeMessageEnd()" << endl;
+          out << indent() << "try outProtocol.writeMessageBeginWithName(\"" << tfunction->get_name() << "\", type: .REPLY, sequenceID: sequenceID)" << '\n'
+              << indent() << "try " << result_type << ".writeValue(result, toProtocol: outProtocol)" << '\n'
+              << indent() << "try outProtocol.writeMessageEnd()" << '\n';
         }
       }
     }
@@ -2461,11 +2459,11 @@
 
   }
 
-  indent(out) << "return processorHandlers" << endl;
+  indent(out) << "return processorHandlers" << '\n';
 
   block_close(out,false);
-  out << "()" << endl;
-  out << endl;
+  out << "()" << '\n';
+  out << '\n';
 
   if (!gen_cocoa_) {
     indent(out) << "public func process(on inProtocol: TProtocol, outProtocol: TProtocol) throws";
@@ -2474,47 +2472,47 @@
   }
   block_open(out);
 
-  out << endl;
-  out << indent() << "let (messageName, _, sequenceID) = try inProtocol.readMessageBegin()" << endl
-      << endl
+  out << '\n';
+  out << indent() << "let (messageName, _, sequenceID) = try inProtocol.readMessageBegin()" << '\n'
+      << '\n'
       << indent() << "if let processorHandler = " << name << ".processorHandlers[messageName]";
   block_open(out);
   out << indent() << "do";
   block_open(out);
-  out << indent() << "try processorHandler(sequenceID, inProtocol, outProtocol, service)" << endl;
+  out << indent() << "try processorHandler(sequenceID, inProtocol, outProtocol, service)" << '\n';
   block_close(out);
   if (!gen_cocoa_) {
     out << indent() << "catch let error as TApplicationError";
     block_open(out);
-    out << indent() << "try outProtocol.writeException(messageName: messageName, sequenceID: sequenceID, ex: error)" << endl
-        << indent() << "try outProtocol.transport.flush()" << endl;
+    out << indent() << "try outProtocol.writeException(messageName: messageName, sequenceID: sequenceID, ex: error)" << '\n'
+        << indent() << "try outProtocol.transport.flush()" << '\n';
     block_close(out);
     block_close(out);
     out << indent() << "else";
     block_open(out);
-    out << indent() << "try inProtocol.skip(type: .struct)" << endl
-        << indent() << "try inProtocol.readMessageEnd()" << endl
-        << indent() << "let ex = TApplicationError(error: .unknownMethod(methodName: messageName))" << endl
-        << indent() << "try outProtocol.writeException(messageName: messageName, sequenceID: sequenceID, ex: ex)" << endl
-        << indent() << "try outProtocol.transport.flush()" << endl;
+    out << indent() << "try inProtocol.skip(type: .struct)" << '\n'
+        << indent() << "try inProtocol.readMessageEnd()" << '\n'
+        << indent() << "let ex = TApplicationError(error: .unknownMethod(methodName: messageName))" << '\n'
+        << indent() << "try outProtocol.writeException(messageName: messageName, sequenceID: sequenceID, ex: ex)" << '\n'
+        << indent() << "try outProtocol.transport.flush()" << '\n';
   } else {
     out << indent() << "catch let error as NSError";
     block_open(out);
-    out << indent() << "try outProtocol.writeExceptionForMessageName(messageName, sequenceID: sequenceID, ex: error)" << endl;
+    out << indent() << "try outProtocol.writeExceptionForMessageName(messageName, sequenceID: sequenceID, ex: error)" << '\n';
     block_close(out);
     block_close(out);
     out << indent() << "else";
     block_open(out);
-    out << indent() << "try inProtocol.skipType(.STRUCT)" << endl
-        << indent() << "try inProtocol.readMessageEnd()" << endl
-        << indent() << "try outProtocol.writeExceptionForMessageName(messageName," << endl;
+    out << indent() << "try inProtocol.skipType(.STRUCT)" << '\n'
+        << indent() << "try inProtocol.readMessageEnd()" << '\n'
+        << indent() << "try outProtocol.writeExceptionForMessageName(messageName," << '\n';
     indent_up();
-    out << indent() << "sequenceID: sequenceID," << endl
-        << indent() << "ex: NSError(" << endl;
+    out << indent() << "sequenceID: sequenceID," << '\n'
+        << indent() << "ex: NSError(" << '\n';
     indent_up();
-    out << indent() << "domain: TApplicationErrorDomain, " << endl
-        << indent() << "code: Int(TApplicationError.UnknownMethod.rawValue), " << endl
-        << indent() << "userInfo: [TApplicationErrorMethodKey: messageName]))" << endl;
+    out << indent() << "domain: TApplicationErrorDomain, " << '\n'
+        << indent() << "code: Int(TApplicationError.UnknownMethod.rawValue), " << '\n'
+        << indent() << "userInfo: [TApplicationErrorMethodKey: messageName]))" << '\n';
     indent_down();
     indent_down();
   }
@@ -2522,7 +2520,7 @@
   block_close(out);
   block_close(out);
   block_close(out);
-  out << endl;
+  out << '\n';
 }
 
 /**
@@ -2812,27 +2810,27 @@
     // Description
     string doc = tfunction->get_doc();
     generate_docstring(out, doc);
-    indent(out) << "///" << endl;
+    indent(out) << "///" << '\n';
 
     // Parameters
     const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
     vector<t_field*>::const_iterator f_iter;
     if (!fields.empty()) {
-      indent(out) << "/// - Parameters:" << endl;
+      indent(out) << "/// - Parameters:" << '\n';
       for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
         indent(out) << "///   - " << (*f_iter)->get_name() << ": ";
         string doc = (*f_iter)->get_doc();
         if (!doc.empty() && doc[doc.length()-1] == '\n') {
             doc.erase(doc.length()-1);
         }
-        out << doc << endl;
+        out << doc << '\n';
       }
     }
 
     // Returns
     t_type* ttype = tfunction->get_returntype();
     if (!ttype->is_void()) {
-      indent(out) << "/// - Returns: " << type_name(ttype) << endl;
+      indent(out) << "/// - Returns: " << type_name(ttype) << '\n';
     }
 
     // Throws
@@ -2845,7 +2843,7 @@
       if (*x_iter != xceptions.back()) {
         out << ", ";
       }    }
-    out << endl;
+    out << '\n';
 }
 
 /**
@@ -2865,20 +2863,20 @@
     // Description
     string doc = tfunction->get_doc();
     generate_docstring(out, doc);
-    indent(out) << "///" << endl;
+    indent(out) << "///" << '\n';
 
     // Parameters
     const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
     vector<t_field*>::const_iterator f_iter;
     if (!fields.empty()) {
-      indent(out) << "/// - Parameters:" << endl;
+      indent(out) << "/// - Parameters:" << '\n';
       for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
         indent(out) << "///   - " << (*f_iter)->get_name() << ": ";
         string doc = (*f_iter)->get_doc();
         if (!doc.empty() && doc[doc.length()-1] == '\n') {
             doc.erase(doc.length()-1);
         }
-        out << doc << endl;
+        out << doc << '\n';
       }
     }
 
@@ -2894,7 +2892,7 @@
         out << ", ";
       }
     }
-    out << endl;
+    out << '\n';
 }
 
 /**
diff --git a/compiler/cpp/src/thrift/generate/t_xml_generator.cc b/compiler/cpp/src/thrift/generate/t_xml_generator.cc
index 68675cf..86c2718 100644
--- a/compiler/cpp/src/thrift/generate/t_xml_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_xml_generator.cc
@@ -39,9 +39,6 @@
 using std::stack;
 using std::set;
 
-static const string endl = "\n";
-static const string quot = "\"";
-
 static const string default_ns_prefix = "http://thrift.apache.org/xml/ns/";
 
 /**
@@ -196,7 +193,7 @@
   close_top_element();
   // TODO: indent any EOLs that may occur with msg
   // TODO: proper msg escaping needed?
-  f_xml_ << indent() << "<!-- " << msg << " -->"  << endl;
+  f_xml_ << indent() << "<!-- " << msg << " -->"  << '\n';
   top_element_is_empty = false;
 }
 
@@ -204,7 +201,7 @@
   if( top_element_is_open) {
     top_element_is_open = false;
     if (elements_.size() > 0 && top_element_is_empty) {
-      f_xml_ << ">" << endl;
+      f_xml_ << ">" << '\n';
     }
   }
 }
@@ -224,9 +221,9 @@
 void t_xml_generator::write_element_end() {
   indent_down();
   if (top_element_is_empty && top_element_is_open) {
-    f_xml_ << " />" << endl;
+    f_xml_ << " />" << '\n';
   } else {
-    f_xml_ << indent() << "</" << elements_.top() << ">" << endl;
+    f_xml_ << indent() << "</" << elements_.top() << ">" << '\n';
   }
   top_element_is_empty = false;
   elements_.pop();
@@ -248,7 +245,7 @@
   top_element_is_empty = false;
   f_xml_ << indent()
     << "<" << name << ">" << escape_xml_string(val) << "</" << name << ">"
-    << endl;
+    << '\n';
 }
 
 string t_xml_generator::escape_xml_string(const string& input) {
@@ -511,7 +508,7 @@
 
   default:
     indent_up();
-    f_xml_ << indent() << "<null />" << endl;
+    f_xml_ << indent() << "<null />" << '\n';
     indent_down();
     break;
   }
diff --git a/compiler/cpp/src/thrift/generate/t_xsd_generator.cc b/compiler/cpp/src/thrift/generate/t_xsd_generator.cc
index 1f58f3a..8dd84f0 100644
--- a/compiler/cpp/src/thrift/generate/t_xsd_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_xsd_generator.cc
@@ -36,8 +36,6 @@
 using std::stringstream;
 using std::vector;
 
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
 /**
  * XSD generator, creates an XSD for the base types etc.
  *
@@ -121,22 +119,22 @@
   string f_php_name = get_out_dir() + program_->get_name() + "_xsd.php";
   f_php_.open(f_php_name.c_str());
 
-  f_php_ << "<?php" << endl
-         << autogen_comment() << endl;
+  f_php_ << "<?php" << '\n'
+         << autogen_comment() << '\n';
 }
 
 void t_xsd_generator::close_generator() {
-  f_php_ << "?>" << endl;
+  f_php_ << "?>" << '\n';
   f_php_.close();
 }
 
 void t_xsd_generator::generate_typedef(t_typedef* ttypedef) {
-  indent(s_xsd_types_) << "<xsd:simpleType name=\"" << ttypedef->get_name() << "\">" << endl;
+  indent(s_xsd_types_) << "<xsd:simpleType name=\"" << ttypedef->get_name() << "\">" << '\n';
   indent_up();
   indent(s_xsd_types_) << "<xsd:restriction base=\"" << type_name(ttypedef->get_type()) << "\" />"
-                       << endl;
+                       << '\n';
   indent_down();
-  indent(s_xsd_types_) << "</xsd:simpleType>" << endl << endl;
+  indent(s_xsd_types_) << "</xsd:simpleType>" << '\n' << '\n';
 }
 
 void t_xsd_generator::generate_struct(t_struct* tstruct) {
@@ -144,12 +142,12 @@
   const vector<t_field*>& members = tstruct->get_members();
   bool xsd_all = tstruct->get_xsd_all();
 
-  indent(s_xsd_types_) << "<xsd:complexType name=\"" << tstruct->get_name() << "\">" << endl;
+  indent(s_xsd_types_) << "<xsd:complexType name=\"" << tstruct->get_name() << "\">" << '\n';
   indent_up();
   if (xsd_all) {
-    indent(s_xsd_types_) << "<xsd:all>" << endl;
+    indent(s_xsd_types_) << "<xsd:all>" << '\n';
   } else {
-    indent(s_xsd_types_) << "<xsd:sequence>" << endl;
+    indent(s_xsd_types_) << "<xsd:sequence>" << '\n';
   }
   indent_up();
 
@@ -164,12 +162,12 @@
 
   indent_down();
   if (xsd_all) {
-    indent(s_xsd_types_) << "</xsd:all>" << endl;
+    indent(s_xsd_types_) << "</xsd:all>" << '\n';
   } else {
-    indent(s_xsd_types_) << "</xsd:sequence>" << endl;
+    indent(s_xsd_types_) << "</xsd:sequence>" << '\n';
   }
   indent_down();
-  indent(s_xsd_types_) << "</xsd:complexType>" << endl << endl;
+  indent(s_xsd_types_) << "</xsd:complexType>" << '\n' << '\n';
 }
 
 void t_xsd_generator::generate_element(ostream& out,
@@ -185,15 +183,15 @@
   string snillable = nillable ? " nillable=\"true\"" : "";
 
   if (ttype->is_void() || ttype->is_list()) {
-    indent(out) << "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">" << endl;
+    indent(out) << "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">" << '\n';
     indent_up();
     if (attrs == nullptr && ttype->is_void()) {
-      indent(out) << "<xsd:complexType />" << endl;
+      indent(out) << "<xsd:complexType />" << '\n';
     } else {
-      indent(out) << "<xsd:complexType>" << endl;
+      indent(out) << "<xsd:complexType>" << '\n';
       indent_up();
       if (ttype->is_list()) {
-        indent(out) << "<xsd:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">" << endl;
+        indent(out) << "<xsd:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">" << '\n';
         indent_up();
         string subname;
         t_type* subtype = ((t_list*)ttype)->get_elem_type();
@@ -203,55 +201,55 @@
           subname = type_name(subtype);
         }
         f_php_ << "$GLOBALS['" << program_->get_name() << "_xsd_elt_" << name << "'] = '" << subname
-               << "';" << endl;
+               << "';" << '\n';
         generate_element(out, subname, subtype, nullptr, false, false, true);
         indent_down();
-        indent(out) << "</xsd:sequence>" << endl;
-        indent(out) << "<xsd:attribute name=\"list\" type=\"xsd:boolean\" />" << endl;
+        indent(out) << "</xsd:sequence>" << '\n';
+        indent(out) << "<xsd:attribute name=\"list\" type=\"xsd:boolean\" />" << '\n';
       }
       if (attrs != nullptr) {
         const vector<t_field*>& members = attrs->get_members();
         vector<t_field*>::const_iterator a_iter;
         for (a_iter = members.begin(); a_iter != members.end(); ++a_iter) {
           indent(out) << "<xsd:attribute name=\"" << (*a_iter)->get_name() << "\" type=\""
-                      << type_name((*a_iter)->get_type()) << "\" />" << endl;
+                      << type_name((*a_iter)->get_type()) << "\" />" << '\n';
         }
       }
       indent_down();
-      indent(out) << "</xsd:complexType>" << endl;
+      indent(out) << "</xsd:complexType>" << '\n';
     }
     indent_down();
-    indent(out) << "</xsd:element>" << endl;
+    indent(out) << "</xsd:element>" << '\n';
   } else {
     if (attrs == nullptr) {
       indent(out) << "<xsd:element name=\"" << name << "\""
                   << " type=\"" << type_name(ttype) << "\"" << soptional << snillable << " />"
-                  << endl;
+                  << '\n';
     } else {
       // Wow, all this work for a SIMPLE TYPE with attributes?!?!?!
       indent(out) << "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">"
-                  << endl;
+                  << '\n';
       indent_up();
-      indent(out) << "<xsd:complexType>" << endl;
+      indent(out) << "<xsd:complexType>" << '\n';
       indent_up();
-      indent(out) << "<xsd:complexContent>" << endl;
+      indent(out) << "<xsd:complexContent>" << '\n';
       indent_up();
-      indent(out) << "<xsd:extension base=\"" << type_name(ttype) << "\">" << endl;
+      indent(out) << "<xsd:extension base=\"" << type_name(ttype) << "\">" << '\n';
       indent_up();
       const vector<t_field*>& members = attrs->get_members();
       vector<t_field*>::const_iterator a_iter;
       for (a_iter = members.begin(); a_iter != members.end(); ++a_iter) {
         indent(out) << "<xsd:attribute name=\"" << (*a_iter)->get_name() << "\" type=\""
-                    << type_name((*a_iter)->get_type()) << "\" />" << endl;
+                    << type_name((*a_iter)->get_type()) << "\" />" << '\n';
       }
       indent_down();
-      indent(out) << "</xsd:extension>" << endl;
+      indent(out) << "</xsd:extension>" << '\n';
       indent_down();
-      indent(out) << "</xsd:complexContent>" << endl;
+      indent(out) << "</xsd:complexContent>" << '\n';
       indent_down();
-      indent(out) << "</xsd:complexType>" << endl;
+      indent(out) << "</xsd:complexType>" << '\n';
       indent_down();
-      indent(out) << "</xsd:element>" << endl;
+      indent(out) << "</xsd:element>" << '\n';
     }
   }
 }
@@ -274,10 +272,10 @@
   }
 
   // Print the XSD header
-  f_xsd_ << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl
-         << "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" << ns << ">" << endl
+  f_xsd_ << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << '\n'
+         << "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" << ns << ">" << '\n'
          << xml_autogen_comment()
-         << endl;
+         << '\n';
 
   // Print out the type definitions
   indent(f_xsd_) << s_xsd_types_.str();
@@ -292,7 +290,7 @@
     string elemname = (*f_iter)->get_name() + "_response";
     t_type* returntype = (*f_iter)->get_returntype();
     generate_element(f_xsd_, elemname, returntype);
-    f_xsd_ << endl;
+    f_xsd_ << '\n';
 
     t_struct* xs = (*f_iter)->get_xceptions();
     const std::vector<t_field*>& xceptions = xs->get_members();
@@ -308,7 +306,7 @@
   }
 
   // Close the XSD document
-  f_xsd_ << endl << "</xsd:schema>" << endl;
+  f_xsd_ << '\n' << "</xsd:schema>" << '\n';
   f_xsd_.close();
 }
 
diff --git a/compiler/cpp/tests/netcore/t_netcore_generator_helpers_tests.cc b/compiler/cpp/tests/netcore/t_netcore_generator_helpers_tests.cc
index 6acedc0..348ac9f 100644
--- a/compiler/cpp/tests/netcore/t_netcore_generator_helpers_tests.cc
+++ b/compiler/cpp/tests/netcore/t_netcore_generator_helpers_tests.cc
@@ -5,9 +5,9 @@
 // to you under the Apache License, Version 2.0 (the
 // "License"); you may not use this file except in compliance
 // with the License. You may obtain a copy of the License at
-// 
+//
 //     http://www.apache.org/licenses/LICENSE-2.0
-// 
+//
 // Unless required by applicable law or agreed to in writing,
 // software distributed under the License is distributed on an
 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -36,7 +36,8 @@
                                 "using System.Threading;\n"
                                 "using System.Threading.Tasks;\n"
                                 "using Thrift;\n"
-                                "using Thrift.Collections;\n" + endl;
+                                "using Thrift.Collections;\n"
+                                "\n";
 
     t_program* program = new t_program(path, name);
     t_netstd_generator* gen = new t_netstd_generator(program, parsed_options, option_string);
@@ -65,7 +66,8 @@
                                     "using Thrift;\n"
                                     "using Thrift.Collections;\n"
                                     "using System.ServiceModel;\n"
-                                    "using System.Runtime.Serialization;\n" + endl;
+                                    "using System.Runtime.Serialization;\n"
+                                    "\n";
 
     t_program* program = new t_program(path, name);
     t_netstd_generator* gen = new t_netstd_generator(program, parsed_options, option_string);
diff --git a/contrib/fb303/TClientInfo.cpp b/contrib/fb303/TClientInfo.cpp
index a4b00cf..c30b42b 100644
--- a/contrib/fb303/TClientInfo.cpp
+++ b/contrib/fb303/TClientInfo.cpp
@@ -149,7 +149,7 @@
     char addrBuf[INET6_ADDRSTRLEN];
     const char* addrStr = info->getAddr(addrBuf, sizeof addrBuf);
     if (addrStr == nullptr) {
-      // cerr << "no addr!" << endl;
+      // cerr << "no addr!" << '\n';
       continue;
     }
 
@@ -160,7 +160,7 @@
     char buf[256];
     snprintf(buf, sizeof buf, "%d %s %s %.3f %llu", i, addrStr, callStr, secs,
              (uint64_t)info->getNCalls());
-               
+
     result.push_back(buf);
   }
 }
diff --git a/contrib/fb303/cpp/ServiceTracker.cpp b/contrib/fb303/cpp/ServiceTracker.cpp
index a2e670c..43e8847 100644
--- a/contrib/fb303/cpp/ServiceTracker.cpp
+++ b/contrib/fb303/cpp/ServiceTracker.cpp
@@ -344,7 +344,7 @@
       break;
     }
     cout << '[' << level_string << "] [" << now_pretty << "] "
-         << message << endl;
+         << message << '\n';
   }
 }
 
diff --git a/contrib/thrift_dump.cpp b/contrib/thrift_dump.cpp
index 59c8ac8..01864d0 100644
--- a/contrib/thrift_dump.cpp
+++ b/contrib/thrift_dump.cpp
@@ -80,12 +80,12 @@
       }
     }
   } catch (TProtocolException exn) {
-    cout << "Protocol Exception: " << exn.what() << endl;
+    cout << "Protocol Exception: " << exn.what() << '\n';
   } catch (...) {
     oprot->getTransport()->flush();
   }
 
-  cout << endl;
+  cout << '\n';
 
   return 0;
 }
diff --git a/contrib/zeromq/test-client.cpp b/contrib/zeromq/test-client.cpp
index 159c250..f2bd213 100644
--- a/contrib/zeromq/test-client.cpp
+++ b/contrib/zeromq/test-client.cpp
@@ -33,7 +33,7 @@
     usleep(50000);
   } else {
     int value = client.get();
-    std::cout << value << std::endl;
+    std::cout << value << '\n';
   }
 
   return 0;
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index 77daf3d..5e0c894 100644
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -51,7 +51,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -76,51 +75,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -136,7 +135,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -152,7 +151,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -169,7 +168,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -185,21 +184,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -216,7 +215,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -278,7 +277,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -288,7 +287,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -299,7 +298,7 @@
   void testException(const std::string &arg)
     noexcept(false)  override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -317,7 +316,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) noexcept(false) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -336,9 +335,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
diff --git a/lib/c_glib/test/testthrifttestzlibclient.cpp b/lib/c_glib/test/testthrifttestzlibclient.cpp
index 5c4b931..307fd4f 100644
--- a/lib/c_glib/test/testthrifttestzlibclient.cpp
+++ b/lib/c_glib/test/testthrifttestzlibclient.cpp
@@ -46,7 +46,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -71,51 +70,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -131,7 +130,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -147,7 +146,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -164,7 +163,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -180,21 +179,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -211,7 +210,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -273,7 +272,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -283,7 +282,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -294,7 +293,7 @@
   void testException(const std::string &arg)
     throw(Xception, apache::thrift::TException) override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -312,7 +311,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) throw(Xception, Xception2) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -331,9 +330,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
diff --git a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
index 7656596..43d4034 100644
--- a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
@@ -147,8 +147,7 @@
     self->finish(req);
   } catch (std::exception& e) {
     // don't propagate a C++ exception in C code (e.g. libevent)
-    std::cerr << "TEvhttpClientChannel::response exception thrown (ignored): " << e.what()
-              << std::endl;
+    std::cerr << "TEvhttpClientChannel::response exception thrown (ignored): " << e.what() << '\n';
   }
 }
 }
diff --git a/lib/cpp/src/thrift/async/TEvhttpServer.cpp b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
index 7d2cf21..bea9001 100644
--- a/lib/cpp/src/thrift/async/TEvhttpServer.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
@@ -127,13 +127,13 @@
   int rv = evhttp_add_header(ctx->req->output_headers, "Content-Type", "application/x-thrift");
   if (rv != 0) {
     // TODO: Log an error.
-    std::cerr << "evhttp_add_header failed " << __FILE__ << ":" << __LINE__ << std::endl;
+    std::cerr << "evhttp_add_header failed " << __FILE__ << ":" << __LINE__ << '\n';
   }
 
   struct evbuffer* buf = evbuffer_new();
   if (buf == nullptr) {
     // TODO: Log an error.
-    std::cerr << "evbuffer_new failed " << __FILE__ << ":" << __LINE__ << std::endl;
+    std::cerr << "evbuffer_new failed " << __FILE__ << ":" << __LINE__ << '\n';
   } else {
     uint8_t* obuf;
     uint32_t sz;
@@ -141,8 +141,7 @@
     int ret = evbuffer_add(buf, obuf, sz);
     if (ret != 0) {
       // TODO: Log an error.
-      std::cerr << "evhttp_add failed with " << ret << " " << __FILE__ << ":" << __LINE__
-                << std::endl;
+      std::cerr << "evhttp_add failed with " << ret << " " << __FILE__ << ":" << __LINE__ << '\n';
     }
   }
 
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp
index dd7d229..3f4d812 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFileTransport.cpp
@@ -55,8 +55,6 @@
 
 using std::shared_ptr;
 using std::cerr;
-using std::cout;
-using std::endl;
 using std::string;
 using namespace apache::thrift::protocol;
 using namespace apache::thrift::concurrency;
@@ -1032,7 +1030,7 @@
         break;
       }
     } catch (TException& te) {
-      cerr << te.what() << endl;
+      cerr << te.what() << '\n';
       break;
     }
   }
@@ -1060,7 +1058,7 @@
     } catch (TEOFException&) {
       break;
     } catch (TException& te) {
-      cerr << te.what() << endl;
+      cerr << te.what() << '\n';
       break;
     }
   }
diff --git a/lib/cpp/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index 97a5317..ba8c345 100644
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -53,7 +53,6 @@
   using namespace apache::thrift::transport;
   using namespace apache::thrift::protocol;
   using std::cout;
-  using std::endl;
 
   OneOfEach ooe;
   ooe.im_true = true;
@@ -84,7 +83,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   buf->getBuffer(&data, &datasize);
@@ -100,7 +99,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -113,7 +112,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -127,7 +126,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -140,7 +139,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -154,7 +153,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
 
@@ -177,7 +176,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   buf->getBuffer(&data, &datasize);
@@ -191,7 +190,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -202,7 +201,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -214,7 +213,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -225,7 +224,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -237,7 +236,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
 
diff --git a/lib/cpp/test/OneWayHTTPTest.cpp b/lib/cpp/test/OneWayHTTPTest.cpp
index 7823482..8789c2c 100644
--- a/lib/cpp/test/OneWayHTTPTest.cpp
+++ b/lib/cpp/test/OneWayHTTPTest.cpp
@@ -55,9 +55,6 @@
 using apache::thrift::transport::TSocket;
 using apache::thrift::transport::TTransportException;
 using std::shared_ptr;
-using std::cout;
-using std::cerr;
-using std::endl;
 using std::string;
 namespace utf = boost::unit_test;
 
@@ -70,12 +67,12 @@
 
   void roundTripRPC() override {
 #ifdef ENABLE_STDERR_LOGGING
-    cerr << "roundTripRPC()" << endl;
+    cerr << "roundTripRPC()" << '\n';
 #endif
   }
   void oneWayRPC() override {
 #ifdef ENABLE_STDERR_LOGGING
-    cerr << "oneWayRPC()" << std::endl ;
+    cerr << "oneWayRPC()" << '\n';
 #endif
  }
 };
@@ -201,7 +198,7 @@
 
   int port = ss->getPort() ;
 #ifdef ENABLE_STDERR_LOGGING
-  cerr << "port " << port << endl ;
+  cerr << "port " << port << '\n';
 #endif
 
   {
diff --git a/lib/cpp/test/TMemoryBufferTest.cpp b/lib/cpp/test/TMemoryBufferTest.cpp
index 2f1aea6..53e5d15 100644
--- a/lib/cpp/test/TMemoryBufferTest.cpp
+++ b/lib/cpp/test/TMemoryBufferTest.cpp
@@ -36,8 +36,6 @@
 using apache::thrift::transport::TMemoryBuffer;
 using apache::thrift::transport::TTransportException;
 using std::shared_ptr;
-using std::cout;
-using std::endl;
 using std::string;
 
 BOOST_AUTO_TEST_CASE(test_read_write_grow) {
diff --git a/lib/cpp/test/TServerSocketTest.cpp b/lib/cpp/test/TServerSocketTest.cpp
index 929defa..0860242 100644
--- a/lib/cpp/test/TServerSocketTest.cpp
+++ b/lib/cpp/test/TServerSocketTest.cpp
@@ -43,7 +43,7 @@
   accepted->close();
   sock1.close();
 
-  std::cout << "An error message from getaddrinfo on the console is expected:" << std::endl;
+  std::cout << "An error message from getaddrinfo on the console is expected:" << '\n';
   TServerSocket sock2("257.258.259.260", 0);
   BOOST_CHECK_THROW(sock2.listen(), TTransportException);
   sock2.close();
diff --git a/lib/cpp/test/ThrifttReadCheckTests.cpp b/lib/cpp/test/ThrifttReadCheckTests.cpp
index eb4ca01..481185e 100644
--- a/lib/cpp/test/ThrifttReadCheckTests.cpp
+++ b/lib/cpp/test/ThrifttReadCheckTests.cpp
@@ -55,8 +55,6 @@
 using apache::thrift::transport::TBufferedTransport;
 using apache::thrift::transport::TFramedTransport;
 using std::shared_ptr;
-using std::cout;
-using std::endl;
 using std::string;
 using std::memset;
 using namespace apache::thrift;
diff --git a/lib/cpp/test/concurrency/Tests.cpp b/lib/cpp/test/concurrency/Tests.cpp
index 45054a9..67de789 100644
--- a/lib/cpp/test/concurrency/Tests.cpp
+++ b/lib/cpp/test/concurrency/Tests.cpp
@@ -51,52 +51,52 @@
 
     ThreadFactoryTests threadFactoryTests;
 
-    std::cout << "ThreadFactory tests..." << std::endl;
+    std::cout << "ThreadFactory tests..." << '\n';
 
     const int reapLoops = 2 * WEIGHT;
     const int reapCount = 100 * WEIGHT;
     const size_t floodLoops = 3;
     const size_t floodCount = 500 * WEIGHT;
 
-    std::cout << "\t\tThreadFactory reap N threads test: N = " << reapLoops << "x" << reapCount << std::endl;
+    std::cout << "\t\tThreadFactory reap N threads test: N = " << reapLoops << "x" << reapCount << '\n';
 
     if (!threadFactoryTests.reapNThreads(reapLoops, reapCount)) {
-      std::cerr << "\t\ttThreadFactory reap N threads FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory reap N threads FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory flood N threads test: N = " << floodLoops << "x" << floodCount << std::endl;
+    std::cout << "\t\tThreadFactory flood N threads test: N = " << floodLoops << "x" << floodCount << '\n';
 
     if (!threadFactoryTests.floodNTest(floodLoops, floodCount)) {
-      std::cerr << "\t\ttThreadFactory flood N threads FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory flood N threads FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory synchronous start test" << std::endl;
+    std::cout << "\t\tThreadFactory synchronous start test" << '\n';
 
     if (!threadFactoryTests.synchStartTest()) {
-      std::cerr << "\t\ttThreadFactory synchronous start FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory synchronous start FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory monitor timeout test" << std::endl;
+    std::cout << "\t\tThreadFactory monitor timeout test" << '\n';
 
     if (!threadFactoryTests.monitorTimeoutTest()) {
-      std::cerr << "\t\ttThreadFactory monitor timeout FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory monitor timeout FAILED" << '\n';
       return 1;
     }
   }
 
   if (runAll || args[0].compare("util") == 0) {
 
-    std::cout << "Util tests..." << std::endl;
+    std::cout << "Util tests..." << '\n';
 
-    std::cout << "\t\tUtil minimum time" << std::endl;
+    std::cout << "\t\tUtil minimum time" << '\n';
 
     int64_t time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     int64_t time01 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
 
-    std::cout << "\t\t\tMinimum time: " << time01 - time00 << "ms" << std::endl;
+    std::cout << "\t\t\tMinimum time: " << time01 - time00 << "ms" << '\n';
 
     time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     time01 = time00;
@@ -107,54 +107,54 @@
       time01 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     }
 
-    std::cout << "\t\t\tscall per ms: " << count / (time01 - time00) << std::endl;
+    std::cout << "\t\t\tscall per ms: " << count / (time01 - time00) << '\n';
   }
 
   if (runAll || args[0].compare("timer-manager") == 0) {
 
-    std::cout << "TimerManager tests..." << std::endl;
+    std::cout << "TimerManager tests..." << '\n';
 
-    std::cout << "\t\tTimerManager test00" << std::endl;
+    std::cout << "\t\tTimerManager test00" << '\n';
 
     TimerManagerTests timerManagerTests;
 
     if (!timerManagerTests.test00()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test01" << std::endl;
+    std::cout << "\t\tTimerManager test01" << '\n';
 
     if (!timerManagerTests.test01()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test02" << std::endl;
+    std::cout << "\t\tTimerManager test02" << '\n';
 
     if (!timerManagerTests.test02()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test03" << std::endl;
+    std::cout << "\t\tTimerManager test03" << '\n';
 
     if (!timerManagerTests.test03()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test04" << std::endl;
+    std::cout << "\t\tTimerManager test04" << '\n';
 
     if (!timerManagerTests.test04()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
   }
 
   if (runAll || args[0].compare("thread-manager") == 0) {
 
-    std::cout << "ThreadManager tests..." << std::endl;
+    std::cout << "ThreadManager tests..." << '\n';
 
     {
       size_t workerCount = 10 * WEIGHT;
@@ -163,26 +163,26 @@
 
       ThreadManagerTests threadManagerTests;
 
-      std::cout << "\t\tThreadManager api test:" << std::endl;
+      std::cout << "\t\tThreadManager api test:" << '\n';
 
       if (!threadManagerTests.apiTest()) {
-        std::cerr << "\t\tThreadManager apiTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager apiTest FAILED" << '\n';
         return 1;
       }
 
       std::cout << "\t\tThreadManager load test: worker count: " << workerCount
-                << " task count: " << taskCount << " delay: " << delay << std::endl;
+                << " task count: " << taskCount << " delay: " << delay << '\n';
 
       if (!threadManagerTests.loadTest(taskCount, delay, workerCount)) {
-        std::cerr << "\t\tThreadManager loadTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager loadTest FAILED" << '\n';
         return 1;
       }
 
       std::cout << "\t\tThreadManager block test: worker count: " << workerCount
-                << " delay: " << delay << std::endl;
+                << " delay: " << delay << '\n';
 
       if (!threadManagerTests.blockTest(delay, workerCount)) {
-        std::cerr << "\t\tThreadManager blockTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager blockTest FAILED" << '\n';
         return 1;
       }
     }
@@ -190,7 +190,7 @@
 
   if (runAll || args[0].compare("thread-manager-benchmark") == 0) {
 
-    std::cout << "ThreadManager benchmark tests..." << std::endl;
+    std::cout << "ThreadManager benchmark tests..." << '\n';
 
     {
 
@@ -207,19 +207,19 @@
         size_t taskCount = workerCount * tasksPerWorker;
 
         std::cout << "\t\tThreadManager load test: worker count: " << workerCount
-                  << " task count: " << taskCount << " delay: " << delay << std::endl;
+                  << " task count: " << taskCount << " delay: " << delay << '\n';
 
         ThreadManagerTests threadManagerTests;
 
         if (!threadManagerTests.loadTest(taskCount, delay, workerCount))
         {
-          std::cerr << "\t\tThreadManager loadTest FAILED" << std::endl;
+          std::cerr << "\t\tThreadManager loadTest FAILED" << '\n';
           return 1;
         }
       }
     }
   }
 
-  std::cout << "ALL TESTS PASSED" << std::endl;
+  std::cout << "ALL TESTS PASSED" << '\n';
   return 0;
 }
diff --git a/lib/cpp/test/concurrency/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h
index 23e46e3..a2d55fe 100644
--- a/lib/cpp/test/concurrency/ThreadFactoryTests.h
+++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h
@@ -53,7 +53,7 @@
 
     void run() override {
       Synchronized s(_monitor);
-      
+
       if (--_count == 0) {
         _monitor.notify();
       }
@@ -82,7 +82,7 @@
               threadFactory.newThread(shared_ptr<Runnable>(new ReapNTask(*monitor, activeCount))));
         } catch (SystemResourceException& e) {
           std::cout << "\t\t\tfailed to create " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
           throw;
         }
       }
@@ -96,7 +96,7 @@
           (*thread)->start();
         } catch (SystemResourceException& e) {
           std::cout << "\t\t\tfailed to start  " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
           throw;
         }
       }
@@ -107,11 +107,11 @@
           monitor->wait(1000);
         }
       }
-      
-      std::cout << "\t\t\treaped " << lix* count << " threads" << std::endl;
+
+      std::cout << "\t\t\treaped " << lix* count << " threads" << '\n';
     }
 
-    std::cout << "\t\t\tSuccess!" << std::endl;
+    std::cout << "\t\t\tSuccess!" << '\n';
     return true;
   }
 
@@ -202,7 +202,7 @@
 
     bool success = true;
 
-    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << "!" << std::endl;
+    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << "!" << '\n';
 
     return true;
   }
@@ -239,7 +239,7 @@
     std::cout << "\t\t\t" << (success ? "Success" : "Failure")
               << ": minimum required time to elapse " << count * timeout
               << "ms; actual elapsed time " << endTime - startTime << "ms"
-              << std::endl;
+              << '\n';
 
     return success;
   }
@@ -250,14 +250,14 @@
     ~FloodTask() override {
       if (_id % 10000 == 0) {
 		Synchronized sync(_mon);
-        std::cout << "\t\tthread " << _id << " done" << std::endl;
+        std::cout << "\t\tthread " << _id << " done" << '\n';
       }
     }
 
     void run() override {
       if (_id % 10000 == 0) {
 		Synchronized sync(_mon);
-        std::cout << "\t\tthread " << _id << " started" << std::endl;
+        std::cout << "\t\tthread " << _id << " started" << '\n';
       }
     }
     const size_t _id;
@@ -270,7 +270,7 @@
 
     bool success = false;
     Monitor mon;
-	
+
     for (size_t lix = 0; lix < loop; lix++) {
 
       ThreadFactory threadFactory = ThreadFactory();
@@ -287,14 +287,14 @@
         } catch (TException& e) {
 
           std::cout << "\t\t\tfailed to start  " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
 
           return success;
         }
       }
 
       Synchronized sync(mon);
-      std::cout << "\t\t\tflooded " << (lix + 1) * count << " threads" << std::endl;
+      std::cout << "\t\t\tflooded " << (lix + 1) * count << " threads" << '\n';
       success = true;
     }
 
diff --git a/lib/cpp/test/concurrency/ThreadManagerTests.h b/lib/cpp/test/concurrency/ThreadManagerTests.h
index fee7c7c..b33fc27 100644
--- a/lib/cpp/test/concurrency/ThreadManagerTests.h
+++ b/lib/cpp/test/concurrency/ThreadManagerTests.h
@@ -76,7 +76,7 @@
       {
         Synchronized s(_monitor);
 
-        // std::cout << "Thread " << _count << " completed " << std::endl;
+        // std::cout << "Thread " << _count << " completed " << '\n';
 
         _count--;
         if (_count % 10000 == 0) {
@@ -131,13 +131,13 @@
       threadManager->add(*ix);
     }
 
-    std::cout << "\t\t\t\tloaded " << count << " tasks to execute" << std::endl;
+    std::cout << "\t\t\t\tloaded " << count << " tasks to execute" << '\n';
 
     {
       Synchronized s(monitor);
 
       while (activeCount > 0) {
-        std::cout << "\t\t\t\tactiveCount = " << activeCount << std::endl;
+        std::cout << "\t\t\t\tactiveCount = " << activeCount << '\n';
         monitor.wait();
       }
     }
@@ -184,13 +184,13 @@
 
     std::cout << "\t\t\tfirst start: " << firstTime << " Last end: " << lastTime
               << " min: " << minTime << "ms max: " << maxTime << "ms average: " << averageTime
-              << "ms" << std::endl;
+              << "ms" << '\n';
 
     bool success = (time01 - time00) >= ((int64_t)count * timeout) / (int64_t)workerCount;
 
     std::cout << "\t\t\t" << (success ? "Success" : "Failure")
               << "! expected time: " << ((int64_t)count * timeout) / (int64_t)workerCount << "ms elapsed time: " << time01 - time00
-              << "ms" << std::endl;
+              << "ms" << '\n';
 
     return success;
   }
@@ -307,7 +307,7 @@
       }
 
       std::cout << "\t\t\t"
-                << "Pending tasks " << threadManager->pendingTaskCount() << std::endl;
+                << "Pending tasks " << threadManager->pendingTaskCount() << '\n';
 
       {
         Synchronized s(blockMonitor);
@@ -323,18 +323,18 @@
       }
 
       std::cout << "\t\t\t"
-                << "Pending tasks " << threadManager->pendingTaskCount() << std::endl;
+                << "Pending tasks " << threadManager->pendingTaskCount() << '\n';
 
       try {
         threadManager->add(extraTask, 1);
       } catch (TimedOutException&) {
         std::cout << "\t\t\t"
-                  << "add timed out unexpectedly" << std::endl;
+                  << "add timed out unexpectedly" << '\n';
         throw TException("Unexpected timeout adding task");
 
       } catch (TooManyPendingTasksException&) {
         std::cout << "\t\t\t"
-                  << "add encountered too many pending exepctions" << std::endl;
+                  << "add encountered too many pending exepctions" << '\n';
         throw TException("Unexpected timeout adding task");
       }
 
@@ -375,10 +375,10 @@
       }
 
     } catch (TException& e) {
-      std::cout << "ERROR: " << e.what() << std::endl;
+      std::cout << "ERROR: " << e.what() << '\n';
     }
 
-    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << std::endl;
+    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << '\n';
     return success;
   }
 
@@ -390,7 +390,7 @@
     sleep_(100);
     int64_t b = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     if (b - a < 50 || b - a > 150) {
-      std::cerr << "\t\t\texpected 100ms gap, found " << (b-a) << "ms gap instead." << std::endl;
+      std::cerr << "\t\t\texpected 100ms gap, found " << (b-a) << "ms gap instead." << '\n';
       return false;
     }
 
@@ -403,18 +403,18 @@
     shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(1);
     threadManager->threadFactory(threadFactory);
 
-    std::cout << "\t\t\t\tstarting.. " << std::endl;
+    std::cout << "\t\t\t\tstarting.. " << '\n';
 
     threadManager->start();
     threadManager->setExpireCallback(expiredNotifier); // std::bind(&ThreadManagerTests::expiredNotifier, this));
 
-#define EXPECT(FUNC, COUNT) { size_t c = FUNC; if (c != COUNT) { std::cerr << "expected " #FUNC" to be " #COUNT ", but was " << c << std::endl; return false; } }
+#define EXPECT(FUNC, COUNT) { size_t c = FUNC; if (c != COUNT) { std::cerr << "expected " #FUNC" to be " #COUNT ", but was " << c << '\n'; return false; } }
 
     EXPECT(threadManager->workerCount(), 1);
     EXPECT(threadManager->idleWorkerCount(), 1);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tadd 2nd worker.. " << std::endl;
+    std::cout << "\t\t\t\tadd 2nd worker.. " << '\n';
 
     threadManager->addWorker();
 
@@ -422,7 +422,7 @@
     EXPECT(threadManager->idleWorkerCount(), 2);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove 2nd worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove 2nd worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -430,7 +430,7 @@
     EXPECT(threadManager->idleWorkerCount(), 1);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove 1st worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove 1st worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -438,7 +438,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tadd blocking task.. " << std::endl;
+    std::cout << "\t\t\t\tadd blocking task.. " << '\n';
 
     // We're going to throw a blocking task into the mix
     Monitor entryMonitor;   // signaled when task is running
@@ -454,7 +454,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tadd other task.. " << std::endl;
+    std::cout << "\t\t\t\tadd other task.. " << '\n';
 
     shared_ptr<ThreadManagerTests::Task> otherTask(
       new ThreadManagerTests::Task(doneMonitor, activeCount, 0));
@@ -465,7 +465,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 2);
 
-    std::cout << "\t\t\t\tremove blocking task specifically.. " << std::endl;
+    std::cout << "\t\t\t\tremove blocking task specifically.. " << '\n';
 
     threadManager->remove(blockingTask);
 
@@ -473,11 +473,11 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tremove next pending task.." << std::endl;
+    std::cout << "\t\t\t\tremove next pending task.." << '\n';
 
     shared_ptr<Runnable> nextTask = threadManager->removeNextPending();
     if (nextTask != otherTask) {
-      std::cerr << "\t\t\t\t\texpected removeNextPending to return otherTask" << std::endl;
+      std::cerr << "\t\t\t\t\texpected removeNextPending to return otherTask" << '\n';
       return false;
     }
 
@@ -485,15 +485,15 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove next pending task (none left).." << std::endl;
+    std::cout << "\t\t\t\tremove next pending task (none left).." << '\n';
 
     nextTask = threadManager->removeNextPending();
     if (nextTask) {
-      std::cerr << "\t\t\t\t\texpected removeNextPending to return an empty Runnable" << std::endl;
+      std::cerr << "\t\t\t\t\texpected removeNextPending to return an empty Runnable" << '\n';
       return false;
     }
 
-    std::cout << "\t\t\t\tadd 2 expired tasks and 1 not.." << std::endl;
+    std::cout << "\t\t\t\tadd 2 expired tasks and 1 not.." << '\n';
 
     shared_ptr<ThreadManagerTests::Task> expiredTask(
       new ThreadManagerTests::Task(doneMonitor, activeCount, 0));
@@ -509,28 +509,28 @@
     EXPECT(threadManager->pendingTaskCount(), 3);
     EXPECT(threadManager->expiredTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove expired tasks.." << std::endl;
+    std::cout << "\t\t\t\tremove expired tasks.." << '\n';
 
     if (!m_expired.empty()) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be empty" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be empty" << '\n';
       return false;
     }
 
     threadManager->removeExpiredTasks();
 
     if (m_expired.size() != 2) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be set" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be set" << '\n';
       return false;
     }
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired[0] to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired[0] to be the expired task" << '\n';
       return false;
     }
     m_expired.pop_front();
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired[1] to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired[1] to be the expired task" << '\n';
       return false;
     }
 
@@ -543,23 +543,23 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 2);
 
-    std::cout << "\t\t\t\tadd expired task (again).." << std::endl;
+    std::cout << "\t\t\t\tadd expired task (again).." << '\n';
 
     threadManager->add(expiredTask, 0, 1);  // expires in 1ms
     sleep_(50);  // make sure enough time elapses for it to expire - the shortest expiration time is 1ms
 
-    std::cout << "\t\t\t\tadd worker to consume expired task.." << std::endl;
+    std::cout << "\t\t\t\tadd worker to consume expired task.." << '\n';
 
     threadManager->addWorker();
     sleep_(100);  // make sure it has time to spin up and expire the task
 
     if (m_expired.empty()) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be set" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be set" << '\n';
       return false;
     }
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be the expired task" << '\n';
       return false;
     }
 
@@ -570,16 +570,16 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 3);
 
-    std::cout << "\t\t\t\ttry to remove too many workers" << std::endl;
+    std::cout << "\t\t\t\ttry to remove too many workers" << '\n';
     try {
       threadManager->removeWorker(2);
-      std::cerr << "\t\t\t\t\texpected InvalidArgumentException" << std::endl;
+      std::cerr << "\t\t\t\t\texpected InvalidArgumentException" << '\n';
       return false;
     } catch (const InvalidArgumentException&) {
       /* expected */
     }
 
-    std::cout << "\t\t\t\tremove worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -588,7 +588,7 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 3);
 
-    std::cout << "\t\t\t\tadd blocking task.. " << std::endl;
+    std::cout << "\t\t\t\tadd blocking task.. " << '\n';
 
     threadManager->add(blockingTask);
 
@@ -596,7 +596,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tadd worker.. " << std::endl;
+    std::cout << "\t\t\t\tadd worker.. " << '\n';
 
     threadManager->addWorker();
     {
@@ -610,7 +610,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tunblock task and remove worker.. " << std::endl;
+    std::cout << "\t\t\t\tunblock task and remove worker.. " << '\n';
 
     {
       Synchronized s(blockMonitor);
@@ -623,7 +623,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tcleanup.. " << std::endl;
+    std::cout << "\t\t\t\tcleanup.. " << '\n';
 
     blockingTask.reset();
     threadManager.reset();
diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index 2d1a262..9a53232 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -46,7 +46,7 @@
         _success(false),
         _done(false) {}
 
-    ~Task() override { std::cerr << this << std::endl; }
+    ~Task() override { std::cerr << this << '\n'; }
 
     void run() override {
 
@@ -84,7 +84,7 @@
       timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
       timerManager.start();
       if (timerManager.state() != TimerManager::STARTED) {
-        std::cerr << "timerManager is not in the STARTED state, but should be" << std::endl;
+        std::cerr << "timerManager is not in the STARTED state, but should be" << '\n';
         return false;
       }
 
@@ -104,15 +104,15 @@
       }
 
       if (!task->_done) {
-        std::cerr << "task is not done, but it should have executed" << std::endl;
+        std::cerr << "task is not done, but it should have executed" << '\n';
         return false;
       }
 
-      std::cout << "\t\t\t" << (task->_success ? "Success" : "Failure") << "!" << std::endl;
+      std::cout << "\t\t\t" << (task->_success ? "Success" : "Failure") << "!" << '\n';
     }
 
     if (orphanTask->_done) {
-      std::cerr << "orphan task is done, but it should not have executed" << std::endl;
+      std::cerr << "orphan task is done, but it should not have executed" << '\n';
       return false;
     }
 
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
index 79a708e..a424620 100644
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -155,7 +155,7 @@
       loopEchoString();
       break;
     default:
-      cerr << "Unexpected loop type" << _loopType << endl;
+      cerr << "Unexpected loop type" << _loopType << '\n';
       break;
     }
 
@@ -280,23 +280,23 @@
   usage << argv[0] << " [--port=<port number>] [--server] [--server-type=<server-type>] "
                       "[--protocol-type=<protocol-type>] [--workers=<worker-count>] "
                       "[--clients=<client-count>] [--loop=<loop-count>] "
-                      "[--client-type=<client-type>]" << endl
+                      "[--client-type=<client-type>]" << '\n'
         << "\tclients        Number of client threads to create - 0 implies no clients, i.e. "
-                            "server only.  Default is " << clientCount << endl
-        << "\thelp           Prints this help text." << endl
-        << "\tcall           Service method to call.  Default is " << callName << endl
-        << "\tloop           The number of remote thrift calls each client makes.  Default is " << loopCount << endl
+                            "server only.  Default is " << clientCount << '\n'
+        << "\thelp           Prints this help text." << '\n'
+        << "\tcall           Service method to call.  Default is " << callName << '\n'
+        << "\tloop           The number of remote thrift calls each client makes.  Default is " << loopCount << '\n'
         << "\tport           The port the server and clients should bind to "
-                            "for thrift network connections.  Default is " << port << endl
-        << "\tserver         Run the Thrift server in this process.  Default is " << runServer << endl
-        << "\tserver-type    Type of server, \"simple\" or \"thread-pool\".  Default is " << serverType << endl
-        << "\tprotocol-type  Type of protocol, \"binary\", \"ascii\", or \"xml\".  Default is " << protocolType << endl
-        << "\tlog-request    Log all request to ./requestlog.tlog. Default is " << logRequests << endl
-        << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is " << replayRequests << endl
+                            "for thrift network connections.  Default is " << port << '\n'
+        << "\tserver         Run the Thrift server in this process.  Default is " << runServer << '\n'
+        << "\tserver-type    Type of server, \"simple\" or \"thread-pool\".  Default is " << serverType << '\n'
+        << "\tprotocol-type  Type of protocol, \"binary\", \"ascii\", or \"xml\".  Default is " << protocolType << '\n'
+        << "\tlog-request    Log all request to ./requestlog.tlog. Default is " << logRequests << '\n'
+        << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is " << replayRequests << '\n'
         << "\tworkers        Number of thread pools workers.  Only valid "
-                            "for thread-pool server type.  Default is " << workerCount << endl
-        << "\tclient-type    Type of client, \"regular\" or \"concurrent\".  Default is " << clientType << endl
-        << endl;
+                            "for thread-pool server type.  Default is " << workerCount << '\n'
+        << "\tclient-type    Type of client, \"regular\" or \"concurrent\".  Default is " << clientType << '\n'
+        << '\n';
 
   map<string, string> args;
 
@@ -386,7 +386,7 @@
     }
 
   } catch (std::exception& e) {
-    cerr << e.what() << endl;
+    cerr << e.what() << '\n';
     cerr << usage.str();
   }
 
@@ -468,7 +468,7 @@
     server->setServerEventHandler(observer);
     std::shared_ptr<Thread> serverThread = threadFactory->newThread(server);
 
-    cerr << "Starting the server on port " << port << endl;
+    cerr << "Starting the server on port " << port << '\n';
 
     serverThread->start();
     observer->waitForService();
@@ -538,7 +538,7 @@
       Synchronized s(monitor);
       threadCount = clientCount;
 
-      cerr << "Launch " << clientCount << " " << clientType << " client threads" << endl;
+      cerr << "Launch " << clientCount << " " << clientType << " client threads" << '\n';
 
       time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
 
@@ -591,14 +591,14 @@
     averageTime /= clientCount;
 
     cout << "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount
-         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
+         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << '\n';
 
     count_map count = serviceHandler->getCount();
     count_map::iterator iter;
     for (iter = count.begin(); iter != count.end(); ++iter) {
       printf("%s => %d\n", iter->first, iter->second);
     }
-    cerr << "done." << endl;
+    cerr << "done." << '\n';
   }
 
   return 0;
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
index e94ecb2..d9d9ae6 100644
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -152,7 +152,7 @@
       loopEchoString();
       break;
     default:
-      cerr << "Unexpected loop type" << _loopType << endl;
+      cerr << "Unexpected loop type" << _loopType << '\n';
       break;
     }
 
@@ -253,24 +253,20 @@
 
   usage << argv[0] << " [--port=<port number>] [--server] [--server-type=<server-type>] "
                       "[--protocol-type=<protocol-type>] [--workers=<worker-count>] "
-                      "[--clients=<client-count>] [--loop=<loop-count>]" << endl
+                      "[--clients=<client-count>] [--loop=<loop-count>]" << '\n'
         << "\tclients        Number of client threads to create - 0 implies no clients, i.e. "
-           "server only.  Default is " << clientCount << endl
-        << "\thelp           Prints this help text." << endl
-        << "\tcall           Service method to call.  Default is " << callName << endl
-        << "\tloop           The number of remote thrift calls each client makes.  Default is "
-        << loopCount << endl << "\tport           The port the server and clients should bind to "
-                                "for thrift network connections.  Default is " << port << endl
-        << "\tserver         Run the Thrift server in this process.  Default is " << runServer
-        << endl << "\tserver-type    Type of server, \"simple\" or \"thread-pool\".  Default is "
-        << serverType << endl
-        << "\tprotocol-type  Type of protocol, \"binary\", \"ascii\", or \"xml\".  Default is "
-        << protocolType << endl
-        << "\tlog-request    Log all request to ./requestlog.tlog. Default is " << logRequests
-        << endl << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is "
-        << replayRequests << endl << "\tworkers        Number of thread pools workers.  Only valid "
-                                     "for thread-pool server type.  Default is " << workerCount
-        << endl;
+                            "server only.  Default is " << clientCount << '\n'
+        << "\thelp           Prints this help text." << '\n'
+        << "\tcall           Service method to call.  Default is " << callName << '\n'
+        << "\tloop           The number of remote thrift calls each client makes.  Default is " << loopCount << '\n'
+        << "\tport           The port the server and clients should bind to for thrift network "
+                            "connections.  Default is " << port << '\n'
+        << "\tserver         Run the Thrift server in this process.  Default is " << runServer << '\n'
+        << "\tserver-type    Type of server, \"simple\" or \"thread-pool\".  Default is " << serverType << '\n'
+        << "\tprotocol-type  Type of protocol, \"binary\", \"ascii\", or \"xml\".  Default is " << protocolType << '\n'
+        << "\tlog-request    Log all request to ./requestlog.tlog. Default is " << logRequests << '\n'
+        << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is " << replayRequests << '\n'
+        << "\tworkers        Number of thread pools workers.  Only valid for thread-pool server type.  Default is " << workerCount << '\n';
 
   map<string, string> args;
 
@@ -338,7 +334,7 @@
     }
 
   } catch (std::exception& e) {
-    cerr << e.what() << endl;
+    cerr << e.what() << '\n';
     cerr << usage.str();
   }
 
@@ -416,7 +412,7 @@
           new TNonblockingServer(serviceProcessor, protocolFactory, nbSocket2, threadManager)));
     }
 
-    cerr << "Starting the server on port " << port << " and " << (port + 1) << endl;
+    cerr << "Starting the server on port " << port << " and " << (port + 1) << '\n';
     serverThread->start();
     serverThread2->start();
 
@@ -475,7 +471,7 @@
       Synchronized s(monitor);
       threadCount = clientCount;
 
-      cerr << "Launch " << clientCount << " client threads" << endl;
+      cerr << "Launch " << clientCount << " client threads" << '\n';
 
       time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
 
@@ -528,14 +524,14 @@
     averageTime /= clientCount;
 
     cout << "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount
-         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
+         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << '\n';
 
     count_map count = serviceHandler->getCount();
     count_map::iterator iter;
     for (iter = count.begin(); iter != count.end(); ++iter) {
       printf("%s => %d\n", iter->first, iter->second);
     }
-    cerr << "done." << endl;
+    cerr << "done." << '\n';
   }
 
   return 0;
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index fd04ed8..c15281a 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -98,7 +98,7 @@
                 ss << "ERROR: send request with seqid " << m_last_seqid << " and got reply with seqid " << seqid;
                 throw std::logic_error(ss.str());
             } /* else {
-                std::cout << "verified seqid " << m_last_seqid << " round trip OK" << std::endl;
+                std::cout << "verified seqid " << m_last_seqid << " round trip OK" << '\n';
             } */
             return result;
         }
@@ -127,9 +127,9 @@
     std::ostringstream os;
     os << "test" << testNr;
     const bool ok = (s == os.str());
-    cout << "testString: " << s << " " << ((ok) ? "ok" : "failed") << endl;
+    cout << "testString: " << s << " " << ((ok) ? "ok" : "failed") << '\n';
   } catch (TException& exn) {
-    cout << "Error: " << exn.what() << endl;
+    cout << "Error: " << exn.what() << '\n';
   }
 
   if (testNr == 9)
@@ -139,7 +139,7 @@
 static void testVoid_clientReturn(event_base* base, ThriftTestCobClient* client) {
   try {
     client->recv_testVoid();
-    cout << "testVoid" << endl;
+    cout << "testVoid" << '\n';
 
     for (int testNr = 0; testNr < 10; ++testNr) {
       std::ostringstream os;
@@ -151,16 +151,16 @@
                        os.str());
     }
   } catch (TException& exn) {
-    cout << "Error: " << exn.what() << endl;
+    cout << "Error: " << exn.what() << '\n';
   }
 }
 
 // Workaround for absense of C++11 "auto" keyword.
 template <typename T>
 bool print_eq(T expected, T actual) {
-  cout << "(" << actual << ")" << endl;
+  cout << "(" << actual << ")" << '\n';
   if (expected != actual) {
-    cout << "*** FAILED ***" << endl << "Expected: " << expected << " but got: " << actual << endl;
+    cout << "*** FAILED ***" << '\n' << "Expected: " << expected << " but got: " << actual << '\n';
     return false;
   }
   return true;
@@ -174,7 +174,7 @@
   } catch (TTransportException&) {                                                                 \
     throw;                                                                                         \
   } catch (exception & ex) {                                                                       \
-    cout << "*** FAILED ***" << endl << ex.what() << endl;                                         \
+    cout << "*** FAILED ***" << '\n' << ex.what() << '\n';                                         \
     return_code |= ERR_BASETYPES;                                                                  \
   }
 
@@ -186,7 +186,7 @@
   } catch (TTransportException&) {                                                                 \
     throw;                                                                                         \
   } catch (exception & ex) {                                                                       \
-    cout << "*** FAILED ***" << endl << ex.what() << endl;                                         \
+    cout << "*** FAILED ***" << '\n' << ex.what() << '\n';                                         \
     return_code |= ERR_BASETYPES;                                                                  \
   }
 
@@ -258,7 +258,7 @@
   boost::program_options::notify(vm);
 
   if (vm.count("help")) {
-    cout << desc << endl;
+    cout << desc << '\n';
     return ERR_UNKNOWN;
   }
 
@@ -290,8 +290,8 @@
     }
 
   } catch (exception& e) {
-    cerr << e.what() << endl;
-    cout << desc << endl;
+    cerr << e.what() << '\n';
+    cout << desc << '\n';
     return ERR_UNKNOWN;
   }
 
@@ -319,9 +319,9 @@
   std::shared_ptr<TProtocol> protocol2;  // SecondService for multiplexed
 
   if (ssl) {
-    cout << "Client Certificate File: " << certPath << endl;
-    cout << "Client Key         File: " << keyPath << endl;
-    cout << "CA                 File: " << caPath << endl;
+    cout << "Client Certificate File: " << certPath << '\n';
+    cout << "Client Key         File: " << keyPath << '\n';
+    cout << "CA                 File: " << caPath << '\n';
 
     factory = std::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
     factory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
@@ -386,14 +386,14 @@
   if (port != 0) {
     cout << host << ":" << port;
   }
-  cout << endl;
+  cout << '\n';
 
   if (transport_type.compare("evhttp") == 0) {
     event_base* base = event_base_new();
-    cout << "Libevent Version: " << event_get_version() << endl;
-    cout << "Libevent Method: " << event_base_get_method(base) << endl;
+    cout << "Libevent Version: " << event_get_version() << '\n';
+    cout << "Libevent Method: " << event_base_get_method(base) << '\n';
 #if LIBEVENT_VERSION_NUMBER >= 0x02000000
-    cout << "Libevent Features: 0x" << hex << event_base_get_features(base) << endl;
+    cout << "Libevent Features: 0x" << hex << event_base_get_features(base) << '\n';
 #endif
 
     std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
@@ -421,7 +421,7 @@
     try {
       transport->open();
     } catch (TTransportException& ex) {
-      cout << "Connect failed: " << ex.what() << endl;
+      cout << "Connect failed: " << ex.what() << '\n';
       return ERR_UNKNOWN;
     }
 
@@ -438,12 +438,12 @@
     try {
       cout << "testVoid()" << flush;
       testClient.testVoid();
-      cout << " = void" << endl;
+      cout << " = void" << '\n';
     } catch (TTransportException&) {
       // Stop here if transport got broken
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -453,9 +453,9 @@
     cout << "testString(\"Test\")" << flush;
     string s;
     testClient.testString(s, "Test");
-    cout << " = " << s << endl;
+    cout << " = " << s << '\n';
     if (s != "Test") {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -471,9 +471,9 @@
           cout << "secondService.secondTestString(\"foo\") => " << flush;
         std::string result;
       ssc.secondtestString(result, "foo");
-      cout << "{" << result << "}" << endl;
+      cout << "{" << result << "}" << '\n';
       } catch (std::exception& e) {
-      cout << "  *** FAILED *** " << e.what() << endl;
+      cout << "  *** FAILED *** " << e.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
     }
@@ -514,16 +514,16 @@
 #endif
       cout << "testString(" << str << ") = " << flush;
       testClient.testString(s, str);
-      cout << s << endl;
+      cout << s << '\n';
       if (s != str) {
         cout.imbue(locale("en_US.UTF8"));
-        cout << "*** FAILED ***" << endl << "Expected string: " << str << " but got: " << s << endl << "CLEAR";
+        cout << "*** FAILED ***" << '\n' << "Expected string: " << str << " but got: " << s << '\n' << "CLEAR";
         return_code |= ERR_BASETYPES;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
       return return_code;
     }
@@ -537,11 +537,11 @@
           " char-to-test-json-parsing: ]] \"]] \\\" }}}{ [[[ ");
       cout << "testString(" << str << ") = " << flush;
       testClient.testString(s, str);
-      cout << s << endl;
+      cout << s << '\n';
       if (s != str) {
         cout.imbue(locale("en_US.UTF8"));
-        cout << "*** FAILED ***" << endl
-             << "Expected string: " << str << " but got: " << s << endl
+        cout << "*** FAILED ***" << '\n'
+             << "Expected string: " << str << " but got: " << s << '\n'
              << "CLEAR";
         ;
         return_code |= ERR_BASETYPES;
@@ -549,7 +549,7 @@
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
       return return_code;
     }
@@ -614,15 +614,15 @@
       double expected = pow(static_cast<double>(10), 307);
       cout << "testDouble(" << expected << ") = " << flush;
       double actual = testClient.testDouble(expected);
-      cout << "(" << actual << ")" << endl;
+      cout << "(" << actual << ")" << '\n';
       if (expected - actual > pow(static_cast<double>(10), 292)) {
-        cout << "*** FAILED ***" << endl
-             << "Expected: " << expected << " but got: " << actual << endl;
+        cout << "*** FAILED ***" << '\n'
+             << "Expected: " << expected << " but got: " << actual << '\n';
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -630,15 +630,15 @@
       double expected = pow(static_cast<double>(10), -292);
       cout << "testDouble(" << expected << ") = " << flush;
       double actual = testClient.testDouble(expected);
-      cout << "(" << actual << ")" << endl;
+      cout << "(" << actual << ")" << '\n';
       if (expected - actual > pow(static_cast<double>(10), -307)) {
-        cout << "*** FAILED ***" << endl
-             << "Expected: " << expected << " but got: " << actual << endl;
+        cout << "*** FAILED ***" << '\n'
+             << "Expected: " << expected << " but got: " << actual << '\n';
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -677,7 +677,7 @@
            in.i32_thing,
            in.i64_thing);
     if (in != out) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -700,7 +700,7 @@
            in.i64_thing,
            in2.i32_thing);
     if (in2 != out2) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -735,9 +735,9 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (mapin != mapout) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -760,15 +760,15 @@
           first = false;
         cout << it->first << " => " << it->second;
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       if (smapin != smapout) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -803,9 +803,9 @@
       }
       cout << *s_iter;
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (setin != setout) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -817,14 +817,14 @@
       vector<int32_t> listout;
       testClient.testList(listout, vector<int32_t>());
       if (!listout.empty()) {
-        cout << "*** FAILED ***" << endl;
-        cout << "invalid length: " << listout.size() << endl;
+        cout << "*** FAILED ***" << '\n';
+        cout << "invalid length: " << listout.size() << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
     try {
@@ -856,15 +856,15 @@
         }
         cout << *l_iter;
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       if (listin != listout) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -873,41 +873,41 @@
      */
     cout << "testEnum(ONE)" << flush;
     Numberz::type ret = testClient.testEnum(Numberz::ONE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::ONE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(TWO)" << flush;
     ret = testClient.testEnum(Numberz::TWO);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::TWO) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(THREE)" << flush;
     ret = testClient.testEnum(Numberz::THREE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::THREE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(FIVE)" << flush;
     ret = testClient.testEnum(Numberz::FIVE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::FIVE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(EIGHT)" << flush;
     ret = testClient.testEnum(Numberz::EIGHT);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::EIGHT) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -916,9 +916,9 @@
      */
     cout << "testTypedef(309858235082523)" << flush;
     UserId uid = testClient.testTypedef(309858235082523LL);
-    cout << " = " << uid << endl;
+    cout << " = " << uid << '\n';
     if (uid != 309858235082523LL) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -938,7 +938,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (mm.size() != 2 ||
         mm[-4][-4] != -4 ||
         mm[-4][-3] != -3 ||
@@ -948,7 +948,7 @@
         mm[4][3] != 3 ||
         mm[4][2] != 2 ||
         mm[4][1] != 1) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -1005,7 +1005,7 @@
         }
         cout << "}, ";
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       bool failed = false;
       map<UserId, map<Numberz::type, Insanity> >::const_iterator it1 = whoa.find(UserId(1));
       if (whoa.size() != 2) {
@@ -1033,7 +1033,7 @@
         }
       }
       if (failed) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_STRUCTS;
       }
     }
@@ -1041,7 +1041,7 @@
     /**
      * MULTI TEST
      */
-    cout << "testMulti()" << endl;
+    cout << "testMulti()" << '\n';
     try {
       map<int16_t, string> mul_map;
       Xtruct mul_result;
@@ -1054,13 +1054,13 @@
       xxs.i32_thing = 4242;
       xxs.i64_thing = 424242;
       if (mul_result != xxs) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_STRUCTS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -1069,7 +1069,7 @@
     try {
       cout << "testClient.testException(\"Xception\") =>" << flush;
       testClient.testException("Xception");
-      cout << "  void\n*** FAILED ***" << endl;
+      cout << "  void\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (Xception& e) {
@@ -1079,19 +1079,19 @@
     try {
       cout << "testClient.testException(\"TException\") =>" << flush;
       testClient.testException("TException");
-      cout << "  void\n*** FAILED ***" << endl;
+      cout << "  void\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (const TException&) {
-      cout << "  Caught TException" << endl;
+      cout << "  Caught TException" << '\n';
     }
 
     try {
       cout << "testClient.testException(\"success\") =>" << flush;
       testClient.testException("success");
-      cout << "  void" << endl;
+      cout << "  void" << '\n';
     } catch (exception & ex) {                                                                       \
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
 
@@ -1101,7 +1101,7 @@
       cout << "testClient.testMultiException(\"Xception\", \"test 1\") =>" << flush;
       Xtruct result;
       testClient.testMultiException(result, "Xception", "test 1");
-      cout << "  result\n*** FAILED ***" << endl;
+      cout << "  result\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
     } catch (Xception& e) {
       printf("  {%u, \"%s\"}\n", e.errorCode, e.message.c_str());
@@ -1111,7 +1111,7 @@
       cout << "testClient.testMultiException(\"Xception2\", \"test 2\") =>" << flush;
       Xtruct result;
       testClient.testMultiException(result, "Xception2", "test 2");
-      cout << "  result\n*** FAILED ***" << endl;
+      cout << "  result\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (Xception2& e) {
@@ -1124,7 +1124,7 @@
       testClient.testMultiException(result, "success", "test 3");
       printf("  {{\"%s\"}}\n", result.string_thing.c_str());
     } catch (exception & ex) {                                                                       \
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
 
@@ -1155,16 +1155,16 @@
      */
     cout << "re-test testI32(-1)" << flush;
     int i32 = testClient.testI32(-1);
-    cout << " = " << i32 << endl;
+    cout << " = " << i32 << '\n';
     if (i32 != -1)
       return_code |= ERR_BASETYPES;
 
-    cout << endl << "All tests done." << endl << flush;
+    cout << '\n' << "All tests done." << '\n' << flush;
 
     uint64_t stop = now();
     uint64_t tot = stop - start;
 
-    cout << "Total time: " << stop - start << " us" << endl;
+    cout << "Total time: " << stop - start << " us" << '\n';
 
     time_tot += tot;
     if (time_min == 0 || tot < time_min) {
@@ -1181,9 +1181,9 @@
 
   uint64_t time_avg = time_tot / numTests;
 
-  cout << "Min time: " << time_min << " us" << endl;
-  cout << "Max time: " << time_max << " us" << endl;
-  cout << "Avg time: " << time_avg << " us" << endl;
+  cout << "Min time: " << time_min << " us" << '\n';
+  cout << "Max time: " << time_max << " us" << '\n';
+  cout << "Avg time: " << time_avg << " us" << '\n';
 
   return return_code;
 }
@@ -1225,26 +1225,26 @@
     string bin_request;
     string bin_result;
 
-    cout << "testBinary(siz = " << siz << ")" << endl;
+    cout << "testBinary(siz = " << siz << ")" << '\n';
     binary_fill(bin_request, siz);
     try {
         testClient.testBinary(bin_result, bin_request);
 
         if (bin_request.size() != bin_result.size()) {
-            cout << "*** FAILED: request size " << bin_request.size() << "; result size " << bin_result.size() << endl;
+            cout << "*** FAILED: request size " << bin_request.size() << "; result size " << bin_result.size() << '\n';
             return ERR_BASETYPES;
         }
 
         for (string::size_type i = 0; i < siz; ++i) {
             if (bin_request.at(i) != bin_result.at(i)) {
-                cout << "*** FAILED: at position " << i << " request[i] is h" << hex << bin_request.at(i) << " result[i] is h" << hex << bin_result.at(i) << endl;
+                cout << "*** FAILED: at position " << i << " request[i] is h" << hex << bin_request.at(i) << " result[i] is h" << hex << bin_result.at(i) << '\n';
                 return ERR_BASETYPES;
             }
         }
     } catch (TTransportException&) {
         throw;
     } catch (exception& ex) {
-        cout << "*** FAILED ***" << endl << ex.what() << endl;
+        cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
         return ERR_BASETYPES;
     }
 
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 6c61f40..afd2938 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -394,7 +394,7 @@
   }
 
   void communicate(const char* event, void* ctx, const char* fn_name) {
-    std::cout << event << ": " << *static_cast<std::string*>(ctx) << " = " << fn_name << std::endl;
+    std::cout << event << ": " << *static_cast<std::string*>(ctx) << " = " << fn_name << '\n';
   }
 };
 
@@ -655,7 +655,7 @@
     }
 
   } catch (std::exception& e) {
-    cerr << e.what() << endl;
+    cerr << e.what() << '\n';
     cout << desc << "\n";
     return 1;
   }
@@ -767,7 +767,7 @@
   if (port != 0) {
     cout << port;
   }
-  cout << endl;
+  cout << '\n';
 
   // Multiplexed Processor if needed
   if (boost::starts_with(protocol_type, "multi")) {
@@ -823,7 +823,7 @@
               : new transport::TNonblockingServerSocket(port));
       server.reset(new TNonblockingServer(testProcessor, protocolFactory, nbSocket));
     } else {
-      cerr << "server-type nonblocking requires transport of http or framed" << endl;
+      cerr << "server-type nonblocking requires transport of http or framed" << '\n';
       exit(1);
     }
   }
@@ -857,6 +857,6 @@
     server.reset();
   }
 
-  cout << "done." << endl;
+  cout << "done." << '\n';
   return 0;
 }
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index 5208411..02e7b17 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -43,9 +43,9 @@
     transport->open();
 
     client.ping();
-    cout << "ping()" << endl;
+    cout << "ping()" << '\n';
 
-    cout << "1 + 1 = " << client.add(1, 1) << endl;
+    cout << "1 + 1 = " << client.add(1, 1) << '\n';
 
     Work work;
     work.op = Operation::DIVIDE;
@@ -54,27 +54,27 @@
 
     try {
       client.calculate(1, work);
-      cout << "Whoa? We can divide by zero!" << endl;
+      cout << "Whoa? We can divide by zero!" << '\n';
     } catch (InvalidOperation& io) {
-      cout << "InvalidOperation: " << io.why << endl;
-      // or using generated operator<<: cout << io << endl;
-      // or by using std::exception native method what(): cout << io.what() << endl;
+      cout << "InvalidOperation: " << io.why << '\n';
+      // or using generated operator<<: cout << io << '\n';
+      // or by using std::exception native method what(): cout << io.what() << '\n';
     }
 
     work.op = Operation::SUBTRACT;
     work.num1 = 15;
     work.num2 = 10;
     int32_t diff = client.calculate(1, work);
-    cout << "15 - 10 = " << diff << endl;
+    cout << "15 - 10 = " << diff << '\n';
 
     // Note that C++ uses return by reference for complex types to avoid
     // costly copy construction
     SharedStruct ss;
     client.getStruct(ss, 1);
-    cout << "Received log: " << ss << endl;
+    cout << "Received log: " << ss << '\n';
 
     transport->close();
   } catch (TException& tx) {
-    cout << "ERROR: " << tx.what() << endl;
+    cout << "ERROR: " << tx.what() << '\n';
   }
 }
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index 635afef..4c66cb8 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -48,15 +48,15 @@
 public:
   CalculatorHandler() = default;
 
-  void ping() override { cout << "ping()" << endl; }
+  void ping() override { cout << "ping()" << '\n'; }
 
   int32_t add(const int32_t n1, const int32_t n2) override {
-    cout << "add(" << n1 << ", " << n2 << ")" << endl;
+    cout << "add(" << n1 << ", " << n2 << ")" << '\n';
     return n1 + n2;
   }
 
   int32_t calculate(const int32_t logid, const Work& work) override {
-    cout << "calculate(" << logid << ", " << work << ")" << endl;
+    cout << "calculate(" << logid << ", " << work << ")" << '\n';
     int32_t val;
 
     switch (work.op) {
@@ -95,11 +95,11 @@
   }
 
   void getStruct(SharedStruct& ret, const int32_t logid) override {
-    cout << "getStruct(" << logid << ")" << endl;
+    cout << "getStruct(" << logid << ")" << '\n';
     ret = log[logid];
   }
 
-  void zip() override { cout << "zip()" << endl; }
+  void zip() override { cout << "zip()" << '\n'; }
 
 protected:
   map<int32_t, SharedStruct> log;
@@ -172,8 +172,8 @@
     threadManager);
   */
 
-  cout << "Starting the server..." << endl;
+  cout << "Starting the server..." << '\n';
   server.serve();
-  cout << "Done." << endl;
+  cout << "Done." << '\n';
   return 0;
 }
