FastLED 3.10.8
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 62 of file basic_vector.cpp.hpp.

62 {
63 if (n <= mCapacity) return;
64 fl::size new_capacity = (3 * mCapacity) / 2;
65 if (new_capacity < n) {
66 new_capacity = n;
67 }
68 grow_to(new_capacity);
69}
void grow_to(fl::size new_capacity) FL_NO_EXCEPT
Grow to new_capacity. Moves existing elements.

References fl::FL_NO_EXCEPT, 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: