| 30 | // ======= ACCESSORS ======= |
| 31 | |
| 32 | const char* basic_string::c_str() const { |
| 33 | if (mStorage.is<ConstView>()) { |
| 34 | const ConstView& view = mStorage.get<ConstView>(); |
| 35 | if (view.data && view.length > 0 && view.data[view.length] != '\0') { |
| 36 | const_cast<basic_string*>(this)->materialize(); |
| 37 | } |
| 38 | } |
| 39 | return constData(); |
| 40 | } |
| 41 | |
| 42 | char* basic_string::c_str_mutable() { |
| 43 | // Inline mode — already mutable |
no test coverage detected