We provide non-explicit singleton constructors so users can pass in a "const char*" or a "string" wherever a "StringPiece" is expected (likewise for char16, string16, StringPiece16).
| 182 | // in a "const char*" or a "string" wherever a "StringPiece" is |
| 183 | // expected (likewise for char16, string16, StringPiece16). |
| 184 | BasicStringPiece() : ptr_(NULL), length_(0) {} |
| 185 | BasicStringPiece(const value_type* str) |
| 186 | : ptr_(str), |
| 187 | length_((str == NULL) ? 0 : STRING_TYPE::traits_type::length(str)) {} |