FastLED 3.10.10
Loading...
Searching...
No Matches

◆ copy() [2/4]

void fl::basic_string::copy ( const basic_string & other)

Definition at line 225 of file basic_string.cpp.hpp.

416 {
417 fl::size len = other.size();
418 if (other.hasHeapData()) {
419 // Share the heap pointer
420 const auto& otherHeap = other.mStorage.get<NotNullStringHolderPtr>();
421 mStorage = otherHeap;
422 } else if (len + 1 <= mInlineCapacity) {
423 if (!isInline()) {
424 mStorage.reset();
425 }
426 const char* src = other.c_str();
427 char* dst = inlineBufferPtr();
428 fl::memcpy(dst, src, len + 1);
429 } else {
431 }
432 mLength = len;
433}
fl::size mInlineCapacity
char * inlineBufferPtr() FL_NO_EXCEPT
bool isInline() const FL_NO_EXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
Definition cstring.h:136

References fl::FL_NO_EXCEPT.