[string.require] (original) (raw)
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 typebasic_string<charT, traits, Allocator> uses an object of typeAllocator to allocate and free storage for the contained charTobjects as needed.
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_typeis not the same type as charT.
— end note
]
References, pointers, and iterators referring to the elements of abasic_string sequence may be invalidated by the following uses of that basic_string object: