MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / insert

Method insert

3ds/include/SmallVector.hpp:283–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 }
282
283 constexpr bool insert(const_iterator pos, const T& data) noexcept(
284 noexcept(nothrow_migrate(std::addressof(data()[0]), std::move(data()[0]))) && noexcept(nothrow_migrate(std::addressof(data()[0]), data()[0])))
285 requires std::is_copy_constructible_v<T>
286 {
287 if (pos == end()) {
288 return push_back(std::forward<const T&>(data));
289 }
290 if (size() < capacity()) {
291 for (auto i = end() - 1; i >= pos; i--) {
292 // Special case to increase size
293 if (i + 1 == end()) {
294 emplace_back(std::move(*(end() - 1)));
295 }
296 else {
297 nothrow_migrate(std::addressof(*(i + 1)), std::move(*i));
298 }
299 }
300
301 nothrow_migrate(begin() + (pos - begin()), data);
302
303 return true;
304 }
305
306 return false;
307 }
308
309 constexpr bool insert(const_iterator pos, T&& data) noexcept(noexcept(nothrow_migrate(std::addressof(data()[0]), std::move(data()[0]))))
310 requires std::is_move_constructible_v<T>

Callers 15

scanCardMethod · 0.45
appendCartTitleMethod · 0.45
requestMethod · 0.45
loadBackupListMethod · 0.45
splitWordMethod · 0.45
addFavoriteMethod · 0.45
addFilterMethod · 0.45
get_cbor_binaryMethod · 0.45
json.hppFile · 0.45
push_backFunction · 0.45
insert_iteratorFunction · 0.45

Calls 6

dataClass · 0.85
push_backFunction · 0.85
sizeFunction · 0.85
emplace_backFunction · 0.85
beginFunction · 0.85
endFunction · 0.50

Tested by

no test coverage detected