Replace characters with value from another string.
- Parameters
-
| __pos1 | Index of first character to replace. |
| __n1 | Number of characters to be replaced. |
| __str | String to insert. |
| __pos2 | Index of first character of str to use. |
| __n2 | Number of characters from str to use. |
- Returns
- Reference to this string.
- Exceptions
-
Removes the characters in the range [__pos1,__pos1 + n) from this string. In place, the value of __str is inserted. If __pos is beyond end of string, out_of_range is thrown. If the length of the result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.
Definition at line 1950 of file cow_string.h.
constexpr size_type _M_limit(size_type __pos, size_type __off) const noexcept
constexpr void _M_data(pointer __p)
constexpr size_type _M_check(size_type __pos, const char *__s) const
constexpr basic_string & replace(size_type __pos, size_type __n, const basic_string &__str)
Replace characters with value from another string.
Managing sequences of characters and character-like objects.