| 125 | } |
| 126 | template <typename _Iter, ::yasio::enable_if_t<::yasio::is_iterator<_Iter>::value, int> = 0> |
| 127 | iterator insert(iterator _Where, _Iter first, _Iter last) |
| 128 | { |
| 129 | auto _Mylast = _Myfirst + _Mysize; |
| 130 | _YASIO_VERIFY_RANGE(_Where >= _Myfirst && _Where <= _Mylast && first <= last, "basic_string: out of range!"); |
| 131 | if (first != last) |
| 132 | { |
| 133 | auto insertion_pos = static_cast<size_type>(std::distance(_Myfirst, _Where)); |
| 134 | if (_Where == _Mylast) |
| 135 | append(first, last); |
| 136 | else |
| 137 | { |
| 138 | auto ifirst = std::addressof(*first); |
| 139 | static_assert(sizeof(*ifirst) == sizeof(value_type), "basic_string: iterator type incompatible!"); |
| 140 | auto count = static_cast<size_type>(std::distance(first, last)); |
| 141 | if (insertion_pos >= 0) |
| 142 | { |
| 143 | auto old_size = _Mylast - _Myfirst; |
| 144 | expand(count); |
| 145 | _Where = _Myfirst + insertion_pos; |
| 146 | _Mylast = _Myfirst + _Mysize; |
| 147 | auto move_to = _Where + count; |
| 148 | std::copy_n(_Where, _Mylast - move_to, move_to); |
| 149 | std::copy_n((iterator)ifirst, count, _Where); |
| 150 | } |
| 151 | } |
| 152 | return _Myfirst + insertion_pos; |
| 153 | } |
| 154 | return _Where; |
| 155 | } |
| 156 | iterator insert(iterator _Where, size_type count, const_reference val) |
| 157 | { |
| 158 | auto _Mylast = _Myfirst + _Mysize; |
no test coverage detected