Files
2025-10-25 03:02:53 +03:00

2.5 KiB

[string.accessors]

27 Strings library [strings]

27.4 String classes [string.classes]

27.4.3 Class template basic_string [basic.string]

27.4.3.8 String operations [string.ops]

27.4.3.8.1 Accessors [string.accessors]

🔗

constexpr const charT* c_str() const noexcept; constexpr const charT* data() const noexcept;

1

#

Returns: A pointer p such that p + i == addressof(operator) for eachi in [0, size()].

2

#

Complexity: Constant time.

3

#

Remarks: The program shall not modify any of the values stored in the character array; otherwise, the behavior is undefined.

🔗

constexpr charT* data() noexcept;

4

#

Returns: A pointer p such that p + i == addressof(operator) for eachi in [0, size()].

5

#

Complexity: Constant time.

6

#

Remarks: The program shall not modify the value stored at p + size() to any value other than charT(); otherwise, the behavior is undefined.

🔗

constexpr operator basic_string_view<charT, traits>() const noexcept;

7

#

Effects: Equivalent to:return basic_string_view<charT, traits>(data(), size());

🔗

constexpr allocator_type get_allocator() const noexcept;

8

#

Returns: A copy of theAllocator object used to construct the string or, if that allocator has been replaced, a copy of the most recent replacement.