Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1083#discussion_r77873190
  
    --- Diff: compiler/cpp/src/generate/t_cpp_generator.cc ---
    @@ -541,6 +542,35 @@ void t_cpp_generator::generate_enum(t_enum* tenum) {
                     << tenum->get_name() << "Values"
                     << ", _k" << tenum->get_name() << "Names), "
                     << "::apache::thrift::TEnumIterator(-1, NULL, NULL));" << 
endl << endl;
    +
    +  generate_enum_ostream_operator(tenum);
    +}
    +
    +void t_cpp_generator::generate_enum_ostream_operator(t_enum* tenum) {
    +  f_types_ << "inline std::ostream& operator<<(std::ostream& out, const ";
    +  if (gen_pure_enums_) {
    +    f_types_ << tenum->get_name();
    +  } else {
    +    f_types_ << tenum->get_name() << "::type";
    --- End diff --
    
    I'm sure it's nothing important in this context, but the recommended 
signature for overloading operator << is to use a const ref for the value.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to