MCPcopy Create free account
hub / github.com/axmolengine/axmol / insert

Method insert

3rdparty/yasio/yasio/string.hpp:127–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 15

cpSpatialIndexInsertFunction · 0.45
helpers.cppFile · 0.45
probeMethod · 0.45
ALCossListPopulateFunction · 0.45
rehashMethod · 0.45
compact_set_valueFunction · 0.45
KeyFunction · 0.45
StringFunction · 0.45
AlignFunction · 0.45
WriteBytesFunction · 0.45
CreateSharedStringMethod · 0.45

Calls 2

fill_nFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected