| Home | Libraries | People | FAQ | More

##### basic_static_string::insert (4 of 11 overloads)

Insert into the string.

###### Synopsis

    template<
        std::size_t M>
    basic_static_string&
    insert(
        size_type index,
        const basic_static_string< M, CharT, Traits >& str);

###### Description

Inserts the string `str` at the position `index`.

###### Exception Safety

Strong guarantee.

###### Remarks

The insertion is done unchecked when the capacity of `str` differs from that of the string the function is called on.

###### Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

###### Template Parameters

Type | Description
--- | ---
`M` | The size of the input string.

###### Return Value

`*this`

###### Parameters

Name | Description
--- | ---
`index` | The index to insert at.
`str` | The string to insert.

###### Exceptions

Type | Thrown On
--- | ---
`std::length_error` | `size() + str.size() > max_size()`
`std::out_of_range` | `index > size()`