FastLED 3.9.15
Loading...
Searching...
No Matches

◆ ensure_capacity()

void fl::vector_basic::ensure_capacity ( fl::size n)
private

Ensure capacity for at least n elements. Grows if needed.

Definition at line 49 of file basic_vector.cpp.hpp.

49 {
50 if (n <= mCapacity) return;
51 fl::size new_capacity = (3 * mCapacity) / 2;
52 if (new_capacity < n) {
53 new_capacity = n;
54 }
55 grow_to(new_capacity);
56}
void grow_to(fl::size new_capacity) FL_NOEXCEPT
Grow to new_capacity. Moves existing elements.

References grow_to(), and mCapacity.

Referenced by insert_copy_impl(), insert_move_impl(), push_back_copy_impl(), push_back_move_impl(), resize_impl(), and resize_value_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: