21 Strings library [strings]

21.3 String classes [string.classes]

21.3.2 Class template basic_ยญstring [basic.string]

21.3.2.1 General requirements [string.require]

If any operation would cause size() to exceed max_ยญsize(), that operation throws an exception object of type length_ยญerror.
If any member function or operator of basic_ยญstring throws an exception, that function or operator has no other effect on the basic_ยญstring object.
In every specialization basic_ยญstring<charT, traits, Allocator>, the type allocator_ยญtraits<Allocator>โ€‹::โ€‹value_ยญtype shall name the same type as charT.
Every object of type basic_ยญstring<charT, traits, Allocator> uses an object of type Allocator to allocate and free storage for the contained charT objects as needed.
The Allocator object used is obtained as described in [container.requirements.general].
In every specialization basic_ยญstring<charT, traits, Allocator>, the type traits shall meet the character traits requirements ([char.traits]).
Note
:
The program is ill-formed if traitsโ€‹::โ€‹char_ยญtype is not the same type as charT.
โ€” end note
 ]
References, pointers, and iterators referring to the elements of a basic_ยญstring sequence may be invalidated by the following uses of that basic_ยญstring object:
For example, as an argument to non-member functions swap(), operator>>(), and getline(), or as an argument to basic_ยญstringโ€‹::โ€‹swap().
โฎฅ