Skip to content
Snippets Groups Projects
Commit 47ec9a40 authored by Craig Tiller's avatar Craig Tiller
Browse files

Add ostream support for string_ref

parent afbbaf9c
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment