We provide non-explicit singleton constructors so users can pass in a "const char*" or a "std::string" wherever a "StringPiece" is expected.
| 78 | // in a "const char*" or a "std::string" wherever a "StringPiece" is |
| 79 | // expected. |
| 80 | StringPiece() |
| 81 | : m_ptr(NULL), m_length(0) { } |
| 82 | StringPiece(const char* str) // NOLINT(runtime/explicit) |
| 83 | : m_ptr(str), m_length(strlen(m_ptr)) { } |
| 84 | StringPiece(const unsigned char* str) // NOLINT(runtime/explicit) |