| Index: base/strings/string_piece.h
|
| diff --git a/base/strings/string_piece.h b/base/strings/string_piece.h
|
| index eaec14de5da788ebab2137df35015b9998ec892e..5333640fee3399441a62439011679f402824c6b1 100644
|
| --- a/base/strings/string_piece.h
|
| +++ b/base/strings/string_piece.h
|
| @@ -245,6 +245,9 @@ template <typename STRING_TYPE> class BasicStringPiece {
|
| return r;
|
| }
|
|
|
| + // This is the style of conversion preferred by std::string_view in C++17.
|
| + explicit operator STRING_TYPE() const { return as_string(); }
|
| +
|
| STRING_TYPE as_string() const {
|
| // std::string doesn't like to take a NULL pointer even with a 0 size.
|
| return empty() ? STRING_TYPE() : STRING_TYPE(data(), size());
|
|
|