data() may return a pointer to a buffer with embedded NULs, and the returned buffer may or may not be null terminated. Therefore it is typically a mistake to pass data() to a routine that expects a NUL terminated string. Use "as_string().c_str()" if you really need to do this. Or better yet, change your routine so it does not rely on NUL termination.
| 98 | // this. Or better yet, change your routine so it does not rely on NUL |
| 99 | // termination. |
| 100 | const char* data() const { return m_ptr; } |
| 101 | size_t size() const { return m_length; } |
| 102 | size_t length() const { return m_length; } |
| 103 | bool empty() const { return m_length == 0; } |
no outgoing calls