Index: third_party/protobuf/src/google/protobuf/stubs/stringpiece.h |
diff --git a/third_party/protobuf/src/google/protobuf/stubs/stringpiece.h b/third_party/protobuf/src/google/protobuf/stubs/stringpiece.h |
index 8910688bf46c9ed1559f6d76f253d164e0408cc3..9167165940d24e88cc29be0fe4de98a8579205ac 100644 |
--- a/third_party/protobuf/src/google/protobuf/stubs/stringpiece.h |
+++ b/third_party/protobuf/src/google/protobuf/stubs/stringpiece.h |
@@ -222,6 +222,14 @@ class LIBPROTOBUF_EXPORT StringPiece { |
: ptr_(str.data()), length_(0) { |
length_ = CheckedSsizeTFromSizeT(str.size()); |
} |
+#if defined(HAS_GLOBAL_STRING) |
+ template <class Allocator> |
+ StringPiece( // NOLINT(runtime/explicit) |
+ const basic_string<char, std::char_traits<char>, Allocator>& str) |
+ : ptr_(str.data()), length_(0) { |
+ length_ = CheckedSsizeTFromSizeT(str.size()); |
+ } |
+#endif |
StringPiece(const char* offset, stringpiece_ssize_type len) |
: ptr_(offset), length_(len) { |