FastLED 3.10.8
Loading...
Searching...
No Matches

◆ copy_from()

void fl::vector_basic::copy_from ( const vector_basic & other)
protected

Copy all elements from another vector_basic.

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

464 {
465 clear_impl();
466 if (other.mSize == 0) return;
467
468 reserve_impl(other.mSize);
469 if (mCapacity < other.mSize) return;
470
471 if (mOps) {
472 for (fl::size i = 0; i < other.mSize; ++i) {
473 mOps->copy_construct(element_ptr(i), other.element_ptr(i));
474 }
475 } else {
476 trivial_copy(mArray, other.mArray, other.mSize);
477 }
478 mSize = other.mSize;
479}
const vector_element_ops * mOps
void trivial_copy(void *dst, const void *src, fl::size count) const FL_NO_EXCEPT
void * element_ptr(fl::size index) FL_NO_EXCEPT
Pointer to element at index (byte arithmetic).
void clear_impl() FL_NO_EXCEPT
void reserve_impl(fl::size n) FL_NO_EXCEPT

References vector_basic(), clear_impl(), element_ptr(), fl::FL_NO_EXCEPT, mArray, mCapacity, mOps, mSize, reserve_impl(), and trivial_copy().

Referenced by fl::vector< fl::i16 >::vector(), fl::vector_psram< T >::vector_psram(), fl::VectorN< T, INLINED_SIZE >::VectorN(), fl::VectorN< T, INLINED_SIZE >::VectorN(), fl::VectorN< T, INLINED_SIZE >::VectorN(), fl::vector< fl::i16 >::operator=(), operator=(), fl::vector_psram< T >::operator=(), and fl::VectorN< T, INLINED_SIZE >::operator=().

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