MCPcopy Create free account
hub / github.com/comaps/comaps / insert

Method insert

libs/base/buffer_vector.hpp:350–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349 template <typename TIt>
350 void insert(const_iterator where, TIt beg, TIt end)
351 {
352 size_t const pos = base::asserted_cast<size_t>(where - data());
353 ASSERT_LESS_OR_EQUAL(pos, size(), ());
354
355 if (IsDynamic())
356 {
357 m_dynamic.insert(m_dynamic.begin() + pos, beg, end);
358 return;
359 }
360
361 size_t const n = end - beg;
362 if (m_size + n <= N)
363 {
364 if (pos != m_size)
365 for (size_t i = m_size - 1; i >= pos && i < m_size; --i)
366 Swap(m_static[i], m_static[i + n]);
367
368 m_size += n;
369 T * writableWhere = &m_static[0] + pos;
370 ASSERT(where == writableWhere, ());
371 while (beg != end)
372 *(writableWhere++) = *(beg++);
373 }
374 else
375 {
376 SwitchToDynamic(m_size + n);
377 m_dynamic.insert(m_dynamic.begin() + pos, beg, end);
378 }
379 }
380
381 void insert(const_iterator where, value_type const & value) { insert(where, &value, &value + 1); }
382

Callers 15

operator()Method · 0.45
WriteMethod · 0.45
DiffMethod · 0.45
UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45
PopMethod · 0.45
CollectStringMethod · 0.45
CollectMethod · 0.45
setup.pyFile · 0.45
AppendMethod · 0.45
OutputToVectorMethod · 0.45
SweepFunction · 0.45

Calls 5

sizeFunction · 0.85
SwapFunction · 0.85
ASSERTFunction · 0.85
insertFunction · 0.85
beginMethod · 0.45

Tested by 15

UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36
MaliCompileShadersFunction · 0.36
UNIT_TESTFunction · 0.36
UNIT_CLASS_TESTFunction · 0.36
UNIT_CLASS_TESTFunction · 0.36
StrictQueryMethod · 0.36
UniqueMwmIdCountFunction · 0.36
GetNamesMethod · 0.36
FindAllFunction · 0.36
UNIT_TESTFunction · 0.36