20 Strings library [strings]

20.3 String classes [string.classes]

20.3.2 Class template basic_­string [basic.string]

20.3.2.7 String operations [string.ops]

20.3.2.7.1 Accessors [string.accessors]

const charT* c_str() const noexcept; const charT* data() const noexcept;
Returns: A pointer p such that p + i == addressof(operator[](i)) for each i in [0, size()].
Complexity: Constant time.
Remarks: The program shall not modify any of the values stored in the character array; otherwise, the behavior is undefined.
charT* data() noexcept;
Returns: A pointer p such that p + i == addressof(operator[](i)) for each i in [0, size()].
Complexity: Constant time.
Remarks: The program shall not modify the value stored at p + size() to any value other than charT(); otherwise, the behavior is undefined.
operator basic_string_view<charT, traits>() const noexcept;
Effects: Equivalent to: return basic_­string_­view<charT, traits>(data(), size());
allocator_type get_allocator() const noexcept;
Returns: A copy of the Allocator object used to construct the string or, if that allocator has been replaced, a copy of the most recent replacement.