aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/stubs/stringpiece.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
commit6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch)
treee575738adf52d24b883cca5e8928a5ded31caba1 /src/google/protobuf/stubs/stringpiece.h
parente7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff)
downloadprotobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/stubs/stringpiece.h')
-rw-r--r--src/google/protobuf/stubs/stringpiece.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/google/protobuf/stubs/stringpiece.h b/src/google/protobuf/stubs/stringpiece.h
index 563ff75d..c7bdd810 100644
--- a/src/google/protobuf/stubs/stringpiece.h
+++ b/src/google/protobuf/stubs/stringpiece.h
@@ -463,6 +463,9 @@ struct StringPiecePod {
std::string ToString() const {
return std::string(data_, static_cast<size_t>(size_));
}
+
+ operator string() const { return ToString(); }
+
private:
const char* data_;
stringpiece_ssize_type size_;