FastLED 3.9.15
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 457 of file basic_vector.cpp.hpp.

457 {
458 clear_impl();
459 if (other.mSize == 0) return;
460
461 reserve_impl(other.mSize);
462 if (mCapacity < other.mSize) return;
463
464 if (mOps) {
465 for (fl::size i = 0; i < other.mSize; ++i) {
466 mOps->copy_construct(element_ptr(i), other.element_ptr(i));
467 }
468 } else {
469 trivial_copy(mArray, other.mArray, other.mSize);
470 }
471 mSize = other.mSize;
472}
const vector_element_ops * mOps
void reserve_impl(fl::size n) FL_NOEXCEPT
void trivial_copy(void *dst, const void *src, fl::size count) const FL_NOEXCEPT
void * element_ptr(fl::size index) FL_NOEXCEPT
Pointer to element at index (byte arithmetic).
void clear_impl() FL_NOEXCEPT

References vector_basic(), clear_impl(), element_ptr(), FL_NOEXCEPT, 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: