Merge pull request #3079 from ctiller/scrubbing-the-floor

Add ostream support for string_ref
pull/3077/head^2
Yang Gao 10 years ago
commit 6501071d16
  1. 3
      include/grpc++/support/string_ref.h
  2. 4
      src/cpp/util/string_ref.cc

@ -35,6 +35,7 @@
#define GRPCXX_STRING_REF_H
#include <iterator>
#include <iosfwd>
#include <grpc++/support/config.h>
@ -110,6 +111,8 @@ bool operator>(string_ref x, string_ref y);
bool operator<=(string_ref x, string_ref y);
bool operator>=(string_ref x, string_ref y);
std::ostream& operator<<(std::ostream& stream, const string_ref& string);
} // namespace grpc
#endif // GRPCXX_STRING_REF_H

@ -108,4 +108,8 @@ bool operator>=(string_ref x, string_ref y) {
return x.compare(y) >= 0;
}
std::ostream& operator<<(std::ostream& out, const string_ref& string) {
return out << grpc::string(string.begin(), string.end());
}
} // namespace grpc

Loading…
Cancel
Save