MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_sequential_container_tier2

Function test_sequential_container_tier2

tests/test_container_helpers.h:576–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574// For RandomAccess iterators (vector, deque)
575template<typename Container>
576typename fl::enable_if<has_insert_position<Container>::value &&
577 has_erase<Container>::value &&
578 has_iterator_plus<Container>::value>::type
579test_sequential_container_tier2() {
580 Container c;
581 populate(c, make_shared_int(10));
582 populate(c, make_shared_int(30));
583
584 // Test insert (using iterator arithmetic - RandomAccess only)
585 c.insert(c.begin() + 1, make_shared_int(20));
586 FL_CHECK(c.size() == 3);
587
588 // Test erase (using iterator arithmetic - RandomAccess only)
589 c.erase(c.begin() + 1);
590 FL_CHECK(c.size() == 2);
591}
592
593// Alternative for BidirectionalIterator containers (list)
594template<typename Container>

Callers

nothing calls this directly

Calls 6

populateFunction · 0.85
make_shared_intFunction · 0.85
insertMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected